GECKO 1.0
Human-computer interface based on hand gesture recognition
void HandDetector::customValues ( cv::VideoCapture  cap)

Obtains the custom HSV skin range.

Shows and image with information, then shows the calibration image and from the information obtained calculates the HSV skin color range. Finally, it calls the calibrationLoop function

{

    int delay=24;

    cv::Mat custom=cv::imread("../img/custom.png");

    while (1)
    {
        cv::imshow("CUSTOM VALUES", custom);
        char key =  cv::waitKey(delay);
        if ( key == 10 || key == 13 )
        {
            cv::destroyWindow("CUSTOM VALUES");
            break;
        }
        else if (key==27 || key=='q')
            exit(0);
    }

    bool stop = false;


    while( !stop)
    {
        //-- Get current frame
        cv::Mat frame, cal_screen;
        if (! cap.read( frame ) )
            break;
        cv::flip(frame,frame,1);


        //-- Add calibration frame
        drawCalibrationMarks(frame, cal_screen, halfSide);

        //-- Show calibration screen
        cv::imshow( "CUSTOM VALUES", cal_screen);

        //-- Wait for user confirmation
        char key =  cv::waitKey(delay);
        if ( key == 10 || key == 13 )
        {
            //-- Get region of interest data:
            int image_rows = frame.rows;
            int image_cols = frame.cols;

            cv::Mat ROI = frame( cv::Rect( cv::Point( image_cols / 2 - halfSide,  image_rows/2 - halfSide ),
                           cv::Point( image_cols / 2 + halfSide,  image_rows/2 + halfSide)));
            //cv::imshow( "Test", ROI);

            HandDetector::calibrate( ROI );
            HandDetector::getCalibration( lower, upper);

            //drawHistogramHSV( ROI );

            //-- Close window
            cvDestroyWindow( "CUSTOM VALUES");
            break;
        }
    }
    HandDetector::calibrationLoop(cap);

}

Here is the call graph for this function:

 All Classes Functions Variables