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
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
According to http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor
For the 8-bit images, H is converted to H/2 to fit to the [0,255] range. So the range of hue in the HSV color space of OpenCV is [0,179]
Is it really so?I think for HSV the ranges are as H[0-179], S[0-255], V[0-255].Please see the link and help me understand if I am missing something. http://docs.opencv.org/trunk/doc/py_tutorials/py_imgproc/py_colorspaces/py_colorspaces.html
If you need to convert the range of Hue, see the link below. http://en.literateprograms.org/RGB_to_HSV_color_space_conversion_%28C%29#