After many experiments, I found that reading color jpg file in C++ (OpenCV):
auto temp(cv::imread(\"xxx.jpg\");
is different from reading the s
As others pointed out, if you want to read the image in OpenCV unmodified, set the flags to -1 in the C++ function, as in:
cv::Mat img = cv::imread("xxx.jpg", -1);
or use the defined enum value:
cv::Mat img = cv::imread("xxx.jpg", cv::IMREAD_UNCHANGED);
Also note that JPEG images are not guaranteed to be decoded bit-exactly the same by different decoders! It is preferable to use a lossless format like PNG instead (see #4148, #4046, ...).
Maybe you can use getImage()
instead of getMat()
?
A similar question is being addressed here (using openCV in C# not C++)
http://www.emgu.com/forum/viewtopic.php?t=188