Re: Some kind of pantbucket-function? [message #34573] |
Wed, 02 April 2003 05:35 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Alexander Gro� (AlexanderGross_NOSPAM@gmx.de) writes:
> I have images (2D als well as 3D) with a lot of white dots surrounded by a
> black/dark medium. I want to find all white dots with the MAX-function wich
> returns only the whitest dot. In my case the dots have a size of more than
> one pixel, so I need some kind of a paintbucket function (like known in
> Photoshop) to fill the found dot with black and then search for the next dot
> in the image.
>
> Is this kind of function available in IDL 5.4? If not, I would greatly
> appreciate an implementation suggestion since I am new to IDL.
The MAX function can find the whitest dot, as well as the
index of that dot, but a more general solution would be
to use the HISTOGRAM function and REVERSE_INDICES to
locate these values.
http://www.dfanning.com/tips/histogram_tutorial.html
To "fill" the dot, use the brightest pixel as a seed
for the SEARCH2D function. This will give you the pixel
locations of all the "like-minded" pixels in the immediate
vicinity.
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
|
|
|