Please help me implementing code of histogram equalization.

1 回表示 (過去 30 日間)
Sajid Khan
Sajid Khan 2012 年 10 月 31 日
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 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by