Pull request: morphology fix

Tony Yu tsyu80 at gmail.com
Tue Oct 18 15:53:53 EDT 2011


2011/10/18 Stéfan van der Walt <stefan at sun.ac.za>

> Hi Tony
>
> On Sat, Oct 15, 2011 at 1:58 AM, Tony Yu <tsyu80 at gmail.com> wrote:>
> The open/close operations aren't that bad: they just shift features.
> But,
> > when calling white/black tophat operations, the shifting can lead to
> > over/underflow of pixels. I've attached examples of the lena image after
> > calling white tophat, both before and after the fix. The underflow should
> be
> > apparent in the first image.
>
> Thanks for investigating and fixing this subtle bug.  Talking about
> data-types, we should gradually move towards using the data type
> helper utilities, and thereby avoid possible over and underflow
> issues.
>

I'm definitely in favor of not requiring specific input dtypes.
Unfortunately, I believe a lot of extensions assume uint8 (at least those in
the cmorph.pyx do). Since img_as_uint casts values to uint16, should these
functions be written to use uint16? Also, are there ways to write fast
Cython extensions without specifying dtypes?

Best,
-Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20111018/4ce34348/attachment.html>


More information about the scikit-image mailing list