GECKO 1.0
Human-computer interface based on hand gesture recognition
void HandDescriptor::angleControl ( bool  show_corrected = true,
bool  show_actual = true,
bool  show_predicted = true 
)

Prints the angle gauge on a separate window.

{
    //-- Prints the angle gauge

    //-- Matrix that shows the gauge
    cv::Mat gauge = cv::Mat::zeros( 100, 200, CV_8UC3);

    //-- Define gauge:
    int gauge_l = 60;
    cv::Point gaugeOrigin( 200/2, 80 );

    //-- Calculate and print actual end:
    if ( show_actual )
    {
        double rad_ang = _hand_angle * 3.1415 / 180.0;
        int x_coord = gauge_l * cos( rad_ang);
        int y_coord = gauge_l * sin( rad_ang);
        cv::Point gaugeEnd( 200/2 + x_coord , 80 - y_coord);
        cv::line( gauge, gaugeOrigin, gaugeEnd, cv::Scalar( 255, 0, 0), 1); //-- Actual angle
    }

    //-- Calculate and print predicted end:
    if ( show_predicted)
    {
        double rad_ang_predicted = _hand_angle_prediction * 3.1415 / 180.0;
        int x_coord_predicted = gauge_l * cos( rad_ang_predicted);
        int y_coord_predicted = gauge_l * sin( rad_ang_predicted);
        cv::Point predictedGaugeEnd( 200/2 + x_coord_predicted , 80 - y_coord_predicted);
        cv::line( gauge, gaugeOrigin, predictedGaugeEnd, cv::Scalar( 0, 255, 0), 2); //-- Predicted angle
    }

    //-- Calculate and print estimated end:
    if ( show_corrected )
    {
        double rad_ang_estimated = _hand_angle_estimation * 3.1415 / 180.0;
        int x_coord_estimated = gauge_l * cos( rad_ang_estimated);
        int y_coord_estimated = gauge_l * sin( rad_ang_estimated);
        cv::Point estimatedGaugeEnd( 200/2 + x_coord_estimated , 80 - y_coord_estimated);
        cv::line( gauge, gaugeOrigin, estimatedGaugeEnd, cv::Scalar( 0, 0, 255)), 3; //-- Estimated angle
    }

    cv::imshow( "Gauge", gauge);

}
 All Classes Functions Variables