The function cv::imwrite()correctly writes the image file if the input cv::Matis in BGR order (this is so if you allow OpenCV to create it). If you created the image yourself, you need to first convert the color order, for example, by calling bamboove cv::cvtColor(in, out, CV_RGB2BGR);if you created the RGB image.
(Pay attention to the color conversion code, it is slightly different from bamboo.)
source
share