Find mean value of input or sequence of inputs
The Mean
object finds the mean of an input
or sequence of inputs.
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.
H = vision.Mean
returns
an object, H
, that computes the mean of an input
or a sequence of inputs.
H = vision.Mean(
returns
a meanfinding 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
).

Calculate over single input or multiple inputs When you set this property to 

Additional input to enable resetting of running mean Set this property to 

Condition that triggers resetting of running mean Specify the event that resets the running mean as 

Dimension to operate along Specify how the mean calculation is performed over the data as 

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 

Enable regionofinterest processing Set this property to 

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

Calculate over entire ROI or just perimeter Specify whether to calculate the mean over the 

Calculate statistics for each ROI or one for all ROIs Specify whether to calculate 

Output flag indicating if any part of ROI is outside input image Set this property to Set this property to The default is 
reset  Reset computation of running mean 
step  Compute mean of input 
Common to All System Objects  

clone  Create System object with same property values 
getNumInputs  Expected number of inputs to a System object 
getNumOutputs  Expected number of outputs of a System object 
isLocked  Check locked states of a System object (logical) 
release  Allow System object property value changes 
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 2D Mean block reference page.