How to take summation of different bins of histogram
2 ビュー (過去 30 日間)
古いコメントを表示
I am new to Matlab. I have created three separate arrays rarray,garray,barray to store RGB values of an image. After this I have created histogram for these three channels. How take addition of different bins for every channel?
0 件のコメント
採用された回答
Image Analyst
2016 年 7 月 22 日
I don't know what you mean by "different" bins, but to add up corresponding bins, just add
redCounts = imhist(rgbImage(:,:,1));
greenCounts = imhist(rgbImage(:,:,2));
blueCounts = imhist(rgbImage(:,:,3));
overallCounts = redCounts + greenCounts + blueCounts ;
Of course it's even easier to do it all in one step:
overallCounts = imhist(rgbImage(:));
4 件のコメント
Image Analyst
2016 年 7 月 25 日
Neither can we, until we see your code and you upload at least two images.
その他の回答 (1 件)
Azzi Abdelmalek
2016 年 7 月 22 日
編集済み: Azzi Abdelmalek
2016 年 7 月 22 日
A=randi(10,5,4,3)
B=squeeze(sum(sum(A,1)))
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!