简体   繁体   中英

How to use OpenCV's cv::Mat& to calculate “Coefficient of Variation”?

I'm trying to build an iOS to detect image changes from Camera.

OpenCV's iOS SDK kindly provides a delegate method passing cv::Mat&.

How can I calculate "Coefficient of Variation" using cv::Mat& ?

Should I look for a solution from combining multiple methods using cv::Mat& ?

Being a novice to OpenCV, I'll be immensely grateful to receive any hint.

You should indeed use the various Mat methods provided by the opencv, Some required for calculating Coefficient of Variation are :

meanStdDev : This will return you mean intensity value of the input mat and another Mat of the same size as the input Mat containing the values of deviation from the mean value.

mean You may also like to find out the mean value of the output Mat .

Also depending upon the various mathematical operations, you should have a look at the available methods and try to get the desired results using that methods only

Never try to iterate over the whole Mat and then perform computations, it is lot more slower than the inbuilt methods on Mat .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM