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

Home » Public Forums » archive » Re: Calculate gradient
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Calculate gradient [message #70082] Sat, 13 March 2010 00:35 Go to previous message
James[2] is currently offline  James[2]
Messages: 44
Registered: November 2009
Member
You could use the SOBEL operator. This convolves the image with
kernels like so:

-1 0 1 1 2 1
-2 0 2 0 0 0
-1 0 1 -1 -2 -1

to get approximations of the x and y gradient respectively. IDL's
built-in SOBEL routine returns the magnitude, i.e. the sum of the
absolute values of each of these convolutions. It would be simple to
make the kernels yourself and use CONVOL if you want to keep the x and
y gradients separate.

I don't know much about contour plotting in IDL, but the CONTOUR
function is probably a good place to start...



On Mar 12, 1:41 pm, mslarkin <enhlw...@gmail.com> wrote:
> Hi IDL experts,
> I have a 2-D array (2708x4060), containing reflectance data. Is it
> possible to calculate the reflectance gradient (i.e. the rate of
> reflectance change over distance or array grid) throughout the array,
> and then draw lines of equal gradient (note that they’re NOT contour
> lines)?
> Thank you very much for your help!
> IDL beginner
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Proper Map Label Clipping
Next Topic: rejecting a few pixel values from an array of pixel values

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

Current Time: Wed Oct 08 16:18:17 PDT 2025

Total time taken to generate the page: 0.00183 seconds