Why does the "graythresh" function return 0 on input images of type "double"?
Show older comments
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"?
Accepted Answer
More Answers (0)
Categories
Find more on Image Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!