Sobel / Prewitt Edge Detection

Chris Colbert sccolbert at gmail.com
Tue Apr 19 13:25:16 EDT 2011


I would like to see the scikit become an ndimage replacement, however that
would require us evolving to support nd-images rather than 2D images. Not
something I'd be opposed to necessary. In truth, there isn't a whole lot of
functionality in ndimage, and ignoring the nd part, we could implement all
of it ourselves quite easily; a fast convolution being the barrier to entry.

On Tue, Apr 19, 2011 at 1:16 PM, James Turner <jturner at gemini.edu> wrote:

> Hi Stefan & Chris,
>
> I hope this isn't too OT, but it's interesting that people would
> rather re-implement bits of ndimage than try to improve it. Maybe
> it's just too much work for a small part of the functionality.
> Can/should the scikit be viewed as a possible ndimage replacement in
> the longer run? Ndimage is a bit of a worry for me, since we need
> the type of functionality it provides but I'm not optimistic about
> having resources to help maintain its code in the near future.
>
> Just curious.
>
> Thanks!
>
> James.
>
>
>
> On 19/04/11 12:45, Chris Colbert wrote:
>
>> Goodluck making something faster than ndimage without considerable effort
>> (I've
>> already tried in Cython and was 10x slower). I read the ndimage source and
>> it
>> goes to great lengths to make optimum use of the cpu cache by allocating
>> line
>> buffers etc...
>>
>> What we need is to find a fast open source routine, wrap it with Cython,
>> and
>> package it with the scikit. I wouldn't suggest using the one from OpenCV
>> unless
>> we are desperate because it's implemented as a c++ filtering engine.
>> However,
>> they are using sse2 intrinsics and it's fast! Like 10x+ faster than
>> ndimage.
>>
>>
>> 2011/4/19 Stéfan van der Walt <stefan at sun.ac.za <mailto:stefan at sun.ac.za
>> >>
>>
>>    2011/4/19 Stéfan van der Walt <stefan at sun.ac.za <mailto:
>> stefan at sun.ac.za>>:
>>
>>     > Apparently, neither of these routines like integer images as inputs
>>     > (should be mentioned in the docs). Here's the output for float
>>     > images:
>>
>>    To be more specific, scipy.ndimage.convolve does not upcast
>>    appropriately when convolving integer arrays with floating point
>>    arrays. This alone seems like a good enough reason to have our own
>>    version, although I agree that we should use the 1D separated filters.
>>
>>    It doesn't look as if there is an easy way to coerce numpy.convolve to
>>    do the job, so I guess I should write something in Cython?
>>
>>    Regards
>>    Stéfan
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20110419/67225ad3/attachment.html>


More information about the scikit-image mailing list