How does imread scale 12bit images?
问题 I have a 12-bit pgm-image, which I read with imread. The result is a 16-bit image having values in the full range 0 to 2^16 - 1. How does Matlab scale? Will X = imread('filename'); X = uint16(double(X)*((2^12-1)/(2^16-1))); recover the original intensities? 回答1: MATLAB does load PGM 12-bit images correctly. However, after MATLAB loads the images, the image values are rescaled from 12-bit to 16-bit. MATLAB uses the following algorithm to scale the values from 12-bit to 16-bit: % W contains the