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!

 Akzeptierte Antwort

Anton Semechko
Anton Semechko am 11 Jul. 2018

3 Stimmen

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 Kommentare

Noy Uzrad
Noy Uzrad am 18 Apr. 2020
I have the same problem and yet it does not work
SAI SAMYUKTHA N
SAI SAMYUKTHA N am 7 Apr. 2022
Thanks a lot! The first one itself worked for me
Isabela Rodrigues
Isabela Rodrigues am 13 Okt. 2022
For me is the same, didn't work and my image still appear as a graphic or doesn't appear. Help
%Image
HeadCT = imread('HeadCT.jpg');
figure
imshow('HeadCT.jpg');
@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 am 13 Okt. 2022
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by