I wanted to look at only the R+G channels in an RGB image because I get better contrasts to detect an object when the Blue channel is removed. I used OpenCV to split the cha
another way is subtracting Scalar(255,0,0) from source image
Scalar(255,0,0)
#include using namespace cv; int main(int argc, char **argv) { Mat src = imread(argv[1], CV_LOAD_IMAGE_COLOR); imshow("src", src ); src -= Scalar(255,0,0); imshow("Green and Red channels", src ); waitKey(); return 0; }