How to convert gray scale mat file to Jpg

12 ビュー (過去 30 日間)
Mahmoud Hassan
Mahmoud Hassan 2018 年 8 月 28 日
コメント済み: Rik 2020 年 12 月 10 日
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 件のコメント
Mahmoud Hassan
Mahmoud Hassan 2018 年 8 月 28 日
what files i don't understand you
madhan ravi
madhan ravi 2018 年 8 月 28 日
.mat file?

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

採用された回答

Image Analyst
Image Analyst 2018 年 8 月 28 日
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 件のコメント
Jiho Ryoo
Jiho Ryoo 2020 年 12 月 10 日
Why should I never use the image for image analysis?
Rik
Rik 2020 年 12 月 10 日
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.

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

その他の回答 (0 件)

カテゴリ

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