How to convert gray scale mat file to Jpg

10 vues (au cours des 30 derniers jours)
Mahmoud Hassan
Mahmoud Hassan le 28 Août 2018
Commenté : Rik le 10 Déc 2020
I want to convert a gray scale mat file let’s say the name is new.mat to jpg file and i don't know how to do it
  3 commentaires
Mahmoud Hassan
Mahmoud Hassan le 28 Août 2018
what files i don't understand you
madhan ravi
madhan ravi le 28 Août 2018
.mat file?

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 28 Août 2018
Try this:
% Load the image variable from the MAT file into a structure s.
s = load(yourFileName);
% Extract the image from the structure
rgbImage = s.ImageName; % Or whatever the image variable is named.
% Write to disk in a jpg format, which you should never use for image analysis.
imwrite(rgbImage, 'my image.jpg');
  2 commentaires
Jiho Ryoo
Jiho Ryoo le 10 Déc 2020
Why should I never use the image for image analysis?
Rik
Rik le 10 Déc 2020
Because jpeg is a lossy file format (technically it is possible to have lossless settings for jpeg, but nobody uses it). That means you will lose data when storing as jpeg, meaning your analyses will be less reliable.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by