Manipulating RGB color by copying channel value
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.