bgr2hsv oddity
Usinge OpenCV cvCvtColor to convert BGR images to HSV. Seems to work fine, but the channel order is not what I expect. Assumed I would see HSV ordering, but using COI or cvSplit, looking visually at the results, it seems that order is VHS. Is this a known bug? Indicative of some error on my part? Or perhaps I am just wrong?
The application is Mac OS X based, and includes a subsystem that performs real time gaze estimation. Coded in Objective C, and OpenCV 2.2 using C interfaces. Current effort is to speed up the adaptive tuning process by using Zheng, Yang and Yang's published methods for pupil detection in HSV space. Basically, mask pupils using H space based mask to reduce number of contours for later processing.
The critical piece of code is dead simple. Convert BGRA image to BGR, BGR to HSV, then split that image into channels. I've tried this using COI access instead of cvSplit with the same result, and with CV_BGR2HSV rather than CV_BGR2HSV_FULL with the same result. H channel on a previously Haar detected CvRect surrounding the eyes should show the pupils as significantly brighter than background - which the second channel does! If this is not a known bug, then I have to assume I am misinterpreting the results. I have been using IPL_DEPTH_8U as it is faster, but of course saturates H. I am going to try it with 32 bit channels to avoid H saturation and see if the visual results are different.
BTW, I am new to the OpenCV/PCL/ROS world and am simply dumbfounded by the quality of work here. Congrats to you all ...