Why is imshow() not showing my image correctly?

조회 수: 17 (최근 30일)
lohit madiwal
lohit madiwal 2016년 2월 4일
댓글: DGM 2025년 10월 8일
Good day everyone. This is the image i have.
The name of the image is white_circles. It is a .png format image.
This is my code.
im = imread('white_circles.png');
imshow(im);
This is the output.
What is happening here? When i try the same with .jpg everything works fine. Is this issue related to the format of the image or is it due to something else?
Please help me out. Thank you.
  댓글 수: 2
KSSV
KSSV 2016년 2월 4일
Try converting png into tiff/ bitmap and use the same lines of code.
lohit madiwal
lohit madiwal 2016년 2월 4일
I converted the image to bitmap. This is the image.
I recieved the output as following:
The output is as expected.

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

채택된 답변

KSSV
KSSV 2016년 2월 4일
You have to use the following
[im,map] = imread('white_circles.png');
imshow(im,map);
  댓글 수: 2
lohit madiwal
lohit madiwal 2016년 2월 4일
편집: lohit madiwal 2016년 2월 4일
Could you please explain as to why the above process should be done sir? It works.

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

추가 답변 (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