-
- IplImage *object_image;
- IplImage *scene_image;
-
-
-// Comparison with current object_image
- unsigned char *prev_object;
-// Quantized sizes
- int object_image_w;
- int object_image_h;
- int scene_image_w;
- int scene_image_h;
- CvSeq *object_keypoints;
- CvSeq *object_descriptors;
- CvSeq *scene_keypoints;
- CvSeq *scene_descriptors;
- CvMemStorage *storage;
-
-// camshift
-// object histogram
- Mat hist;
- Rect trackWindow;
-
-
-// Blob
- int blob_initialized;
- CvBlobTrackerAutoParam1 blob_param;
- CvBlobTrackerAuto* blob_pTracker;
-
-
+//opencv
+ typedef vector<DMatch> DMatchV;
+ typedef vector<DMatchV> DMatches;
+ typedef vector<KeyPoint> KeyPointV;
+ typedef vector<Point2f> ptV;
+
+ BC_CModel cvmodel;
+ Mat object_mat, scene_mat;
+ Mat obj_descrs; KeyPointV obj_keypts;
+ Mat scn_descrs; KeyPointV scn_keypts;
+ DMatches pairs;
+
+ static void to_mat(Mat &mat, int mcols, int mrows,
+ VFrame *inp, int ix,int iy, BC_CModel mcolor_model);
+ void detect(Mat &mat, KeyPointV &keypts, Mat &descrs);
+ void match();
+ void filter_matches(ptV &p1, ptV &p2, double ratio=0.75);
+
+ Ptr<Feature2D> detector;
+ Ptr<DescriptorMatcher> matcher;
+ Ptr<DescriptorMatcher> flann_kdtree_matcher();
+ Ptr<DescriptorMatcher> flann_lshidx_matcher();
+ Ptr<DescriptorMatcher> bf_matcher_norm_l2();
+ Ptr<DescriptorMatcher> bf_matcher_norm_hamming();