REGION_GROW Function
Grows homogeneous regions in an image, where the homogeneity is based on the region average.
Usage
result = REGION_GROW(image, region_seeds[, threshold])
Input Parameters
image—A 2D or 3D array with homogenous regions that contains an image; image, row or pixel-interleaved images; or a volume of any data type except string or complex.
region_seeds—A long array containing the element numbers of pixels in image to be used as seed points for growing individual regions. The number of elements in this parameter, n_regions must be < 255 elements.
threshold—(optional) A floating point scalar value that is the threshold around the region average used in determining whether or not a pixel belongs to a given region. (Default: 0.1)
Returned Value
result—A 2D or 3D byte array containing filled regions.
Keywords
Fill_Mean—If set, each region is filled with the mean of the image pixels in the region.
Fill_Values—A byte array of values used to fill the regions which were grown, where the values are 0 < Fill_Valuesi < 255. The number of values in Fill_Values is {1, ..., n_regions}, where n_regions is the number of elements in the region_seeds input parameter.
Intleave—A scalar string indicating the type of interleaving of 3D image arrays. Valid strings and the corresponding interleaving methods are:
*'pixel'—The input array arrangement is (pxy) for p  pixel-interleaved images of x-by-y.
*'row'—The 3D image array arrangement is (xpy) for p  row-interleaved images of x-by-y.
*'image'—The 3D image array arrangement is (xyp) for p  image-interleaved images of x-by-y.
*'volume'—The input image array is treated as a single entity.
Max_Iter—Specifies the maximum number of iterations used to grow a region. A region is grown until it converges (i.e., no more pixels can be added to the region) or Max_Iter is reached. (Default: 1000)
Discussion
Region growing is a segmentation method which uses the local pixel amplitude as the segmentation criteria. The REGION_GROW function performs image segmentation by pixel aggregation. Each region begins with a “seed” point as the initial region point. Neighboring pixels within a 3-by-3 area of each region point are then successively added to the region if the pixel value does not alter the region average by more than the value specified using the threshold parameter. When a new pixel is added to the region, the region average is updated to reflect all region members. The region growing process ends when no additional neighbors of the region pixels can be added to the region.
 
note
The REGION_MERGE function should be used in place of REGION_GROW when the region seed points are unknown.
Example
seeds = LONARR(3)
TVSCL, image
imgdims = SIZE(image, /Dimensions)
CURSOR, x, y, /Device
seeds(0) = LONG(x) + LONG(y)*imgdims(1) 
CURSOR, x, y, /Device
seeds(1) = LONG(x) + LONG(y)*imgdims(1) 
CURSOR, x, y, /Device
seeds(2) = LONG(x) + LONG(y)*imgdims(1) 
region_image = REGION_GROW(image, seeds, 1.0, $
Fill_Values = [10B, 20B, 30B])
See Also