problem with .png images into a list

1 回表示 (過去 30 日間)
alex
alex 2014 年 2 月 28 日
コメント済み: Image Analyst 2014 年 2 月 28 日
Hello!
i have some .png images in the file, and i use these commads
list = dir('*.png');
C={list.name};
B=sort_nat(C); %make a sorted list
for i = 1:9
img{i} = imread(B{i});
end
imshow(img{1});
the problem is that it shows SOME of the images total black,but of course they are not black. the rest images are ok.
Also,if the images are .bmp then there is no problem.
Any idea why this happens?

回答 (1 件)

Image Analyst
Image Analyst 2014 年 2 月 28 日
I'm not sure it's being in the list that's the problem. Can you just call imread() and imshow() and see them? If not, then the list is not the problem. Attach your "bad" images with the paper clip icon.
  3 件のコメント
alex
alex 2014 年 2 月 28 日
Is it possible for this to be a bug of matlab? Because i did it again and i did see the image properly. I did it one more time but i saw the black image this time. I didn't change anything to the code.
Image Analyst
Image Analyst 2014 年 2 月 28 日
I doubt it. Does the PNG image have any transparent pixels in it?

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

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by