Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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