Can OpenCV correctly read a 16-bit signed TIFF image?

asked 2017-05-25 12:51:18 -0500

fijoy gravatar image

I'm trying to read a 16-bit signed TIFF image in OpenCV as

img = cv2.imread('000007.tif', flags=cv2.IMREAD_UNCHANGED)

but getting uint16 as the type of img. I looked at individual pixel values, but cannot figure out how OpenCV mapped the original pixel values (some of which are negative) to uint16 values. Adding additional flags cv2.IMREAD_ANYDEPTH and cv2.IMREAD_ANYCOLOR did not help. Can OpenCV read this image at all?

edit retag flag offensive close merge delete