How to compute the RGB Pixel frequency that represents the colour in whole channels.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello Matlab experts,
To compute pixels frequency on RGB image, we usually use histogram on each individual channel. Here my question is how to compute the pixel colour occurrence that represent the color itself. For example, how to compute how many occurrence for the Red pixel (255,15,20).
I know how to do it by counting using 3 for loops, but my idea is very complicated and would like to know if there is more efficient way.
댓글 수: 0
채택된 답변
Image Analyst
2013년 11월 8일
You need to do the full 3D histogram as you were thinking. Because a red that is (255,15,20) is a different color than the red that is (255,15,21). It's not complicated at all. In the spectrum from simple to complicated for MATLAB coding, this would be way, way, way towards the simple end. Doesn't even come close to "very complicated" or even a little bit complicated. I attach my color gamut visualizer below in case you want to see how I did it. Of course you can use fewer bins if you want a histogram that's smaller than 16.7 million colors. For example, you can quantize to 32x32x32 if you want.
댓글 수: 2
추가 답변 (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!