comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Gradient of an Image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Gradient of an Image [message #33719] Fri, 24 January 2003 00:23 Go to next message
Thomas Gutzler is currently offline  Thomas Gutzler
Messages: 44
Registered: November 2002
Member
Hi Mati,

meron@cars3.uchicago.edu wrote:
> In article <3E30D896.7000602@ee.uwa.edu.au>, Thomas Gutzler <tgutzler@ee.uwa.edu.au> writes:
>
>> Hi,
>>
>> is it true that IDL currently has no function to calculate the gradient
>> of an image ?
>> Google found this for me:
>> http://groups.google.com/groups?q=gradient+image+group:comp. lang.idl-pvwave&hl=en&lr=&ie=UTF-8&oe=UTF-8& amp;selm=3396D128.4CE0%40dlr.de&rnum=1
>> and I am about to test, if this is doing the same as "Digital Image
>> Processing" by Gonzales/Woods sais on page 418ff.
>> Would be interesting to know, if anybody else has diffent (quicker?)
>> solutions.
>>
>
> If it is just the absolute value of the gradient you're after, then
> I've a function like this (written many years ago). And it can easily
> be modified to split the components of the gradient. The function is
> called ABGRAD and you'll find it in the IDL users contributions page,
> in my library (MIDL).

I figured out, that Hermann Mannsteins function does what I want. It
calculates a gradient of an image using the 'Sobel operator' and it does
it _very_ much faster than my testfunction did (It simply went through
the array in 2 for-loops and multiplied the subarray with the kernel,
summed the results and stored them in the final gradient-array).
convol rox :>
Just needs a Boundary-expansion to get better values at the bounds.

If anybody wants to have the code, just drop an email.

thanks anyway,
Tom
Re: Gradient of an Image [message #33720 is a reply to message #33719] Thu, 23 January 2003 23:05 Go to previous messageGo to next message
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <3E30D896.7000602@ee.uwa.edu.au>, Thomas Gutzler <tgutzler@ee.uwa.edu.au> writes:
> Hi,
>
> is it true that IDL currently has no function to calculate the gradient
> of an image ?
> Google found this for me:
> http://groups.google.com/groups?q=gradient+image+group:comp. lang.idl-pvwave&hl=en&lr=&ie=UTF-8&oe=UTF-8& amp;selm=3396D128.4CE0%40dlr.de&rnum=1
> and I am about to test, if this is doing the same as "Digital Image
> Processing" by Gonzales/Woods sais on page 418ff.
> Would be interesting to know, if anybody else has diffent (quicker?)
> solutions.
>
If it is just the absolute value of the gradient you're after, then
I've a function like this (written many years ago). And it can easily
be modified to split the components of the gradient. The function is
called ABGRAD and you'll find it in the IDL users contributions page,
in my library (MIDL).

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
Re: Gradient of an Image [message #33815 is a reply to message #33719] Fri, 24 January 2003 06:30 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Thomas Gutzler (tgutzler@ee.uwa.edu.au) writes:
>
> I figured out, that Hermann Mannsteins function does what I want. It
> calculates a gradient of an image using the 'Sobel operator' and it does
> it _very_ much faster than my testfunction did (It simply went through
> the array in 2 for-loops and multiplied the subarray with the kernel,
> summed the results and stored them in the final gradient-array).
> convol rox :>

Yes, it looks to me to do *exactly* what the SOBEL function
does. The other gradient operator found in IDL is the ROBERTS function.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Gradient of an Image [message #33818 is a reply to message #33719] Fri, 24 January 2003 00:45 Go to previous message
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <3E30F811.8020209@ee.uwa.edu.au>, Thomas Gutzler <tgutzler@ee.uwa.edu.au> writes:
> Hi Mati,
>
> meron@cars3.uchicago.edu wrote:
>> In article <3E30D896.7000602@ee.uwa.edu.au>, Thomas Gutzler <tgutzler@ee.uwa.edu.au> writes:
>>
>>> Hi,
>>>
>>> is it true that IDL currently has no function to calculate the gradient
>>> of an image ?
>>> Google found this for me:
>>> http://groups.google.com/groups?q=gradient+image+group:comp. lang.idl-pvwave&hl=en&lr=&ie=UTF-8&oe=UTF-8& amp;selm=3396D128.4CE0%40dlr.de&rnum=1
>>> and I am about to test, if this is doing the same as "Digital Image
>>> Processing" by Gonzales/Woods sais on page 418ff.
>>> Would be interesting to know, if anybody else has diffent (quicker?)
>>> solutions.
>>>
>>
>> If it is just the absolute value of the gradient you're after, then
>> I've a function like this (written many years ago). And it can easily
>> be modified to split the components of the gradient. The function is
>> called ABGRAD and you'll find it in the IDL users contributions page,
>> in my library (MIDL).
>
> I figured out, that Hermann Mannsteins function does what I want. It
> calculates a gradient of an image using the 'Sobel operator' and it does
> it _very_ much faster than my testfunction did (It simply went through
> the array in 2 for-loops and multiplied the subarray with the kernel,
> summed the results and stored them in the final gradient-array).
> convol rox :>

Sure.

> Just needs a Boundary-expansion to get better values at the bounds.
>
Unless you've information regarding what the boundary should be, it is
best to either force it to zero or to establish values by continuity.

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLgrWindow, IDLgrVolume and alpha channel
Next Topic: David's new tip articles

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:34:56 PDT 2025

Total time taken to generate the page: 0.00600 seconds