필터 지우기
필터 지우기

Matlab imshow() not showing the image properly

조회 수: 7 (최근 30일)
32sthide
32sthide 2012년 12월 4일
댓글: Walter Roberson 2019년 2월 13일
I have a simple code to show an image in Matlab. I use imread() to read it and imshow() to show it. the code it below, and the result in not shown properly. hope someone can help me.
img = imread('/home/samuelpedro/Desktop/API - Projecto/coimbra_aerea.jpg');
figure, imshow(img);
the resulting image is below.
the actual image is below
also, if i choose to save it to file as a new jpg it is saved correctly.
*UPDATE 1:
weirdly if i choose to show the axes in the preferences>image processing, it is corrected*
  댓글 수: 11
Lakshay Bhandari
Lakshay Bhandari 2019년 2월 13일
what does "if i choose to show the axes in the preferences>image processing, it is corrected" mean ?
Walter Roberson
Walter Roberson 2019년 2월 13일
There was an image processing preference as to whether the axes Visible property will be set or not. See iptsetprefs()

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

답변 (3개)

Image Analyst
Image Analyst 2012년 12월 4일
It kind of looks like it's an interlaced file, like a PNG file that's interlaced, but the interlacing is not recognized. Any chance you could post the image so others could try it?
  댓글 수: 5
32sthide
32sthide 2012년 12월 4일
i've reinstalled matlab once. it's the same. as you said, when I maximaze the window or xoom in / out the image is refreshing and the pattern changes.
32sthide
32sthide 2012년 12월 5일
weirdly if i choose to show the axes in the preferences>image processing, it is corrected

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


VENKATESAN
VENKATESAN 2012년 12월 4일
Your path length looks very big. Don't use hyphen (-) symbol in your folders, instead u can use underscore. Try this.. Because there is a hyphen in your folder API-Projecto. But, it is better if you read the file from the work folder and the imshow will be perfect.
Try this
img = imread('/home/samuelpedro/Desktop/API_Projecto/coimbra_aerea.jpg'); figure, imshow(img);
or the other one
img=imread('coimbra_aerea.jpg'); figure, imshow(img); imwrite(img, 'coimbra_aerea.jpg', 'jpg');
  댓글 수: 2
32sthide
32sthide 2012년 12월 4일
i've tried even something like:
cd /home/samuelpedro/Desktop/APIProject/
close all
clear all
clc
img = imread('coimbra_aerea.jpg');
figure, imshow(img);
Sean de Wolski
Sean de Wolski 2012년 12월 4일
This won't matter. I would guess it is some graphics driver isolated specifically to your machine.

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


UJJWAL
UJJWAL 2012년 12월 4일
I would really request you to post the image file so that others could also try it.
  댓글 수: 1
32sthide
32sthide 2012년 12월 4일
it's not a problem from the image. all my imshow no matter the files is the same.

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by