Main Content

step

System object: visionhdl.ImageStatistics
Package: visionhdl

Calculate the contribution of one pixel to the mean, variance, and standard deviation of a video stream

Syntax

[mean,variance,stdDeviation,validOut] = step(statistics,pixelIn,ctrlIn)

Description

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.

[mean,variance,stdDeviation,validOut] = step(statistics,pixelIn,ctrlIn) incorporates the new pixel value, pixelIn, into calculations of video frame statistics. The control signals associated with each pixel, ctrlIn, indicate the frame boundaries. When validOut is true, the output values of mean, variance, and stdDeviation represent the statistics for the most recent input frame completed. The number of statistics returned depends on the object property settings.

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 connect with other Vision HDL Toolbox™ objects. The object accepts pixel data as integer, fixed-point, or floating-point data types. The object accepts 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

The System object performs an initialization the first time you call the step method. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the object issues an error. To change nontunable properties or inputs, first call the release method to unlock the object.

Input Arguments

expand all

Specify a visionhdl.ImageStatistics System object that you created and configured.

Single pixel, specified as a scalar value.

Supported data types:

  • uint8 or uint16

  • fixdt(0,N,0), N = 8,9,...,16

  • double and single data types are supported for simulation, but not for HDL code generation.

Control signals accompanying the input pixel stream, specified as a pixelcontrol structure containing five logical data type signals. The signals describe the validity of the pixel and its location in the frame. For more details, see Pixel Control Structure.

Data Types: struct

Output Arguments

expand all

Mean of the most recent frame of video input, returned as a scalar value.

The data type is the same as pixelIn.

Variance of the most recent frame of video input, returned as a scalar value.

The data type is the same as pixelIn. The fixed-point output word length is double the input word length.

Standard deviation of the most recent frame of video input, returned as a scalar value.

The data type is the same as pixelIn. Fixed-point output word length is double the input word length.

Validity of output statistics. When the object completes the calculations, it returns true. When this output is true, the other output arguments are valid. Data type is logical.

Introduced in R2015a