From 0cbe4a6ca1a4c173209881d1bba783eb5708e8ad Mon Sep 17 00:00:00 2001 From: Christian Forster Date: Tue, 22 Apr 2014 18:36:18 +0200 Subject: [PATCH] can set start frame idx of dataset --- svo_ros/src/benchmark_node.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/svo_ros/src/benchmark_node.cpp b/svo_ros/src/benchmark_node.cpp index 187c5c5..bc94653 100644 --- a/svo_ros/src/benchmark_node.cpp +++ b/svo_ros/src/benchmark_node.cpp @@ -124,21 +124,20 @@ void BenchmarkNode::runBenchmark(const std::string& dataset_dir) dataset_reader.readAllEntries(dataset); // process dataset + int first_frame = vk::getParam("svo/dataset_first_frame", 0); for(auto it = dataset.begin(); it != dataset.end() && ros::ok(); ++it, ++frame_count_) { - // Read image + if(frame_count_ < first_frame) + continue; std::string img_filename(dataset_dir + "/" + it->image_name_); cv::Mat img(cv::imread(img_filename, 0)); if(img.empty()) { SVO_ERROR_STREAM("Reading image "<addImage(img, it->timestamp_); - visualizer_.publishMinimal(img, vo_->lastFrame(), *vo_, it->timestamp_); visualizer_.visualizeMarkers(vo_->lastFrame(), vo_->coreKeyframes(), vo_->map()); - if(vo_->stage() == svo::FrameHandlerMono::STAGE_DEFAULT_FRAME) tracePose(vo_->lastFrame()->T_f_w_.inverse(), it->timestamp_); } @@ -208,13 +207,14 @@ void BenchmarkNode::runBlenderBenchmark(const std::string& dataset_dir) SVO_INFO_STREAM("Added "<setFirstFrame(frame_ref); SVO_INFO_STREAM("Set reference frame."); - continue; } - - SVO_DEBUG_STREAM("Processing image "<image_name_<<"."); - vo_->addImage(img, it->timestamp_); - visualizer_.publishMinimal(img, vo_->lastFrame(), *vo_, it->timestamp_); - visualizer_.visualizeMarkers(vo_->lastFrame(), vo_->coreKeyframes(), vo_->map()); + else + { + SVO_DEBUG_STREAM("Processing image "<image_name_<<"."); + vo_->addImage(img, it->timestamp_); + visualizer_.publishMinimal(img, vo_->lastFrame(), *vo_, it->timestamp_); + visualizer_.visualizeMarkers(vo_->lastFrame(), vo_->coreKeyframes(), vo_->map()); + } if(vo_->stage() != svo::FrameHandlerMono::STAGE_DEFAULT_FRAME) {