Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -----------------------------------------------------
- // ---------- FIND AVG LUMINENCE OF FRAME --------------
- // -----------------------------------------------------
- cv::Mat grayMat;
- cv::cvtColor(_classImage, grayMat, CV_BGR2GRAY);
- int Totalintensity = 0;
- for (int i=0; i < grayMat.rows; ++i){
- for (int j=0; j < grayMat.cols; ++j){
- Totalintensity += (int)grayMat.at<uchar>(i, j);
- }
- }
- // Find avg lum of frame
- float avgLum = 0;
- avgLum = Totalintensity/(grayMat.rows * grayMat.cols);
Add Comment
Please, Sign In to add comment