Why isn't one image white and the other black according to my code
Afficher commentaires plus anciens
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 ?
Réponses (1)
Ben11
le 28 Juil 2014
0 votes
You don't cast anything as being uint8. Try:
figure, imshow(uint8(a));
then it will be black
Catégories
En savoir plus sur Image Preview and Device Configuration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!