Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to implement plateau limit histogram equalization?

Hi everyone, I'm trying to implement this paper using MATLAB: https://ieeexplore.ieee.org/document/8284291

My results are not bad. But when i created a matrice to see difference between my result and original result, i noticed some differences.

results

I composed below matrice with:

image_of_dif= zeros(width,height);
for i=1:width
    for j=1:height
        d = input_image(i,j);
        e = original_result(i,j);
        difference = difference + uint64(abs(d-e));
        %i cast it to uint64, because type of difference is also uint64    
        image_of_dif(i,j)= (abs(d-e));           
    end
end

result2

Here is my try step by step:

formula 1

modified_histogram = zeros(1,256); %apply formula
for i=1:256
   modified_histogram(i) = (((log( histogram_of_image(i)+alfa))^beta));
end

formula 2

for i=1:256
if(modified_histogram(i)~=0)
    sum = sum + modified_histogram(i);
    cnt=cnt+1;
    end
end

tcl = sum/cnt;    

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

formula3

cdf_clipped = zeros(1,256);
cdf_clipped(1) = clipped_histogram(1);
for i=2:256
     cdf_clipped(i) =  clipped_histogram(i) +  cdf_clipped(i-1);
end

formula 4

value_after_enhancement =  zeros(1,256);
for i=1:256
     value_after_enhancement(i) = floor((255*cdf_clipped(i))/cdf_clipped(255));
end
for i=1:width %insert new values
    for j=1:height
            new_pixel_value = input_image(i,j);
            input_image(i,j) =   value_after_enhancement(new_pixel_value);
    end
end

How to implement plateau limit histogram equalization?

Hi everyone, I'm trying to implement this paper using MATLAB: https://ieeexplore.ieee.org/document/8284291

My results are not bad. But when i created a matrice to see difference between my result and original result, i noticed some differences.

results

I composed below matrice with:

image_of_dif= zeros(width,height);
for i=1:width
    for j=1:height
        d = input_image(i,j);
        e = original_result(i,j);
        difference = difference + uint64(abs(d-e));
        %i cast it to uint64, because type of difference is also uint64    
        image_of_dif(i,j)= (abs(d-e));           
    end
end

result2

Here is my try step by step:

formula 1

modified_histogram = zeros(1,256); %apply formula
for i=1:256
   modified_histogram(i) = (((log( histogram_of_image(i)+alfa))^beta));
end

formula 2

for i=1:256
if(modified_histogram(i)~=0)
    sum = sum + modified_histogram(i);
    cnt=cnt+1;
    end
end

tcl = sum/cnt;    

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

formula3

cdf_clipped = zeros(1,256);
cdf_clipped(1) = clipped_histogram(1);
for i=2:256
     cdf_clipped(i) =  clipped_histogram(i) +  cdf_clipped(i-1);
end

formula 4

value_after_enhancement =  zeros(1,256);
for i=1:256
     value_after_enhancement(i) = floor((255*cdf_clipped(i))/cdf_clipped(255));
end
for i=1:width %insert new values
    for j=1:height
            new_pixel_value = input_image(i,j);
            input_image(i,j) =   value_after_enhancement(new_pixel_value);
    end
end

How to implement plateau limit histogram equalization?

Hi everyone, I'm trying to implement this paper using MATLAB: https://ieeexplore.ieee.org/document/8284291

My results are not bad. But when i created a matrice to see difference between my result and original result, i noticed some differences.differences. I couldn't understand where the problem is.

results

I composed below matrice with:

image_of_dif= zeros(width,height);
for i=1:width
    for j=1:height
        d = input_image(i,j);
        e = original_result(i,j);
        difference = difference + uint64(abs(d-e));
        %i cast it to uint64, because type of difference is also uint64    
        image_of_dif(i,j)= (abs(d-e));           
    end
end

result2

Here is my try step by step:

formula 1

modified_histogram = zeros(1,256); %apply formula
for i=1:256
   modified_histogram(i) = (((log( histogram_of_image(i)+alfa))^beta));
end

formula 2

for i=1:256
if(modified_histogram(i)~=0)
    sum = sum + modified_histogram(i);
    cnt=cnt+1;
    end
end

tcl = sum/cnt;    

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

formula3

cdf_clipped = zeros(1,256);
cdf_clipped(1) = clipped_histogram(1);
for i=2:256
     cdf_clipped(i) =  clipped_histogram(i) +  cdf_clipped(i-1);
end

formula 4

value_after_enhancement =  zeros(1,256);
for i=1:256
     value_after_enhancement(i) = floor((255*cdf_clipped(i))/cdf_clipped(255));
end
for i=1:width %insert new values
    for j=1:height
            new_pixel_value = input_image(i,j);
            input_image(i,j) =   value_after_enhancement(new_pixel_value);
    end
end