Using the cvSet method we can easily fill an image with solid colours. Is there any method which can help you remove some colours from ur image (e.g I have an Image of a forest. Basically it will have a lot of green component, leaves etc. Can I remove the green color keeping everything else same.)
char* inputPath = "TEST.png";
Mat src = imread(inputPath);
Mat BGRChannels[3];
split(src,BGRChannels); // split the BGR channesl
BGRChannels[1]=Mat::zeros(src.rows,src.cols,CV_8UC1);// removing Green channel
merge(BGRChannels,3,src); // pack the image
namedWindow("B0R",1);
imshow("B0R",src);
waitKey(0);
Here is the result:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With