フィルターのクリア

opening a raw file

5 ビュー (過去 30 日間)
jad aoun
jad aoun 2020 年 6 月 3 日
回答済み: Monisha Nalluru 2020 年 7 月 10 日
Hi everyone ,
I am trying to open a rawfile which is supposed to be a 2048*2048 array of a 2D gray color image .
I don't know why my script ain't working .
row = 2048;
col = 2048;
fin = fopen('dark_tint36.9512_0-0-0_Normal.raw');
ima = fread(fin, [col row], '*uint16');
fclose(fin);
imshow(fin);
I have no error messages but i only see a small white rectangle in a figure which correponds to nothing . Any help ?
Thx in advance .
  2 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 6 月 3 日
are you able to share a sample file.
Stephen23
Stephen23 2020 年 6 月 3 日
jad aoun's incorrectly posted "Answer" moved here:
Sure . Here it is .
Thanks for your answer.

サインインしてコメントする。

回答 (1 件)

Monisha Nalluru
Monisha Nalluru 2020 年 7 月 10 日
As you have mentioned, the image is grey scale the max and min intensity pixel values from your image is 255 and 0 which means the data is stored in uint8 format, but you are using *uint16.
You can refer this link for precision of grey scale image
You can make use of something like below example to display the image
row=2048;
col=2048;
fin=fopen('dark_tint36.9512_0-0-0_Normal.raw','r');
I=fread(fin,[col row],'uint8');
k=imshow(I);
fclose(fin)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by