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.
DGM
DGM 2025 年 10 月 8 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by