Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can OpenCV correctly read a 16-bit signed TIFF 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?