Borrar filtros
Borrar filtros

How to compute the RGB Pixel frequency that represents the colour in whole channels.

2 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Image Analyst
Image Analyst el 8 de Nov. de 2013
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.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by