MCPcopy Create free account
hub / github.com/creatale/node-dv / cvAvg

Function cvAvg

deps/opencv/modules/core/src/stat.cpp:2636–2651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2634
2635
2636CV_IMPL CvScalar
2637cvAvg( const void* imgarr, const void* maskarr )
2638{
2639 cv::Mat img = cv::cvarrToMat(imgarr, false, true, 1);
2640 cv::Scalar mean = !maskarr ? cv::mean(img) : cv::mean(img, cv::cvarrToMat(maskarr));
2641 if( CV_IS_IMAGE(imgarr) )
2642 {
2643 int coi = cvGetImageCOI((IplImage*)imgarr);
2644 if( coi )
2645 {
2646 CV_Assert( 0 < coi && coi <= 4 );
2647 mean = cv::Scalar(mean[coi-1]);
2648 }
2649 }
2650 return mean;
2651}
2652
2653
2654CV_IMPL void

Callers

nothing calls this directly

Calls 2

cvarrToMatFunction · 0.85
cvGetImageCOIFunction · 0.85

Tested by

no test coverage detected