OpenCV get pixel channel value from Mat image
Assuming the type is CV_8UC3 you would do this: for(int i = 0; i < foo.rows; i++) { for(int j = 0; j < foo.cols; j++) { Vec3b bgrPixel = foo.at<Vec3b>(i, j); // do something with BGR values… } } Here is the documentation for Vec3b. Also, don’t forget OpenCV stores things internally as BGR … Read more