I am using OpenCV in C++. I have a matrix that stores the ROI from a certain image. Now I want to calculate the mean R,G and B values of all the pixels (ROI Matrix values basically). The longer way is to use two for loops and access each pixel and then each stream. But there is a function in Open CV I am using OpenCV in C++. I have a matrix that