hls::Avg


Synopsis


1. without mask:
template<int ROWS, int COLS, int SRC_T, int DST_T>
hls::Scalar<HLS_MAT_CN(DST_T), DST_T> hls::Avg( hls::Mat<ROWS, COLS, SRC_T>& src );
2. with mask:
template<int ROWS, int COLS, int SRC_T, int DST_T>
hls::Scalar<HLS_MAT_CN(DST_T), DST_T> hls::Avg( 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 result in hls::Scalar format.
If computes with mask:
Avg.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 maskmust have the same size. mask must have non-zero element.

OpenCV reference


cvAvg, cv::mean