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!