필터 지우기
필터 지우기

RGB32 To Grayscale 12 bit conversion

조회 수: 2 (최근 30일)
manoj sambasivam
manoj sambasivam 2012년 4월 23일
Can anyone help to convert a 32 bit RGB format to 12 bit Grayscale format . It is possible in Matlab ??

채택된 답변

Image Analyst
Image Analyst 2012년 4월 23일
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.
  댓글 수: 1
manoj sambasivam
manoj sambasivam 2012년 4월 24일
Its is coming in 16bit as u said, but how to get it in 12-bit .If i multiply with 4095 instead of 65535 also it doesnot show any image .

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 10일
RGB32 cannot be used to create 12 bit grayscale images. RGB32 uses 10 bits for one of the channels, and either 10 bits or 11 bits for the other channels, for a total of either 30 or 32 bits. All three channels need to be 12 bit in order to produce a 12 bit grayscale image.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by