Skip to content

Commit

Permalink
Fixed gnebehay#11. Added confidence calculation based on number of fu…
Browse files Browse the repository at this point in the history
…sed points.
  • Loading branch information
glopesdev committed Nov 21, 2015
1 parent 0cd359d commit 38519c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ void CMT::initialize(const Mat im_gray, const Rect rect)
classes_active = classes_fg;
}

//Store initial set of keypoints for confidence calculation
points_initial = points_active;

FILE_LOG(logDEBUG) << "CMT::initialize() return";
}

Expand Down Expand Up @@ -192,6 +195,9 @@ void CMT::processFrame(Mat im_gray) {
//TODO: Use theta to suppress result
bb_rot = RotatedRect(center, size_initial * scale, rotation/CV_PI * 180);

// Compute tracking confidence
confidence = (float)points_fused.size() / points_initial.size();

//Remember current image
im_prev = im_gray;

Expand Down
2 changes: 2 additions & 0 deletions CMT.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ class CMT

vector<Point2f> points_active; //public for visualization purposes
RotatedRect bb_rot;
float confidence;

private:
Ptr<FeatureDetector> detector;
Ptr<DescriptorExtractor> descriptor;

Size2f size_initial;
vector<Point2f> points_initial;

vector<int> classes_active;

Expand Down

0 comments on commit 38519c9

Please sign in to comment.