multilevel thresholding by kapur method
6 次查看(过去 30 天)
显示 更早的评论
whether the below code is correct for multilevel thresholding by kapur method close all clear all I =imread('C:\Users\swathi\Desktop\image1.gif'); level = 4; size(I,3) == 1 [n_countR, x_valueR] = imhist(I(:,:,1)); Nt = size(I,1) * size(I,2); Lmax = 256; for i = 1:Lmax size(I,3) == 1 PI(i) = n_countR(i) / Nt;
end N_PAR = level; dim = N_PAR; m = 256; n = dim; fitR = zeros(1,m); size(I,3) == 1 u = ones(1,dim) * Lmax; l = ones(1,dim); xR = zeros(m,n);
for j = 1: m PI0 = PI(1:xR(j,1)); ind = PI0 == 0; ind = ind .* eps; PI0 = PI0 + ind; clear ind w0 = sum(PI0); 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));
ind = PI0 == 0;
ind = ind .* eps;
PI0 = PI0 + ind;
clear ind
w0 = sum(PI0);
H0 = -sum((PI0/w0).*(log2(PI0/w0)));
fitR(j) = fitR(j) + H0;
end
end
1 个评论
Priyanka Roy
2015-12-1
Hii, Have you successfully done the multilevel kapur method? I need Multilevel Kapur code for comparative analysis of image with some other multilevel algorithm. Please help me by sending the Multilevel Kapur code.
Thank you.
回答(1 个)
LUQMAN HAKIM
2022-10-26
I need Multilevel thresholding Kapur and Otsu code for my final year project.
I will be glad you mail me the the source code: luqman.skpa@gmail.com
Thank You.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!