I have written the code for histogram and i want to use it for SVM traning. But the fundamental problem is that i don't understand how many minimum number of bins i should choose so that i can get widely varied distribution among bins for different colors (red,green,yellow,blue,orange).
So, can somebody give me the link/post the image of Hue color wheel for openCV. I need something as shown below but the hue range in it is 0-360 and i need a color wheel used by opencv (i.e. 0-180 )
The HSV or Hue, Saturation, and value of a given object is the color space associated with the object in OpenCV. The Hue in HSV represents the color, Saturation in HSV represents the greyness, and Value in HSV represents the brightness.
In OpenCV, Hue has values from 0 to 180, Saturation and Value from 0 to 255. Thus, OpenCV uses HSV ranges between (0-180, 0-255, 0-255).
HSV Color Scale: The HSV (which stands for Hue Saturation Value) scale provides a numerical readout of your image that corresponds to the color names contained therein. Hue is measured in degrees from 0 to 360. For instance, cyan falls between 181–240 degrees, and magenta falls between 301–360 degrees.
To convert our image to the HSV color space, we make a call to the cv2. cvtColor function. This function accepts two arguments: the actual image that we want the convert, followed by the output color space. Since OpenCV represents our image in BGR order rather than RGB, we specify the cv2.
in opencv, the hsv image has to fit into 3 8-bit channels, (no problem for S and V [0..255]) .
since H is in the [0..360] range, the actual values get divided by 2, so it fits into a uchar.
just divide any value in the diagram above by 2. ( or multiply the value you get from opencv )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With