Using convertTo corrupts the image
I have an image that is 3 channels, 16 bit depth. I am trying to convert it to 8 bits using this:
img.convertTo(img, CV_8U, 0.00390625);
(source: https://stackoverflow.com/questions/6...)
While this does work and converts it to 8 bits, it corrupts my image in the process. My previous image looks like this:
After using convertTo
my image now looks like this:
Any suggestions why this is?
curious: how did you get the 1st image ? (which is 24 == 3 x 8 bits)
while your scale factor is correct in theory, you pixel ranges might still be in [0..255]
I got the first image by stitching three separate images together. Can you explain what you mean by scale factor vs pixel ranges? Still not sure how to fix this.