KINECT STATS GENERATOR FOR SPORTS VISUALISATION  1.0
PlayerData.h
Go to the documentation of this file.
00001 #ifndef PLAYERDATA_H
00002 #define PLAYERDATA_H
00003 
00004 /*
00005   LICENSING: You are free to use any part of this project provided I am informed about it via email
00006   at santoshwins@hotmail.com and referenced appropriately in your works
00007   */
00008 
00009 #include "TwoDStatsGeneration.h"
00010 #include "ThreeDStatsGeneration.h"
00011 
00012 #include "opencv2/opencv.hpp"
00013 
00021 
00022 typedef enum
00023 {
00024     TOP_LEFT,
00025     BOTTOM_LEFT,
00026     BOTTOM_RIGHT,
00027     TOP_RIGHT,
00028     ALL
00029 }WHICH_QUADRANT;
00030 
00031 class PlayerData
00032 {
00033     public:
00034 
00036         PlayerData();
00038         ~PlayerData();
00039 
00042         void setPlayerBallPts(std::vector<std::vector<cv::Point3f> > &_inputPointSetsInWorld);
00045         void setPlayerImpactPtIndices(std::vector<std::vector<int> > &_inputDepthIndices);
00046 
00048         void setPlayerDataProcessedFlag();
00049 
00051         std::vector<cv::Point>& getPlayerImpactPtsAllRallies();
00052 
00054         std::vector<std::vector<cv::Point3f> >& getPlayerBallPtsAll();
00055 
00057         std::vector<std::vector<int> >& getPlayerImpactPtIndices();
00058 
00060         float getPercentageDistributionData(int _width, int _height,WHICH_QUADRANT _whichQuadrant);
00061 
00063         std::vector<cv::Point>& getQuadSpecificPoints(WHICH_QUADRANT _whichQuad);
00064 
00066         std::vector<cv::Point3f>& getBarGraphVertices(cv::Point _inputTopXY, int _width, int _height, int _gridResolution);
00067 
00069         std::vector<std::vector<cv::Point3f> >& getPlayerInterpolatedBallPtsAll(float _inputDistanceFrmKinectToPlayArea);
00070 
00072         std::vector<cv::Point3f>& getPlayerImpactPtsIn3DAllRallies();
00073 
00075         std::vector<float>& getPlayerSpeedData(float _inputDistanceFrmKinectToPlayArea);
00076 
00078         std::vector<float>& getRevolutionsPerMinute(float _inputDiameterInMeters,
00079                                                     float _inputDistanceFrmKinectToPlayArea);
00080 
00081 
00083         bool checkDataProcessed();
00084 
00085 
00086     private:
00087 
00089         TwoDStatsGeneration *m_twoDStatsGenerator;
00091         ThreeDStatsGeneration *m_threeDStatsGenerator;
00092 
00093 
00094 
00101         bool m_dataProcessed;
00102 
00104         std::vector<std::vector<cv::Point3f> > m_playerBallPts;
00105 
00108         std::vector<std::vector<int> > m_playerDeepestPtIndices;
00109 
00111         std::vector<cv::Point> m_playerImpactPtsAllRallies;
00113         std::vector<cv::Point3f> m_playerImpactPtsAllRalliesIn3D;
00114 
00116         float m_bottomLeftPercentage,m_topLeftPercentage,m_topRightPercentage,m_bottomRightPercentage;
00117 
00119         std::vector<cv::Point> m_playerImpactPtsBottomLeft,m_playerImpactPtsTopLeft;
00120         std::vector<cv::Point> m_playerImpactPtsTopRight,m_playerImpactPtsBottomRight;
00121 
00123         std::vector<cv::Point3f> m_barGraphVertices;
00124 
00130         std::vector<std::vector<cv::Point3f> > m_playerInterpolatedBallPts;
00131 
00134         std::vector<float> m_speedData;
00137         std::vector<float> m_rpmData;
00138 
00141         void calculatePlayerImpactPtsFromIndices();
00142 
00143 };
00144 
00145 #endif // PLAYERDATA_H
 All Classes Files Functions Variables Enumerations Enumerator