imwrite image is darker than ofstream version
I have the following code
and
both are getting an image from a thermal imaging camera; one is saving the image using ofstream and the other with opencv. The opencv image is a lot darker, almost black. Any idea what I'm doing wrong?
Thanks
Please post the code here, otherwise the question (and its answers) will get useless as soon as the link don't work anymore.
Your image is 16 bits (
cv::Mat img(h,w,CV_16UC1);
).Not sure that pgm image file accepts 16 bits image format. You could try to save to another format that accepts 16 bits depth or in binary format maybe ?