MORPH_OUTLINE Function (PV-WAVE Extreme Advantage)

Performs morphologic outlining for shape processing.

Usage

result = MORPH_OUTLINE(image, structure [, x0, y0])

Input Parameters

image—The array to be morphologically outlined.

structure—1D or 2D array containing structuring element. Array elements are interpreted as binary values, unless Gray is used.

x0—(optional) The x-coordinate of structure’s origin.

y0—(optional) The y-coordinate of structure’s origin.

Returned Value

result—An array of the same size and dimensions as image.

Keywords

DilationIf set, performs outlining by subtracting the original image from the dilated image; otherwise, the eroded image is subtracted from the original image.

Gray—If set, uses grayscale, rather than binary closing.

Values—An array of the same dimensions and number of elements as structure, containing the values of the structuring element.

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 outline operation is defined as the difference between either the dilated or eroded image and itself. These operations are defined for byte data type images only. Outlining produces an output image in which all pixels are the background gray-level value except those pixels that lie on an object’s boundary. The thickness of the boundary is determined by the dimensions of the structuring element.

Example

The results of this example are shown in Blob Collectioin and Blob Outlines.

; 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 + 'blobs.tif')
IMAGE_DISPLAY, test_image
; Find the blob outlines.
outline_image = MORPH_OUTLINE(test_image('pixels'), $
morph_struct, values = morph_struct)
LOADCT, 0
TVSCL, outline_image

 

Blob Collectioin

 

 

Blob Outlines

 

See Also

HIT_MISS, MORPH_CLOSE, MORPH_OPEN, SKELETONIZE, TOP_HAT

In the PV‑WAVE Reference:  DILATE,  ERODE