multilevel thresholding by kapur method
이전 댓글 표시
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일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Image Thresholding에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!