MATLAB: RGB32 To Grayscale 12 bit conversion

imageimage acquisitionImage Acquisition Toolboximage analysisimagesc

Can anyone help to convert a 32 bit RGB format to 12 bit Grayscale format . It is possible in Matlab ??

Best Answer

Here's one way:
rgbImage8Bit = imread(fullFileName);
grayImage = rgb2gray(im2double(rgbImage8Bit));
% It's still in the original range.
% Scale it to be in the larger 16 bit image range.
grayImage = uint16(grayImage * 65535);
fprintf('The class of grayImage is %s.\n', class(grayImage));
but that's not the same as having a 16 bit grayscale camera like you were asking about in your other post.
Related Question