How change unit8 pixel value to intensity data

8 vues (au cours des 30 derniers jours)
ConanTaieb
ConanTaieb le 1 Fév 2022
Commenté : K. Taieb le 3 Fév 2022
Hi,
I have an image storted in a raw. format. The sizes are 673*1094*1215. I want to open it with Matlab and to find the intensity data (between 0 to 1). I tried with the the following code :
fid = fopen('P1.raw','r');
data = fread(fid, 673*1094*1215,'uint8=>uint8');
fclose(fid);
data = reshape(data, [673, 1094, 1215]);
Datatshow=flip(data(:,:,1057)'); %data of one slice
imshow(Datatshow);
But I did not find how I can convert the unit8 data to inentsity data.
Thanks for your help!

Réponses (2)

Simon Chan
Simon Chan le 1 Fév 2022
Try function im2double
  1 commentaire
ConanTaieb
ConanTaieb le 1 Fév 2022
Thank you Simon,
im2double convert to double data not intensity

Connectez-vous pour commenter.


Stephen23
Stephen23 le 1 Fév 2022

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by