write an image file
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Elysi Cochin
am 1 Apr. 2020
Beantwortet: Image Analyst
am 1 Apr. 2020
i have a image im of uint16 datatype
figure(1), imshow(im)
figure(2), imshow(uint8(im))
figure(3), imshow(im,[])
all the above lines displays the image in different format
How to write the image in as obtained in 3rd figure format
2 Kommentare
Constantino Carlos Reyes-Aldasoro
am 1 Apr. 2020
Read here
for imwrite
and here for print
Akzeptierte Antwort
Image Analyst
am 1 Apr. 2020
You need to scale it to 0-255 first (which is what [] does), and then cast to uint8:
image8 = uint8(rescale(im, 0, 255));
imwrite(filename, image8);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!