REGION_FIND Function
Locates a possible seed point for a region in an image.
Usage
result = REGION_FIND(image, values, n_regions)
Input Parameters
image—A 2D array containing a homogeneous region.
values—An array containing the amplitude values used to search for regions in image.
n_regions—The maximum number of regions to search for in image. (0 < n_regions < 255)
Returned Value
result—A long array of seed points for regions found in image. Each seed point corresponds to an element number in image.
Keywords
Fill_Values—A scalar byte value or byte array of amplitudes with which to fill regions in image. (0 < Fill_Values < 255)
Region_Image—Specifies a variable to hold an array in which the regions found in image are identified and filled with the values Fill_Values.
Discussion
It is not always convenient to interactively indicate region seeds in an image. The REGION_FIND function provides an automated method for locating seed points and growing the regions at those locations. The region finding process begins by searching the image for pixels with amplitudes equal to an element of the values array. When a pixel with the specified value is located, it is grown, using the REGION_GROW function. In this way, the pixels belonging to the region for which the located pixel is a seed are eliminated from the next search. The image is continuously searched in this way until either no more region seeds can be located or the number of regions, indicated by the n_regions parameter, is reached.
Example
Find connected regions in a thresholded image.
; Read an image.
image = IMAGE_READ(!IP_Data + 'blobs.tif')
; Look for at least 20 regions of value 255 in thresh_image.
thresh_image = THRESHOLD(image('pixels'), 10, 200, /Binary)
; Fill regions with 1, ..., 20.
fill_values = BINDGEN(20) + 1B
seeds = REGION_FIND(thresh_image, 255, 20, $
Region_Image = region_image, Fill_Values = fill_values)
; Display the filled regions.
TVSCL, region_image
; Print the region seed locations.
PRINT, seeds
See Also