필터 지우기
필터 지우기

How to implement this plateau limit histogram equalization algorithm

조회 수: 9 (최근 30일)
Mustafa Uysal
Mustafa Uysal 2019년 12월 25일
편집: Mustafa Uysal 2019년 12월 25일
Hi,
i would like to implement and simple alghoritm. i compare my result's histogram with original result's histogram and there is always a huge difference.
Adsız.png
i reviewed my code again and again. but i couldn't see what is the problem. can you take a look to my code, please?
step1.png
histogram_of_image = imhist(input_image);
modified_histogram = zeros(1,256);
modified_histogram(1:256) = (log(histogram_of_image(1:256)+(a))).^(beta);
step2.png
these_elements_are_not_zero = modified_histogram~= 0;
sum2 = sum(modified_histogram(these_elements_are_not_zero));
cnt2 = size(these_elements_are_not_zero,2);
tcl = sum2/cnt2;
clipped_histogram = zeros(1,256);
for i=1:256
if((modified_histogram(i)) >= tcl)
clipped_histogram(i) = tcl;
else
clipped_histogram(i) = (modified_histogram(i));
end
end
step3.png
PDa = zeros(1,256);
PDa = clipped_histogram / (sum(clipped_histogram));
CDa = zeros(1,256); %create CDa in formula
CDa(1) = PDa(1) ;
for i=2:256
CDa(i) = PDa(i) + CDa(i-1);
end
value_after_enhancement = zeros(1,256);
value_after_enhancement = (255 * CDa);
b=uint8(0);
output_image=zeros(width,height);
output_image = value_after_enhancement(input_image+1);
figure;imshow(uint8(output_image));
original_result=imread('testsonuc.bmp');
original_result=double(rgb2gray(original_result));
image_of_dif= zeros(width,height);
figure;imshow(uint8(original_result));
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 12월 25일
I didnot get the question exactly?
Mustafa Uysal
Mustafa Uysal 2019년 12월 25일
편집: Mustafa Uysal 2019년 12월 25일
i couldn't follow these steps truly. but i don't understand where is the problem with my implementation

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by