If you integrate Vision HDL Toolbox designs with algorithms that use a different interface, you may need to create the structure manually, or manipulate the control signals outside of the structure.
Create a pixelcontrol
structure by passing five control signal values to the pixelcontrolstruct
function. The function arguments must be scalar values. These control signals may come from a camera or other video input source. The control signal vectors in this example describe a simple 2-by-3 pixel test image, surrounded by padding pixels.
Each element of ctrlIn
is a structure containing the five control signals.
ans = struct with fields:
hStart: 1
hEnd: 1
vStart: 0
vEnd: 0
valid: 1
You can then pass this structure to a Vision HDL Toolbox System object. This example uses the LookupTable object to invert each pixel.
Note: This object syntax runs only in R2016b or later. If you are using an earlier release, replace each call of an object with the equivalent step
syntax. For example, replace myObject(x)
with step(myObject,x)
.
If you need to use the control signals directly in downstream algorithms, you can flatten each structure into five logical
control signal values by calling the pixelcontrolsignals
function.
Each output control signal is a vector of logical values that correspond with the pixelOut
vector.
ans = 1x24 logical array
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0