Can anybody explain to me why the hue value of an HSV image in OpenCV only goes to 180° and not the full 360°?
I have found somewhere that OpenCV uses a 180° cylinder, but I can not really visualize such a cylinder.
Thanks in advance!
J
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.
1. 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.
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).
try to put 360 into a uchar ;)
so, it's just divided by 2 to make it fit..
The ranges that OpenCV manage for HSV format are the following:
For HSV, Hue range is [0,179], Saturation range is [0,255] and Value range is [0,255]. Different softwares use different scales. So if you are comparing OpenCV values with them, you need to normalize these ranges.
Here is the link to the OpenCV documentation that explains it.
http://docs.opencv.org/3.2.0/df/d9d/tutorial_py_colorspaces.html
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