Question about color histogram

9 ビュー (過去 30 日間)
Piyush Kothyari
Piyush Kothyari 2016 年 1 月 29 日
コメント済み: Piyush Kothyari 2016 年 2 月 5 日
Dear Sir/Ma'am
I implement the Color Histogram code for an image here is code what i want to implement
t1=imread('111.jpg');
t1r=t1(:,:,1);
t1g=t1(:,:,2);
t1b=t1(:,:,3);
figure;
subplot(221);imhist(t1r);title('Red Plane');
subplot(222);imhist(t1g);title('Green Plane');
subplot(223);imhist(t1b);title('Blue Plane');
subplot(224);imshow(t1);title('original image');
now i want to compute the probability histogram as follows
p(ri)=(Number of pixels in ri)/(width*height)
where p(ri) represents the relative frequency

採用された回答

Walter Roberson
Walter Roberson 2016 年 1 月 29 日
subplot(221); ri = imhist(t1r); title('Red Plane');
p = ri ./ numel(t1r);
  1 件のコメント
Piyush Kothyari
Piyush Kothyari 2016 年 2 月 5 日
thank you sir

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

その他の回答 (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