hls::Mean


Synopsis


1. without mask:
template<typename DST_T, int ROWS, int COLS, int SRC_T>
DST_T hls::Mean( hls::Mat<ROWS, COLS, SRC_T>& src );
2. with mask:
template<typename DST_T, int ROWS, int COLS, int SRC_T>
DST_T hls::Mean( hls::Mat<ROWS, COLS, SRC_T>& src,
                 hls::Mat<ROWS, COLS, HLS_8UC1>& mask );
 

Parameters

  • src – the input image.
  • mask – the operation mask, 8-bit single channel image, that specifies elements of the src image to be computed.

Description


Calculates an average of elements in image src, and return the value of first channel of result scalar.
If computes with mask:
Mean.png
Image data must be stored in src(if computes with mask, mask must have data stored). Invoking this function will consume the data in src(if computes with mask, the data of mask will be also consumed).
src and mask must have the same size. mask must have non-zero element.

OpenCV reference


cvMean, cv::mean