GECKO 1.0
Human-computer interface based on hand gesture recognition
|
Extracts the hand angle from its bounding box and a Kalman Filter. { //-- Create matrix for storing the measurement (measured position of hand) cv::Mat_<float> angleMeasurement(1, 1); angleMeasurement.setTo( cv::Scalar(0)); //-- Predict angle with Kalman filter: cv::Mat anglePrediction = kalmanFilterAngle.predict(); _hand_angle_prediction = anglePrediction.at<float>(0); //-- Measure actual angle: double newHandAngle = getAngle(_hand_rotated_bounding_box); _hand_angle = newHandAngle < 0 ? _hand_angle : newHandAngle; angleMeasurement(0) = _hand_angle; //-- Correct prediction: cv::Mat angleEstimation = kalmanFilterAngle.correct( angleMeasurement ); _hand_angle_estimation = angleEstimation.at<float>(0); } |