It's not the best way of iterating through the pixels; however, it's better than cv::Mat::at<T>.
Let's assume you have a color image in your folder and you want to iterate each pixels of this image and erase green and red channels(Note that this is an example, you can do this in more optimize...