필터 지우기
필터 지우기

how to display the info of the image in the GUI axes?

조회 수: 1 (최근 30일)
Manoj Kumar
Manoj Kumar 2014년 5월 28일
댓글: Manoj Kumar 2014년 6월 5일
Hi, I used the following code: I have two axes. In one axes i'll display the image and in the other axes i want the details of the image. Can you please help me in getting the image details in the axes or please tell me an alternate way to do that.
\\\\\
axes(handles.axes1);
[baseFileName,folder]=uigetfile('*'); % read the input image
im=imread([folder,baseFileName]);
ImageOriginal = im;
imshow(ImageOriginal);
axes(handles.axes2);
info=imfinfo(baseFileName);
info
////////////
By using this, i am getting the image details in the matlab main window but not in the GUI axes. please assist me.
thanks...

채택된 답변

Image Analyst
Image Analyst 2014년 5월 28일
What details do you want to know? Maybe you want to use imfinfo() or impixelinfo().
  댓글 수: 11
Image Analyst
Image Analyst 2014년 6월 5일
% See if we can pull out the BitsPerSample.
hasField = isfield(info, 'BitsPerSample');
if hasField % We can print it.
details= sprintf(' Width= %d \n Height=%d \n ColorType=%s \n BitsPerSample= %d %d %d \n', info.Width, info.Height,info.ColorType, info.BitsPerSample);\
else % we can't print it.
details= sprintf(' Width= %d \n Height=%d \n ColorType=%s \n BitsPerSample= %d %d\n', info.Width, info.Height,info.ColorType);
end
Manoj Kumar
Manoj Kumar 2014년 6월 5일
it worked, thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by