how to determine multilevel thresholds for segmentation using real coded genetic agorithm
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Statistics and Machine Learning Toolbox 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!