Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image of HSV color wheel for openCV?

Tags:

c++

opencv

hsv

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 )

image

like image 405
skm Avatar asked Feb 12 '14 19:02

skm


People also ask

What is HSV image in OpenCV?

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.

What is HSV values in OpenCV?

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).

What is an HSV image?

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.

How do I convert an image to HSV in OpenCV?

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.


1 Answers

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 )

like image 51
berak Avatar answered Oct 18 '22 23:10

berak