Manipulating RGB color by copying channel value 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&lt;Vec3b&gt;(i, j)[0] = image.at&lt;Vec3b&gt;(i, j)[0]; // B--&gt;B
ori.at&lt;Vec3b&gt;(i, j)[1] = image.at&lt;Vec3b&gt;(i, j)[2]; // G--&gt;R
ori.at&lt;Vec3b&gt;(i, j)[2] = image.at&lt;Vec3b&gt;(i, j)[2]; // R--&gt;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 --&gt; 200 195 185       R --&gt; 237 226 220
G --&gt;   2   1   1       G --&gt; 197 179 168
B --&gt;   1   1   0       B --&gt;   4  29  23

Copying the value R --&gt; G :
Red wall :              Yellow wall :
R --&gt; 200 195 185       R --&gt; 237 226 220
G --&gt; 200 195 185       G --&gt; 237 226 220
B --&gt;   1   1   0       B --&gt;   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 ?
I missed the conversion part.
I converted the result image from BGR into RGB using this command : 

cvtColor(image, image, COLOR_BGR2RGB);


Then I exported the result image into image file. 

imwrite("image.png", image); 


Turned out the export command will automatically convert the BGR color-space into the RGB color-space. This is why the color result is off because I did 2x conversion.
So, I don't need the conversion command.