diff --git a/svo/include/svo/frame_handler_mono.h b/svo/include/svo/frame_handler_mono.h index 3dc80ab..f15afaf 100644 --- a/svo/include/svo/frame_handler_mono.h +++ b/svo/include/svo/frame_handler_mono.h @@ -34,6 +34,9 @@ public: /// Provide an image. void addImage(const cv::Mat& img, double timestamp); + /// Set the first frame (used for synthetic datasets in benchmark node) + void setFirstFrame(const FramePtr& first_frame); + /// Get the last frame that has been processed. FramePtr lastFrame() { return last_frame_; } diff --git a/svo/src/frame_handler_mono.cpp b/svo/src/frame_handler_mono.cpp index 95a9787..63672aa 100644 --- a/svo/src/frame_handler_mono.cpp +++ b/svo/src/frame_handler_mono.cpp @@ -74,6 +74,15 @@ addImage(const cv::Mat& img, double timestamp) finishFrameProcessingCommon(last_frame_->id_, res, last_frame_->nObs()); } +void FrameHandlerMono:: +setFirstFrame(const FramePtr& first_frame) +{ + resetAll(); + last_frame_ = first_frame; + map_.addKeyframe(last_frame_); + stage_ = DEFAULT_FRAME; +} + FrameHandlerMono::UpdateResult FrameHandlerMono:: processFirstFrame() {