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 个评论
更多回答(1 个)
Azzi Abdelmalek
2016-7-22
编辑:Azzi Abdelmalek
2016-7-22
A=randi(10,5,4,3)
B=squeeze(sum(sum(A,1)))
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!