Mean, variance, and standard deviation
visionhdl.ImageStatistics
calculates the mean,
variance, and standard deviation of streaming video data. Each calculation is performed
over all pixels in the input region of interest (ROI). The object implements the
calculations using hardware-efficient algorithms.
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.
To change the size and dimensions of the ROI, you can manipulate the input video stream control signals. See Regions of Interest.
The number of valid pixels in the input image affect the accuracy of the mean approximation. To avoid approximation error, use an image that contains fewer than 64 pixels, a multiple of 64 pixels up to 642 pixels, a multiple of 4096 pixels up to 643 pixels, or a multiple of 643 pixels up to 644 pixels. For details of the mean approximation, see Algorithm.
The object calculates statistics over frames up to 644 (16,777,216) pixels in size.
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, S
= visionhdl.ImageStatisticsS
, that calculates the mean, variance, and standard
deviation of each frame of a video stream.
returns a System object, S
= visionhdl.ImageStatistics(Name
,Value
)S
, 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.
|
Calculate the mean of each input frame. If you set this property to
Default: |
|
Calculate the variance of each input frame. If you set this property to
Default: |
|
Calculate the standard deviation of each input frame. If you set this
property to Default: |
step | Calculate the contribution of one pixel to the mean, variance, and standard deviation of a video stream |
Common to All System Objects | |
---|---|
release | Allow System object property value changes |
This object implements the algorithms described on the Image Statistics block reference page.
Image Statistics | visionhdl.FrameToPixels
| vision.Mean
(Computer Vision Toolbox) | vision.StandardDeviation
(Computer Vision Toolbox) | vision.Variance
(Computer Vision Toolbox) | mean2
(Image Processing Toolbox) | std2
(Image Processing Toolbox)