Select region of interest (ROI) from pixel stream
The visionhdl.ROISelector
System
object™ selects a portion of the active frame from a video stream. The total size
of the frame remains the same. The control signals indicate a new active region of the
frame. The diagram shows the inactive pixel regions in blue and the requested output
region outlined in orange.
You can specify a fixed size and location for the new frame, or select the frame location in real time via an input argument. You can select more than one region. Define each region by the upper-left corner coordinates and the dimensions. The object returns one set of pixels and control signals for each region you specify. The object sets the inactive pixels in the output frame to zero. Regions are independent from each other, so they can overlap. If you specify a region that includes the edge of the active frame, the object returns only the active portion of the region. The diagram shows the output frames for three requested regions. The second output region (treetops) does not include the inactive region above the frame.
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. The object accepts
and returns 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.
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, ROI
= visionhdl.ROISelectorROI
, that selects a default region of the active
frame from an input stream.
returns a System
object, ROI
= visionhdl.ROISelector(Name
,Value
)ROI
, 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.
|
Location of the output region definitions.
Default: |
|
Rectangular regions of interest to select from the input frame, specified as a N-by-4 matrix. N is the number of regions. You can select up to 16
regions. The four elements that define each region are the top-left starting
coordinates and the dimensions, Default: |
|
Number of You can select up to 16 regions. This property applies when you set
Default: |
step | Return next pixel in reselected frame |
Common to All System Objects | |
---|---|
release | Allow System object property value changes |
The generated HDL code for the visionhdl.ROISelector
System
object uses two 32-bit counters. It does not use additional counters for
additional regions.
The object has a latency of three cycles. The object returns the output pixel and
associated control signals on the third call to the step
method
after the pixel value was applied.