필터 지우기
필터 지우기

How to convert gray scale mat file to Jpg

조회 수: 31 (최근 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 CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by