I know that question is really simple, but I didn't find how to bypass the issue:
I'm processing images, the output pixels are float32, and values are in range [-1; 1]
. The thing is, when saving using openCV, all negative data and float values are lost (I only get images with 0 or 1 values)
So I need to convert those images to [0; 255]
(Int8)
I've tried
img * 255
, but doing this does not help with negative values.(img + 1) * 255
, I'm removing the negative values, but I'm creating an overflow
Is there a (clean) way to do it ?
I'm using Python35, OpenCV2 and Numpy, but I think it's more a math problem than a library thing