[SciPy-user] Sobel filter, magnitude and gradient direction

Sebastian Haase haase at msg.ucsf.edu
Tue Mar 25 05:23:49 EDT 2008


On Sat, Mar 22, 2008 at 3:50 PM, Daniele Di Mauro <daniele.dm at gmail.com> wrote:
> Hi Robert
> thanks for the answer,
>
>
> > The default axis is -1, so the Sobel operator is being applied along
> > the color axis, not one of the X or Y axes. Use the parameter axis=1
> > and axis=0 to get those, respectively.
> >
>
> as you suggest, the right way is:
>
> # where data is an Image object
> image_x= scipy.ndimage.filters.sobel(data,1)
> image_xy= scipy.ndimage.filters.sobel(image_x,0)
>
> is it right?
>  I tried it and the result it's even wors, as you can see:
> original: http://img135.imageshack.us/img135/3672/copyaa2.jpg
> sobel: http://img135.imageshack.us/img135/2484/imagexyqc4.jpg
>  do i have to do some adjustment? thanks in advance
>
> Daniele Di Mauro

As a sanity check:
Can you do this kind of filtering for grey scale images ?

Regards,
-Sebastian Haase



More information about the SciPy-User mailing list