GECKO 1.0
Human-computer interface based on hand gesture recognition
handUtils.h
00001 //------------------------------------------------------------------------------
00002 //-- handUtils
00003 //------------------------------------------------------------------------------
00004 //--
00005 //-- A collection of useful functions for hand gesture recognition
00006 //--
00007 //------------------------------------------------------------------------------
00008 //--
00009 //-- This file belongs to the "Gecko - Gesture Recognition" project
00010 //-- (https://github.com/David-Estevez/gecko)
00011 //--
00012 //------------------------------------------------------------------------------
00013 //-- Authors: David Estevez Fernandez
00014 //--          Irene Sanz Nieto
00015 //--
00016 //-- Released under the GPL license (more info on LICENSE.txt file)
00017 //------------------------------------------------------------------------------
00018 
00027 #ifndef HANDUTILS_H
00028 #define HANDUTILS_H
00029 
00030 #include <iostream>
00031 #include <opencv2/opencv.hpp>
00032 #include <opencv2/imgproc/imgproc.hpp>
00033 #include "backgroundSubstractor.h"
00034 
00045 void drawCalibrationMarks(cv::Mat& input, cv::Mat& output, int halfSide = 20,  cv::Scalar color  = cv::Scalar( 0, 255, 0 ) );
00046 
00047 
00052 void drawHistogram(const cv::Mat& image);
00053 
00058 void drawHistogramHSV( const cv::Mat& image);
00059 
00071 void filterContours(std::vector< std::vector<cv::Point> >& srcContours, std::vector< std::vector<cv::Point> >& handContour , const int min = 200, const int max = 1800);
00072 
00082 double getAngle( cv::RotatedRect boundingRect);
00083 
00088 void backgroundSubs(cv::Mat &, backgroundSubstractor & bg);
00089 
00090 
00092 struct ConvexityDefect
00093 {
00094 
00095     cv::Point start;        
00096     cv::Point end;          
00097     cv::Point depth_point;  
00098     double depth;           
00099 
00100     int start_index;        
00101     int end_index;          
00102     int depth_point_index;  
00103 };
00104 typedef struct ConvexityDefect ConvexityDefect;
00105 
00106 
00117 float findAngle( cv::Point start, cv::Point end, cv::Point vertex);
00118 
00119 
00128 void printProgressBar( cv::Mat& src, cv::Mat& dst, float percentage, cv::Scalar color, int thickness = 15 );
00129 
00130 #endif // HANDUTILS_H
 All Classes Functions Variables