ctrl = pixelcontrolstruct(hStart,hEnd,vStart,vEnd,valid) creates
a structure containing the five control signals used by Vision HDL Toolbox™ objects.
The input arguments must be five scalars of logical type.
See Pixel Control Structure.
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.
ctrlIn(8)
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.
tabledata = uint8(linspace(255,0,256));
inverter = visionhdl.LookupTable(tabledata);
pixelOut = zeros(numPix,1,'uint8');
ctrlOut = repmat(pixelcontrolstruct,numPix,1);
for i = 1:numPix
[pixelOut(i),ctrlOut(i)] = inverter(pixel(i),ctrlIn(i));
end
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.
[hStartOut,vStartOut,hEndOut,vEndOut,validOut] = deal(false(numPix,1));
for i = 1:numPix
[hStartOut(i),vStartOut(i),hEndOut(i),vEndOut(i),validOut(i)] = ...
pixelcontrolsignals(ctrlOut(i));
end
Each output control signal is a vector of logical values that correspond with the pixelOut vector.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.