Initial commit of binary morphology addon#691
Initial commit of binary morphology addon#691dov wants to merge 1 commit intopython-pillow:masterfrom
Conversation
|
Cool! |
|
Sounds good! The Travis CI build failed for Python 3.x: You may find it useful to enable Travis for your own repo here: |
|
Yeah, fix Py 3 and we'll merge this |
|
I've done some work on this in my morphology branch (https://github.com/wiredfool/Pillow/tree/morphology) It's working for all Cpython, 2.6->3.4, pypy is not working due to a missing PyByteArray_Size symbol in the C-api layer. I need to check with the pypy people if I'm just missing something there, but it's not going to happen tonight or tomorrow. |
|
@wiredfool Looks like 3.x still fails? |
|
It's this travis: https://travis-ci.org/wiredfool/Pillow/builds/28097706 based on my branch not the one on this thread. |
|
See #712 |
This pull request contains an initial implementation of a binary mathematical morphology (see: http://en.wikipedia.org/wiki/Mathematical_morphology) addon for Pillow. It is used to apply morphological operators on PIL images of mode 'L' where each pixel is considered binary. The library contains support for applying morphological operators on an image and returns a modified image. E.g. to run an erosion operator on an image do:
The library also supports returning matching features as a python list. E.g. the following code returns all corners found in a binary image:
Please let me know if you find this suitable for Pillow or if you would rather I keep it in a separate library.