Counts number of non-zero pixels in the whole image or selected image ROI.
Must be single-channel image or multi-channel image with COI set.
![]()
The function calculates the average value M=*_M and standard deviation S=*_S
of image elements, independently for each channel.
If COI is set, the function processes the selected channel only and stores
the average and standard deviation to the first compoenents of output scalars
(Mean and Deviation).

Finds minimum and maximum pixel values and their
positions. The extremums are searched over the whole image, selected ROI or,
if mask
is not NULL,in an image region of arbitrary shape. If the image has more
than one
channel, the COI must be selected first.

Calculates different types of norm for single or a pair of images. If mask
image is not NULL, only certain pixels will be considered to do the
calculation.
A
The first source image.
B
The second source image. If it is NULL, the absolute norm of A is
calculated, otherwise absolute or relative norm of A-B is calculated.
normType
Type of norm, see the discussion.
mask
The optional operation mask.
This function calculates the absolute norm of A if B is
NULL:
norm = ||A||C = maxI abs(A(I)), if normType = CV_C
norm = ||A||L1 = ∑I abs(A(I)), if normType = CV_L1
norm = ||A||L2 = sqrt( ∑I A(I)2), if normType = CV_L2
And the function calculates absolute or relative difference norm if B
is not NULL:
norm = ||A-B||C = maxI abs(A(I)-B(I)), if normType = CV_C
norm = ||A-B||L1 = ∑I abs(A(I)-B(I)), if normType = CV_L1
norm = ||A-B||L2 = sqrt( ∑I (A(I)-B(I))2 ), if normType = CV_L2
or
norm = ||A-B||C/||B||C, if normType = CV_RELATIVE_C
norm = ||A-B||L1/||B||L1, if normType = CV_RELATIVE_L1
norm = ||A-B||L2/||B||L2, if normType = CV_RELATIVE_L2
This function returns the calculated norm. The multiple-channel images are
treated as single-channel, that is results for all channels are combined.

Calculates sum S of image elements, independently for each channel.
If COI is set, the function processes the selected channel only and stores
the sum to the first element of the sum cluster.
![]()