Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is the OpenCV 3d Histogram 3 axis histogram?

What exactly is the 3d histogram returned from OpenCV's calcHist()?

For a 1d histogram I know that:
- the x axis represents my desired bins (for simplicity lets say 0-255 - grayscale colour values).
- the y axis represents the number of pixels that have that bin/colour value.

For a 3d histogram...am I correct that:
- There are 3 x axis arrays? One for each colour channel (in my case b,g,r)?
- There are 3 y axis arrays? One for each of the above?

OR

  • There are still only 1 x and y axis. But the x axis represents a concatenation(?) of b*g*r and the y axis tells me how many pixels have the colour b*g*r?

If its the first scenario, does OpenCV have a way to:
- Produce a unique number to represent a colour (hexadecimal? or combine b*g*r)?
- Produce a histogram of a 3 channel image where the x axis bins represent the unique colour number above and y axis tells me how many pixels have that colour?
- Presumably this is alot more computationally efficient than having a 3d histogram with 255 bins?