Please help me implementing code of histogram equalization.
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!