Iterative threshold selection on an input gray-level image
显示 更早的评论
Perform iterative threshold selection on an input gray-level image to include a variable that counts the number of iterations and an array that stores the values of T for each iteration.Please, this is what i have tried but i know i am wrong, somebody help me out.
I = imread('coins.png');
Id = im2double(I);
Imax = max(Id(:));
Imin = min(Id(:));
T = 0.5*(min(Id(:)) + max(Id(:)));
deltaT = 0.01;
done = false;
while ~done
g = Id >= T;
Tnext = 0.5*(mean(Id(g)) + mean(Id(~g)));
done = abs(T - Tnext) < deltaT;
T = Tnext;
end
imshow(g);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Images 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!