Read 10 bit raw image data in matlab using uint16, why it is read as 12 bit ???
조회 수: 14 (최근 30일)
이전 댓글 표시
I read a 10bits multispectral raw image data using uint16 as follows
fid=fopen(file_name,'r');
a=fread(fid,width*height*band,'uint16');
fclose(fid);
but I got the maximum value of this data is 4095, it means that my data is read as 12-bit data. Is there anyone know why?
I also tried to read the same data in uint32 and the result becomes 28-bit data.
why there is a 4-bit difference here?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 6월 7일
When a manufacturer makes two devices with different precision, the manufacturer often "left justifies" the lower-precision values to the width of the higher precision, so that the value range is still the same between the two devices, but the higher precision device returns values that are more precise.
For the same reason, it is not uncommon for manufacturers to output 12 bit values as the left-most 12 bits (12 most significant) in a 16 bit field -- leaving room for a future more precise device with the same value range but higher accuracy. This relieves the need to rewrite processing software.
You should look at min(diff(unique(a))) . If it is 4 then you have 10 bits worth of data; if it is 1 then you have 12 actual bits worth of data.
Another thing that happens is that 10 bit data that has been recorded raw with a bayer mosaic might be left shifted and interpolated to 12 bits of RGB
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!