vision.Variance System object

Package: vision

Find variance values in an input or sequence of inputs

Description

The Variance object finds variance values in an input or sequence of inputs.

Construction

H = vision.Variance returns a System object, H, that computes the variance of an input or a sequence of inputs.

H = vision.Variance(Name,Value) returns a variance System object, H, with each specified property set to the specified value. You can specify additional name-value 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.

Properties

RunningVariance

Enable calculation over successive calls to step method

Set this property to true to enable the calculation of the variance over successive calls to the step method. The default is false.

ResetInputPort

Enable resetting via an input in running variance mode

Set this property to true to enable resetting the running variance. When the property is set to true, a reset input must be specified to the step method to reset the running variance. This property applies when you set the RunningVariance property to true. The default is false.

ResetCondition

Reset condition for running variance mode

Specify the event to reset the running variance as Rising edge, Falling edge, Either edge, or Non-zero. This property applies when you set the ResetInputPort property to true. The default is Non-zero.

CustomDimension

Numerical dimension to operate along

Specify the dimension (one-based 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 Dimension property to Custom. The default is 1.

Dimension

Numerical dimension to operate along

Specify how the variance calculation is performed over the data as All, Row, Column, or Custom. This property applies only when you set the RunningVariance property to false. The default is All.

ROIForm

Type of region of interest

Specify the type of region of interest as Rectangles, Lines, Label matrix, or Binary mask. This property applies when you set the ROIProcessing property to true. Full ROI processing support requires a Computer Vision System Toolbox™ license. If you only have the DSP System Toolbox™ license, the ROIForm property value options are limited to Rectangles. The default is Rectangles.

ROIPortion

Calculate over entire ROI or just perimeter

Specify the region over which to calculate the variance as Entire ROI, or ROI perimeter. This property applies when you set the ROIForm property to Rectangles. The default is Entire ROI.

ROIProcessing

Enable region of interest processing

Set this property to true to enable calculating the variance within a particular region of each image. This property applies when you set the Dimension property to All and the RunningVariance property to false. Full ROI processing support requires a Computer Vision System Toolbox license. If you only have the DSP System Toolbox license, the ROIForm property value options are limited to Rectangles. The default is false.

ROIStatistics

Statistics for each ROI, or one for all ROIs

Specify what statistics to calculate as Individual statistics for each ROI , or Single statistic for all ROIs. This property does not apply when you set the ROIForm property to Binary mask. The default isIndividual statistics for each ROI.

ValidityOutputPort

Output flag indicating if any part of ROI is outside input image

Set this property to true to return the validity of the specified ROI as completely or partially inside of the image. This applies when you set the ROIForm property to Lines or Rectangles.

Set this property to true to return the validity of the specified label numbers. This applies when you set the ROIForm property to Label matrix.

The default is false.

 Fixed-Point Properties

Methods

cloneCreate variance object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and non-tunable properties
release Allow property value and input characteristics changes
resetReset the internal states of the variance object
stepCompute variance of input

Examples

Determine the variance in a grayscale image.

 img = im2single(rgb2gray(imread('peppers.png')));
 hvar2d = vision.Variance;
 var2d = step(hvar2d,img);
Was this topic helpful?