imshow() not working

조회 수: 131 (최근 30일)
Marc-Andre Hoyle
Marc-Andre Hoyle 2018년 7월 11일
댓글: DGM 2022년 10월 13일
Hi,
I'm trying to load and display an image using imshow().
im = im2double(imread('/MATLAB Drive/My Project/images/selfie.jpg'));
figure(), imshow(im);
The figure window comes up, but nothing is there. If I try to save the image using print I get a white image. I can look at the im variable, and it seems to have loaded properly. Help!

채택된 답변

Anton Semechko
Anton Semechko 2018년 7월 11일
Use syntax:
imshow(im,[])
when im has non-integer format. Or just do this:
im = imread('/MATLAB Drive/My Project/images/selfie.jpg');
figure
imshow(im)
  댓글 수: 5
Image Analyst
Image Analyst 2022년 10월 13일
@Isabela Rodrigues what error message do you get? This works:
%Image
HeadCT = imread('circuit.tif');
imshow('circuit.tif'); % Or imshow(HeadCT);
which is essentially what you did.
If you have any more questions, then attach your image with the paperclip icon after you read this:
DGM
DGM 2022년 10월 13일
Any JPG file that can be read by imread() should be able to be displayed directly with imshow() or recast using im2double(). Either the image file isn't being read as expected, or there's something wrong with imshow() that I can't guess at.
You'll have to provide more information about the specifics. Do all images behave this way? Is it only certain images? If it's a certain image, attach it.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by