can some help me please with Otsu thresholding matlab code in which the dimensions, width, height, of the output image is equal to the orignal image (input image). Thanks in advance.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen

15 Kommentare
Antworten (1)
KALYAN ACHARJYA
am 22 Nov. 2018
Hello Arshad, otsu thresolding techniqie is very popular thresholding approach in image segmentation domain. I have posted the following code from Gonzalez book (Digital Image Processing using Matlab), requested you to refer the book for detail explanation.
function [T,SM]=otsuthresh(h);
h=h/sum(h);
h=h(:);
i=(1:numel(h))';
P1=cumsum(h);
m=cumsum(i.*h);
mG=m(end);
sigSquared=((mG*P1-m).^2)./(P1.*(1-P1)+eps);
maxSigsq=max(sigSquared);
T=mean(find(sigSquared==maxSigsq));
T=(T-1)/(numel(h)-1);
SM=maxSigsq/(sum(((i-mG).^2).*h)+eps);
end
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!.png)

