Why does the "graythresh" function return 0 on input images of type "double"?
Afficher commentaires plus anciens
The documentation for the "graythresh" function says that it accepts images of type "uint8", and of type "double".
For "uint8", the "graythresh" function works as expected, as follows :
>> I = imread('coins.png');
>> level = graythresh(I)
level =
0.4941
>>imshow(im2bw(I, level));
However, when the input image is of type "double", the level is 0 as follows :
>> I = imread('coins.png');
>> level = graythresh(double(I))
level =
0
Why does this happen even though the "graythresh" function can accept inputs of type "double"?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Type Conversion 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!