In OpenCV HSV images, the scale of Hue depends on the type of image. From this answer,
For HSV images it depends on the image type (see OpenCV doc):
8 bit images: H in [0, 180], S,V in [0, 255]
32bit images: H in [0, 360] ,S,V in [0,1]
I have two questions:
How do I know which type of image or frame (whether 8-bit or 32-bit) is the camera detecting, e.g. how would I know in this class in the Color Blob Detection sample application?
Is there a way to force the camera to take 32 bit image (because I really want the second scale, and if there is no way, I will have to find a way to convert the first scale to the second one, because Android's Color.HSVToColor
method follows the second scale)?
1) It uses CvType.CV_8U
so that means 8 bit unsigned.
2) Probably not, you have to dive in the part of code that actually controls the camera and grabs a frame to find this out. However, you can simply convert a 8 bit image to 32 bit by using convertTo
functions.