Re: Finding "objects" in images [message #13182] |
Mon, 26 October 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Mark Rivers (rivers@cars3.uchicago.edu) writes:
> I am looking for code to detect "objects" in images. In this specific case I
> am looking for x-ray diffraction peaks in a CCD camera image, but the problem
> is general. I have used the IDL Erode and Dilate functions to clean up the
> data, so that I have adjacent pixels with value=1 inside the "objects" and all
> other pixels=0. I can easily make a list of all of the pixels which are
> inside the objects of interest. There might be hundreds of such pixels.
> But I want to do is to find the objects themselves which contain these adjacent
> pixels. There might only be a few such objects.
>
> I am sure there are lots of people doing this: finding cells or stars or
> whatever in images, and getting shape information about them.
I have used LABEL_REGION for this kind of thing successfully
in the past. It searches out each set of adjacent pixels
(adjacent can be defined as either four or eight neighbors)
and assigns all the pixels in a "blob" or region a unique
number. If there are eight blobs in the image, you get
an image where each blob is assigned a number from 1 to 8.
The WHERE function then pulls out all pixels belonging
to blob 7 easily.
This darn routine is hard to find if you have forgotten
its name, as I did just now. I searched five minutes
through on-line help before finally giving up and locating
the program in which I used it.
I've even used code posted here to find the centroid of
the blob and find out its general shape, orientation, etc.
Cheers,
David
----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|