Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


REGION_GROW

REGION_GROW

The REGION_GROW function performs region growing for a given region within an N-dimensional array by finding all pixels within the array that are connected neighbors to the region pixels and that fall within provided constraints. The constraints are specified either as a threshold range (a minimum and maximum pixel value) or as a multiple of the standard deviation of the region pixel values. If the threshold is used (this is the default), the region is grown to include all connected neighboring pixels that fall within the given threshold range. If the standard deviation multiplier is used, the region is grown to include all connected neighboring pixels that fall within the range of the mean (of the region's pixel values) plus or minus the given multiplier times the sample standard deviation.

Example


The following lines create the map shown at the top of this topic.

; Load an image.
fname = FILEPATH('muscle.jpg', SUBDIR=['examples','data'])
READ_JPEG, fname, img
imgDims = SIZE(img, /DIMENSIONS)
 
; Define original region pixels.
x0 = 550
y0 = 300
x = INDGEN(16*16) MOD 16 + x0
y = INDGEN(16*16) / 16 + y0
roiPixels = x + y * imgDims[0]
 
; Grow the region.
newROIPixels = REGION_GROW(img, roiPixels, $
  STDDEV_MULTIPLIER=4)
 
; Draw the original image
im1 = IMAGE(img, LAYOUT=[1,2,1], DIM=[700, 900])
p = POLYGON(x0+[0,15,15,0], y0+[0,0,15,15], $
  COLOR='Lime', FILL_COLOR='Lime', /DATA)
 
; Color the grown region, and draw the new image.
img1 = img
img1[newROIPixels] = 255b
imgTrue = REBIN(img, imgDims[0], imgDims[1], 3)
imgTrue[*,*,1] = img1
im2 = IMAGE(imgTrue, LAYOUT=[1,2,2], /CURRENT)

Syntax


Result = REGION_GROW(Array, ROIPixels [, /ALL_NEIGHBORS] [, /NAN] [, STDDEV_MULTIPLIER=value | THRESHOLD=[min,max]] )

Return Value


REGION_GROW returns the vector of array indices that represent pixels within the grown region. The grown region will not include pixels at the edges of the input array. If no pixels fall within the grown region, this function will return the value -1.

Arguments


Array

An N-dimensional array of data values. The region will be grown according to the data values within this array.

ROIPixels

A vector of indices into Array that represent the initial region that is to be grown.

Keywords


ALL_NEIGHBORS

Set this keyword to indicate that all adjacent neighbors to a given pixel should be considered during region growing (sometimes known as 8-neighbor searching when the array is two-dimensional). The default is to search only the neighbors that are exactly one unit in distance from the current pixel (sometimes known as 4-neighbor searching when the array is two-dimensional).

NAN

Set this keyword to cause the routine to check for occurrences of the IEEE floating-point values NaN or Infinity in the input data. Elements with the value NaN or Infinity are treated as missing data.

STDDEV_MULTIPLIER

Set this keyword to a scalar value that serves as the multiplier of the sample standard deviation of the original region pixel values. The expanded region includes neighboring pixels that fall within the range of the mean of the region’s pixel values plus or minus the given multiplier times the sample standard deviation as follows:

Mean +/- StdDevMultiplier * StdDev

This keyword is mutually exclusive of THRESHOLD. If both keywords are specified, a warning message will be issued and the THRESHOLD value will be used.

THRESHOLD

Set this keyword to a two-element vector, [min,max], of the inclusive range within which the pixel values of the grown region must fall. The default is the range of pixel values within the initial region. This keyword is mutually exclusive of STDDEV_MULTIPLIER. If both keywords are specified, a warning message will be issued and the THRESHOLD value will be used.

Note: If neither keyword is specified, THRESHOLD is used by default. The range of threshold values is based upon the pixel values within the original region and therefore does not have to be provided.

Version History


5.5

Introduced

6.1

Added NAN keyword



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us