This is my way to read 12bit raw image file.
data = fread(p,[768,1024],'ubit12=>uint32',4,'l');
But it takes very long time, is there any other way to speed up the processing time?
Thanks!

댓글 수: 2

Walter Roberson
Walter Roberson 2012년 2월 6일
Is the data really packed in groups of 12 consecutive bits? It is not impossible, but it would be somewhat unusual.
Sounder
Sounder 2012년 2월 7일
one 12 bits pixel is stored in 2 bytes. It's combined with 4bits of random number and 12 bits of data. So this is the only ezsy way I know to implement, but it takes long time to read.

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

 채택된 답변

Jan
Jan 2012년 2월 7일

1 개 추천

You can read all 16 bits and set the upper 4 bits to zero:
data = fread(p, [768,1024], 'uint16');
b = uint32(rem(data, 4096));
I assume you can use the format 'uint16=>uint32' directly - please test if this is faster and if rem works on UINT32 arrays.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2012년 2월 6일

편집:

2013년 10월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by