Why do Matlab's imread and OpenCV's imread return different pixel values when reading the same image?

129 Views Asked by At

The image in question is a uint16 pgm image with a bit depth of 10 but saved as 16-bit. When reading the image using Matlab's imread, the pixel values are 2^6 times larger than those obtained using OpenCV's imread with the parameter cv2.IMREAD_UNCHANGED. Both functions return a uint16 data type.

I_tmp = imread(imageFileName)

matlab pixel

image = cv2.imread(file, cv2.IMREAD_UNCHANGED)

opencv pixel I want to know why this situation occurs and how I can read the same pixel values in Python as in Matlab.

0

There are 0 best solutions below