Morphological erosion of grayscale pixel data
visionhdl.GrayscaleErosion
performs morphological
erosion on a stream of pixel intensity values. You can specify a neighborhood, or
structuring element, of up to 32×32 pixels. For line, square, or rectangle
structuring elements 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 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.
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 full
description of the interface, see Streaming Pixel Interface.
Note
Starting in R2016b, instead of using the step
method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For
example, y = step(obj,x)
and y = obj(x)
perform equivalent operations.
returns a
System object, E
= visionhdl.GrayscaleErosionE
, that performs a morphological erosion on a pixel
stream.
returns a System object, E
= visionhdl.GrayscaleErosion(Name
,Value
)E
, with additional options specified by one or more
Name
,Value
pair arguments.
Name
is a property name and
Value
is the corresponding value. Name
must
appear inside single quotes (''
). You can specify several name-value
pair arguments in any order as Name1,Value1,...,NameN,ValueN
.
Properties not specified retain their default values.
|
Pixel neighborhood, specified as a vector or matrix of
The object supports neighborhoods of up to 32×32 pixels.
To use a structuring element, specify Default: |
|
Specify a power of two that accommodates the number of active pixels in a single horizontal line. Choose a power of two that accommodates the number of active
pixels in a horizontal line. If you specify a value that is not a
power of two, the object uses the next largest power of two. The object
allocates (neighborhood lines – 1)-by- Default: |
step | Report eroded pixel value based on neighborhood |
Common to All System Objects | |
---|---|
release | Allow System object property value changes |
This object implements the algorithms described on the Grayscale Erosion block reference page.
Grayscale Erosion | visionhdl.FrameToPixels
| visionhdl.GrayscaleDilation
| imerode
(Image Processing Toolbox)