[SciPy-User] ndimage/morphology - binary dilation and erosion?
Sat Mar 31 13:08:41 CDT 2012
On Sat, Mar 31, 2012 at 6:48 PM, Tony Yu <email@example.com> wrote:
> Have you tried the `open` and `close` operators? A morphological opening
> is just an erosion followed by a dilation and the closing is just the
> reverse (see e.g., the scikits-image docstrings<http://scikits-image.org/docs/dev/api/skimage.morphology.html#greyscale-open>).
> For an opening, the erosion would remove some of "salt" (white pixels) in
> the letters, and the dilation would (more-or-less) restore the letters to
> their original thickness. The closing would do the same for black pixels on
> the background.
I tried grey opening on sample image with both modules. Approach seems
good and result is bit identical with both modules (footprint=square(3)),
and I thought to comment on differences on both modules:
- skimage requires converting data type to 'uint8' and won't accept
- ndimage grey opening is 3 times faster on my PC
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User