Average/mean of matrix elements
m = mean2(im)
An image, which can be integer or double matrix, but must be one channel image.
The mean of the values in im , a scalar of class double.
mean2 computes the mean of a matrix using mean(im(:)).