Please help me implementing code of histogram equalization.
1 view (last 30 days)
Show older comments
Hi there, am trying to implement histogram equalization, I have implemented the following code,
function [ output_image ] = mod_hist( input_image ) close all clc %UNTITLED Summary of this function goes here % Detailed explanation goes here output_image = zeros(size(input_image)); for j = 1:size(input_image,3) hist_image = imhist(input_image(:,:,j)); figure, plot(hist_image) normalized_sum = zeros(size(hist_image)); for i = 0:255 normalized_sum(i+1,1) = round(sum(hist_image(1:i+1,1)).*(255/sum(hist_image))) [row,col] = find(input_image(:,:,j) == i); output_image(row,col,j) = normalized_sum(i+1,1); end end figure, imshow(input_image) figure, plot(input_image); title('histogram of input image') figure, plot(normalized_sum); title('histogram of normalized image') figure, plot(imhist(output_image)); title('histogram of output image') figure,imshow(output_image) end
But its not working, can anyone please tell me whats the problem with it
Regards, Sajid Khan
0 Comments
Answers (0)
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!