I have a picture and trying to swap the RGB channel into RRB, it's like I need to change all G pixels value into R. I did that by copying the R pixel value to G and store it into a new image file (Mat). Here's my code :
ori.at<Vec3b>(i, j)[0] = image.at<Vec3b>(i, j)[0]; // B-->B
ori.at<Vec3b>(i, j)[1] = image.at<Vec3b>(i, j)[2]; // G-->R
ori.at<Vec3b>(i, j)[2] = image.at<Vec3b>(i, j)[2]; // R-->R
however the result is a little bit confusing me,
Could someone give me a brief explanation how is that the Red and Yellow pixels in the wall end up have the almost same result color (aquamarine) ? I checked the pixel value at some points and the value is almost the same.
What I expected was, if I copied R pixels --> G, part with original R values shouldn't be affected, right ? And because Yellow is a mixture of Red + Green, if I try to copy Red pixels into Green, shouldn't it be Red + Red then ?
[UPDATE]
I have checked sample color values (RGB) for Red wall and Yellow wall.
Red wall : Yellow wall :
R --> 200 195 185 R --> 237 226 220
G --> 2 1 1 G --> 197 179 168
B --> 1 1 0 B --> 4 29 23
Copying the value R --> G :
Red wall : Yellow wall :
R --> 200 195 185 R --> 237 226 220
G --> 200 195 185 G --> 237 226 220
B --> 1 1 0 B --> 4 29 23
will result in the Red wall and Yellow wall have almost the same color. But when I checked the result color, it's not aquamarine. Did I make wrong calculation ?