I need to encode an image in 16UC1 format, but I receive the error: cv_bridge.core.CvBridgeError:encoding specified as 16UC1, but image has incompatible type 32FC1
I tried to use skimage function img_as_uint
but since my image values are not between -1 and 1 it doesn't work. i also tried to "normalize" my values by dividing all of them by the value obtained from np.amax
, but using the skimage function only returns a blank image.
Is there a way of achieving this conversion?
This is the original 32FC1 image