Find mean value of input or sequence of inputs
H = vision.Mean returns an object, H, that computes the mean of an input or a sequence of inputs.
H = vision.Mean(Name,Value) returns a mean-finding 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).
Calculate over single input or multiple inputs
When you set this property to true, the object calculates the mean over a sequence of inputs. When you set this property to false, the object computes the mean over the current input. The default is false.
Additional input to enable resetting of running mean
Set this property to true to enable resetting of the running mean. When you set this property to true, a reset input must be specified to the step method to reset the running mean. This property applies only when you set the RunningMean property to true. The default is false.
Condition that triggers resetting of running mean
Specify the event that resets the running mean as Rising edge, Falling edge, Either edge, or Non-zero. This property applies only when you set the ResetInputPort property to true. The default is Non-zero.
Dimension to operate along
Specify how the mean calculation is performed over the data as All, Row, Column, or Custom. This property applies only when you set the RunningMean property to false. The default is All.
Numerical dimension to calculate over
Specify the integer dimension, indexed from one, of the input signal over which the object calculates the mean. The value of this property cannot exceed the number of dimensions in the input signal. This property only applies when you set the Dimension property to Custom. The default is 1.
Enable region-of-interest processing
Set this property to true to enable calculation of the mean within a particular region of an image. This property applies when you set the Dimension property to All and the RunningMean property to false. The default is false.
Type of region of interest
Specify the type of region of interest as Rectangles, Lines, Label matrix, or Binary mask. This property applies only when you set the ROIProcessing property to true. The default is Rectangles.
Calculate over entire ROI or just perimeter
Specify whether to calculate the mean over the Entire ROI or the ROI perimeter. This property applies only when you set the ROIForm property to Rectangles. The default is Entire ROI.
Calculate statistics for each ROI or one for all ROIs
Specify whether to calculate Individual statistics for each ROI or a Single statistic for all ROIs. This property applies only when you set the ROIForm property to Rectangles, Lines, or Label matrix. The default is Individual statistics for each ROI.
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.
|clone||Create mean 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 computation of running mean|
|step||Compute mean of input|
Determine the mean of a grayscale image.
img = im2single(rgb2gray(imread('peppers.png'))); hmean = vision.Mean; m = step(hmean,img);
This object implements the algorithm, inputs, and outputs described on the 2-D Mean block reference page.