My white and black strips becomes a a black surface using imread and imshow

2 ビュー (過去 30 日間)
Fan Yang
Fan Yang 2021 年 9 月 16 日
編集済み: Image Analyst 2021 年 9 月 16 日
I have a .PNG picture containing black and white strips shown below.
I was trying show this image in MATLAB using imread and imshow:
strips = imread('strip.png')
imshow(strips)
after running these two lines of code, the image becomes a black surface, shown below:
I thought maybe all the black strips were squished together and zooming could solve the problem, but it did not.
How can I show the original image?
  2 件のコメント
Geoff Hayes
Geoff Hayes 2021 年 9 月 16 日
Fan - what happens if you use image instead? i.e.
image(strips)
If that doesn't work, what are the dimensions of strips?
Dave B
Dave B 2021 年 9 月 16 日
It seems to work with the image you included in your question, maybe attach the original?
im=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/740714/image.png');
imshow(im)

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

採用された回答

Image Analyst
Image Analyst 2021 年 9 月 16 日
Try imshow with []:
imshow(strips, [])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by