You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __SURF_HEADERS__
  2. #define __SURF_HEADERS__
  3. #include "../../../components/base/basicVideoAnalyzer.h"
  4. #include "../filter/filterImage.h"
  5. #define MAX_SURF_COUNT 400
  6. using namespace cv::detail;
  7. /*
  8. typedef struct S_BlobInfo {
  9. unsigned int id;
  10. int weight;
  11. point location, origin; // current location and origin for defining a drag vector
  12. CvRect box; // to define our axis-aligned bounding box
  13. float area;
  14. int event; // event type: one of BLOB_NULL, BLOB_DOWN, BLOB_MOVE, BLOB_UP
  15. bool tracked; // a flag to indicate this blob has been processed
  16. Scalar color;
  17. float dir;
  18. }BlobInfo;
  19. */
  20. typedef vector< U8 > tArrayU8;
  21. typedef vector<float> tArrayFloat;
  22. typedef vector<KeyPoint> tArrayKeypoint;
  23. //typedef vector<DMatch> tArrayMatches;
  24. typedef MatchesInfo tArrayMatches;
  25. //typedef vector<BlobInfo> tArrayBlobInfo;
  26. class surfDetector : public basicVideoAnalyzer, public BestOf2NearestMatcher, public SurfFeaturesFinder{
  27. private:
  28. // int m_iWidth;
  29. // int m_iHeight;
  30. double m_dArea;
  31. filterImage *m_oFilter;
  32. Mat m_oMat;
  33. //tArrayU8 m_vStatus;
  34. //tArrayFloat m_vErr;
  35. tArrayKeypoint m_aNewKeyPoints;
  36. tArrayKeypoint m_aOldKeyPoints;
  37. tArrayMatches m_aMatches;
  38. tArrayMatches m_aGoodMatches;
  39. //Mat m_oNewDescriptors;
  40. //Mat m_oOldDescriptors;
  41. ImageFeatures m_oNewImageFutures;
  42. ImageFeatures m_oOldImageFutures;
  43. tPoints2F m_vOldPOI;
  44. tPoints2F m_vCurrentPOI;
  45. //tContours m_vContours;
  46. //tHierarhy m_vHierarchy;
  47. //TermCriteria *m_pDetectionCriteria;
  48. //SurfFeatureDetector *m_pSurfDetector;
  49. //DenseFeatureDetector *m_pSurfDetector;
  50. SimpleBlobDetector *m_pBlobDetector;
  51. //SurfDescriptorExtractor *m_pSurfExtractor;
  52. //FlannBasedMatcher *m_pFlannMatcher;
  53. protected:
  54. bool m_fImageAnalyzer(Mat &Picture);
  55. public:
  56. surfDetector();
  57. surfDetector(double Area);
  58. ~surfDetector();
  59. void markup( Mat &Picture );
  60. };
  61. #endif