フィルターのクリア

how to normalized a hsv histogram?

3 ビュー (過去 30 日間)
R
R 2013 年 7 月 10 日
i want to normalize hsv histogram. i have three different of each h,s,and v. i want to normalize them so that i can compare it with h,s and v plot. for this firstly i have to normalize the histogram i tried in following way but it did not work..
rgb = imread('wheatimage.jpg');hsv = rgb2hsv(rgb);
h = hsv(:, :, 1);
v = hsv(:, :, 3);
numberOfBins = 50;
s = hsv(:, :, 2); % or whatever.
[countsH valuesH] = hist(h, numberOfBins);
figure; subplot(2, 2, 1);
bar(valuesH, countsH, 'BarWidth', 1);
title('Histogram of the H Channel', 'FontSize', 15);
[countsS, valuesS] = hist(s, numberOfBins);
subplot(2, 2, 2);
bar(valuesS, countsS, 'BarWidth', 1);
title('Histogram of the S Channel', 'FontSize', 15);
[countsV, valuesV] = hist(v, numberOfBins);
bar(valuesV, countsV, 'BarWidth', 1);
title('Histogram of the V Channel', 'FontSize', 15);%# create histogram from a normal distribution.
g=1/sqrt(2*pi)*exp(-0.5*valuesH.^2);%# pdf of the normal distribution
% DIVIDE BY AREA figure(1)
bar(valuesH,countsH/trapz(valuesH,countsH));hold on
plot(valuesH,g,'r');hold off
  4 件のコメント
R
R 2013 年 7 月 11 日
is their any other way to normalize hsv histogram other than this.
Jan
Jan 2013 年 7 月 11 日
What exactly should be "normal" after the normalization? All we see is the code, which does not do what you want. But this does not allow to identify, what you want.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2013 年 7 月 11 日
What exactly should be normalized? The area under each curve or all 3 curves?
Perhaps this helps: FEX: NormalizedHistogram
  9 件のコメント
R
R 2013 年 7 月 11 日
i want to compare to image on the base of hsv and compare their histogram on bases of chi-square dist method. so for that i want to normalize my hsv histograms..
R
R 2013 年 7 月 11 日
comparsion is latter issue firstly graph need to be normalize.

サインインしてコメントする。

カテゴリ

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