Image Processing Toolkit User Guide > Reference J–Z > MORPH_OPEN Function (PV-WAVE Extreme Advantage)
  

MORPH_OPEN Function (PV-WAVE Extreme Advantage)
Performs the morphologic-open operation for shape processing. The open operation is defined as erosion followed by dilation.
Usage
result = MORPH_OPEN(image, structure[, x0, y0])
Input Parameters
image—The array to be opened.
structure—A 1D or 2D array of structuring elements. The elements are interpreted as binary elements (values are either zero or nonzero), unless the Gray keyword is used.
x0—(optional) The x-coordinate of the structure’s origin.
y0—(optional) The y-coordinate of the structure’s origin.
Returned Value
result—The opened image that is of the same size and dimensions as image.
Keywords
Gray—If set, uses grayscale erosion and dilation. (Default: binary erosion and dilation)
Values—An array of values of the structuring element. The Values array must have the same dimensions and number of elements as the structure parameter.
Discussion
Morphological operations are defined for grayscale byte images. If image is not originally of type byte, PV‑WAVE makes a temporary copy of image that is of type byte before using it for the morphological processing.
The morphological opening operation is defined as erosion followed by dilation. These operations are defined for byte data type images only. Opening is typically used to smooth the boundaries of objects in images while removing noise spikes. Opening can by applied multiple times in succession to achieve greater degrees of smoothing or noise reduction.
Example
; Make a square structuring element.
morph_struct = BYTARR(3, 3)
morph_struct(*) = 1B
morph_struct(1, 1) = 0B
; Read an image.
test_image = IMAGE_READ(!IP_Data + 'vnitext.tif')
; Smooth the letters.
open_image = MORPH_OPEN(test_image('pixels'), morph_struct)
TVSCL, open_image
See Also
HIT_MISS, MORPH_CLOSE, MORPH_OUTLINE, SKELETONIZE, TOP_HAT
In the PV‑WAVE Reference:  DILATE,  ERODE

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.