visionhdl.GrayscaleErosion
Morphologically erode grayscale pixel stream
Description
The visionhdl.GrayscaleErosion
System object™ morphologically erodes a grayscale pixel stream. This operation replaces
each pixel with the local minimum of the neighborhood around the pixel. The object
operates on a stream of grayscale pixel intensity values.
You can specify a neighborhood, or structuring element, of up to 32-by-32 pixels. For line, square, or rectangle structuring elements that are more than 8 pixels wide, the object uses the Van Herk algorithm to find the maximum. This algorithm uses only three comparators to find the maximums of all the rows, then uses a comparison tree to find the maximum of the row results.
For structuring elements that are less than 8 pixels wide, or that contain zero elements, the object implements a pipelined comparison tree for each row of the neighborhood. An additional comparison tree finds the maximum value of the row results. If the structuring element contains zeros that mask off pixels, the algorithm saves hardware resources by not implementing comparators for those pixel locations.
To morphologically erode a grayscale pixel stream:
Create the
visionhdl.GrayscaleErosion
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Description
creates a System object that morphologically erodes a grayscale pixel stream.eroder
= visionhdl.GrayErosion
sets properties using one or more name-value arguments. For example,
eroder
= visionhdl.GrayErosion(Name
,Value
)'Neighborhood',getnhood(strel('disk',4))
specifies a
4-by-4 disk-pattern neighborhood.
Properties
Usage
Description
This object uses a streaming pixel interface with a structure
for frame control signals. This interface enables the object to operate independently of image
size and format and to connect with other Vision HDL Toolbox™ objects. The object accepts and returns a scalar pixel value and control signals
as a structure containing five signals. The control signals indicate the validity of each pixel
and its location in the frame. To convert a pixel matrix into a pixel stream and control
signals, use the visionhdl.FrameToPixels
object. For a
description of the interface, see Streaming Pixel Interface.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
Algorithms
This object implements the algorithms described on the Grayscale Erosion block reference page.