KINECT STATS GENERATOR FOR SPORTS VISUALISATION  1.0
BallTrackingVisualization.h
Go to the documentation of this file.
00001 #ifndef DEPTH_WINDOW_H__
00002 #define DEPTH_WINDOW_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 // must be included after our stuff becuase GLEW needs to be first
00010 #include "KinectInterface.h"
00011 #include "ScreenQuad.h"
00012 #include "QuadCurveFitUtility.h"
00013 
00014 #include <QTime>
00015 #include <QEvent>
00016 #include <QResizeEvent>
00017 
00018 //#include <opencv2/gpu/gpu.hpp>
00019 
00029 
00030 class StatsVisualization;
00031 
00032 enum VIDEOMODE{RGB,DEPTH};
00033 
00034 class BallTrackingVisualization : public QGLWidget
00035 {
00036 Q_OBJECT        // must include this if you use Qt signals/slots
00037 public :
00040   BallTrackingVisualization(
00041              QWidget *_parent
00042              );
00043 
00045   ~BallTrackingVisualization();
00046 
00047 private :
00048 
00049     //----------------------------------------------------------------------------------------------------------------------
00051     //----------------------------------------------------------------------------------------------------------------------
00052     cv::Mat m_rgb, m_gray;
00053 
00054     //---------------------------------------------------------------------------------------------------------------------
00056     //---------------------------------------------------------------------------------------------------------------------
00057     cv::Mat m_nextBuffer,m_prevBuffer, m_diffBuffer, m_bufferDepthRaw, m_bufferDepthRaw1;
00058 
00059 
00060     //---------------------------------------------------------------------------------------------------------------------
00062     //----------------------------------------------------------------------------------------------------------------------
00063     float m_depthinm[640*480];
00064 
00065     //---------------------------------------------------------------------------------------------------------------------
00067     //----------------------------------------------------------------------------------------------------------------------
00068     ScreenQuad *m_screen;
00069 
00070     //---------------------------------------------------------------------------------------------------------------------
00072     //----------------------------------------------------------------------------------------------------------------------
00073     std::vector<cv::Moments> m_momentList;
00074 
00075     //---------------------------------------------------------------------------------------------------------------------
00077     //----------------------------------------------------------------------------------------------------------------------
00078     cv::Mat canny_output;
00079 
00080     //---------------------------------------------------------------------------------------------------------------------
00082     //----------------------------------------------------------------------------------------------------------------------
00083     std::vector<std::vector<cv::Point> > contours;
00084 
00085     //---------------------------------------------------------------------------------------------------------------------
00087     //----------------------------------------------------------------------------------------------------------------------
00088     cv::Mat hierarchy;
00089 
00090     //---------------------------------------------------------------------------------------------------------------------
00092     //----------------------------------------------------------------------------------------------------------------------
00093     double area,rectArea;
00094 
00095     //---------------------------------------------------------------------------------------------------------------------
00097     //----------------------------------------------------------------------------------------------------------------------
00098     std::vector<cv::Moments> mu;
00099 
00100     //---------------------------------------------------------------------------------------------------------------------
00102     //----------------------------------------------------------------------------------------------------------------------
00103     std::vector<cv::Point2f> mc;
00104 
00105     //---------------------------------------------------------------------------------------------------------------------
00107     //----------------------------------------------------------------------------------------------------------------------
00108     double m_binaryLowerThresh,m_binaryMaxVal,m_cannyLowerThresh,m_cannyHigherThresh;
00109 
00110     //---------------------------------------------------------------------------------------------------------------------
00112     //----------------------------------------------------------------------------------------------------------------------
00113     double m_contourAreaThresh,m_diffAreaThresh;
00114 
00115     //---------------------------------------------------------------------------------------------------------------------
00117     //----------------------------------------------------------------------------------------------------------------------
00118     int m_ellipsesize,m_blurSize,m_noOfTimesToDialate, m_masterRigCheck;
00119 
00120 
00121 protected:
00122 
00125   void initializeGL();
00126 
00130   void resizeGL(
00131                 const int _w,
00132                 const int _h
00133                );
00135   // be re-drawn
00136   void paintGL();
00137 
00138 private :
00141 
00142   void mouseMoveEvent (
00143                        QMouseEvent * _event
00144                       );
00148 
00149   void mousePressEvent (
00150                         QMouseEvent *_event
00151                        );
00152 
00156   void mouseReleaseEvent (
00157                           QMouseEvent *_event
00158                          );
00160 
00161   void timerEvent(
00162                     QTimerEvent *_event
00163                    );
00164 
00165 
00166 public slots:
00167 
00168   //----------------------------------------------------------------------------------------------------------------------
00171   //----------------------------------------------------------------------------------------------------------------------
00172   void setBinaryLowerThresh(double _lowerThresh);
00173 
00174 
00175 
00176   void setStructuringElementSize(int _size);
00177 
00178 
00179   void setBlurSize(int _size);
00180 
00181 
00182   void setCannyLowerThresh(double _lowerThresh);
00183 
00184 
00185 
00186   void setCannyHigherThresh(double _higherThresh);
00187 
00188 
00189 
00190   void setNumerOfDialtions(int _numberOfDialtions);
00191 
00192 
00193   void setContourAreaThresh(double _contourAreaThresh);
00194 
00195 
00196   void setDifferenceInAreaThresh(double _diffAreaThresh);
00197 
00198 
00199   void setMasterRigCheck(int _masterRigCheck);
00200 
00201 };
00202 
00203 #endif
 All Classes Files Functions Variables Enumerations Enumerator