Package: vision
Find variance values in an input or sequence of inputs
The Variance
object finds variance values
in an input or sequence of inputs.
Note:
Starting in R2016b, instead of using the 
H = vision.Variance
returns
a System object, H
, that computes the variance of
an input or a sequence of inputs.
H = vision.Variance(
returns
a variance System object, Name
,Value
)H
, with each specified
property set to the specified value. You can specify additional namevalue
pair arguments in any order as (Name1
, Value1
,...,NameN
,ValueN
).
Code Generation Support 

Supports MATLAB^{®} Function block: Yes 
System Objects in MATLAB Code Generation. 
Code Generation Support, Usage Notes, and Limitations. 

Enable calculation over successive calls to step method Set this property to 

Enable resetting via an input in running variance mode Set this property to 

Reset condition for running variance mode Specify the event to reset the running variance as 

Numerical dimension to operate along Specify the dimension (onebased value) of the input signal,
over which the variance is computed. The value of this property cannot
exceed the number of dimensions in the input signal. This property
applies when you set the 

Numerical dimension to operate along Specify how the variance calculation is performed over the data
as 

Type of region of interest Specify the type of region of interest as 

Calculate over entire ROI or just perimeter Specify the region over which to calculate the variance as 

Enable region of interest processing Set this property to 

Statistics for each ROI, or one for all ROIs Specify what statistics to calculate as 

Output flag indicating if any part of ROI is outside input image Set this property to Set this property to The default is 
clone  Create variance object with same property values 
getNumInputs  Number of expected inputs to step method 
getNumOutputs  Number of outputs from step method 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
reset  Reset the internal states of the variance object 
step  Compute variance of input 
Determine the variance in a grayscale image.
img = im2single(rgb2gray(imread('peppers.png'))); hvar2d = vision.Variance; var2d = step(hvar2d,img);