how to determine multilevel thresholds for segmentation using real coded genetic agorithm
1 次查看(过去 30 天)
显示 更早的评论
function fitR = Kapur(m,level,xR,PI) %Metodo de Entropia de Kapur fitR = zeros(1,m); for j = 1: m PI0 = PI(1:xR(j,1)); % probabilidad de la primer clase ind = PI0 == 0; ind = ind .* eps; PI0 = PI0 + ind; clear ind w0 = sum(PI0); %w0 de la primer clase H0 = -sum((PI0/w0).*(log2(PI0/w0))); fitR(j) = fitR(j) + H0;
for jl = 2: level
PI0 = PI(xR(j,jl-1)+1:xR(j,jl)); % probabilidad de la primer clase
ind = PI0 == 0;
ind = ind .* eps;
PI0 = PI0 + ind;
clear ind
w0 = sum(PI0); %w0 de la primer clase
H0 = -sum((PI0/w0).*(log2(PI0/w0)));
fitR(j) = fitR(j) + H0;
end
end
In this code how to determine the level, xR, PI, and m
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!