Why isn't one image white and the other black according to my code
1 次查看(过去 30 天)
显示 更早的评论
a=ones(78);
>> b=255*ones(78);
>> figure,imshow(a);
>> figure,imshow(b);
>>
If I run the above code then one image should be bright while the other dark(I am using uint8 thus range is 0-255) but the fact is both turn out to be white. May I know why ?
0 个评论
回答(1 个)
Ben11
2014-7-28
You don't cast anything as being uint8. Try:
figure, imshow(uint8(a));
then it will be black
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!