Re: Help With Finding Local Maxima of an Image (locmax) [message #65833 is a reply to message #65826] |
Wed, 25 March 2009 12:41  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
einszweilieb@gmail.com writes:
> I'm trying to use R. Sterner's "locmax" function (see below) to find
> local maxima (peaks of intensities) in an image. I'm a bit of a
> newbie to IDL so forgive me if my questions are silly :)
>
> As far as I can tell, all I need to do is read in the image (img) and
> use the command "locmax, img". Is that correct?
>
> When I do this I get the error message which says something like
> "return statements in functions must have 1 value" Line 79 (i.e. the
> second to last line below with the "return" statement).
>
> What's going wrong here? Why is the function trying to return
> multiple values? Isn't that what it's supposed to do - return all of
> the places where there's a local max?
>
> Can anyone help me with this? Does anyone know of any other
> procedures/functions which do similar things?
Here is the problem:
> function locmax, img, mask=m, where=w, ix=ix, iy=iy, sort=srt, $
> values=v, value_image=vimg, noedge=noed, help=hlp
Change the word "function" to "pro", compile it, and try it again.
I think this is a typo in the code, because clearly he meant for you
to call this as a procedure, not as a function.
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|