I want to convert a float32 image into uint8 image in Python using the openCV library. I used the following code, but I do not know whether it is correct or not.
Here I is the float32 image.
J = I*255
J = J.astype(np.uint8)
I really appreciate if can you help me.