Fix upvote in voteForKeyframe
... | @@ -150,6 +150,13 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) | ... | @@ -150,6 +150,13 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) |
{ | { | ||
processKnown(); | processKnown(); | ||
// eventually add more features | |||
if (last_ptr_->getFeatureList().size() < params_tracker_->min_features_for_keyframe) | |||
{ | |||
WOLF_TRACE("Adding more features..."); | |||
processNew(params_tracker_->max_new_features); | |||
|
|||
} | |||
if (voteForKeyFrame() && permittedKeyFrame()) | if (voteForKeyFrame() && permittedKeyFrame()) | ||
{ | { | ||
// We create a KF | // We create a KF | ||
... | @@ -164,9 +171,9 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) | ... | @@ -164,9 +171,9 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) |
// process | // process | ||
processNew(params_tracker_->max_new_features); | processNew(params_tracker_->max_new_features); | ||
// Set key | // // Set key | ||
last_ptr_->getFramePtr()->setKey(); | // last_ptr_->getFramePtr()->setKey(); | ||
// | |||
// Set state to the keyframe | // Set state to the keyframe | ||
last_ptr_->getFramePtr()->setState(getProblem()->getState(last_ptr_->getTimeStamp())); | last_ptr_->getFramePtr()->setState(getProblem()->getState(last_ptr_->getTimeStamp())); | ||
... | @@ -187,10 +194,6 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) | ... | @@ -187,10 +194,6 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) |
{ | { | ||
// We do not create a KF | // We do not create a KF | ||
// eventually add more features | |||
if (last_ptr_->getFeatureList().size() < params_tracker_->min_features_for_keyframe) | |||
processNew(params_tracker_->max_new_features); | |||
// Advance this | // Advance this | ||
last_ptr_->getFramePtr()->addCapture(incoming_ptr_); // Add incoming Capture to the tracker's last Frame | last_ptr_->getFramePtr()->addCapture(incoming_ptr_); // Add incoming Capture to the tracker's last Frame | ||
last_ptr_->remove(); | last_ptr_->remove(); | ||
... | @@ -207,6 +210,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) | ... | @@ -207,6 +210,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) |
break; | break; | ||
} | } | ||
number_of_tracks_ = last_ptr_->getFeatureList().size(); | |||
postProcess(); | postProcess(); | ||
} | } | ||
... | ... |