Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #2

Merged
merged 22 commits into from
Apr 29, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
can set start frame idx of dataset
  • Loading branch information
cfo committed Apr 22, 2014
commit 0cbe4a6ca1a4c173209881d1bba783eb5708e8ad
20 changes: 10 additions & 10 deletions svo_ros/src/benchmark_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,20 @@ void BenchmarkNode::runBenchmark(const std::string& dataset_dir)
dataset_reader.readAllEntries(dataset);

// process dataset
int first_frame = vk::getParam<int>("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 "<<img_filename<<" failed.");
return;
}

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)
tracePose(vo_->lastFrame()->T_f_w_.inverse(), it->timestamp_);
}
Expand Down Expand Up @@ -208,13 +207,14 @@ void BenchmarkNode::runBlenderBenchmark(const std::string& dataset_dir)
SVO_INFO_STREAM("Added "<<corners.size()<<" 3d pts to the reference frame.");
vo_->setFirstFrame(frame_ref);
SVO_INFO_STREAM("Set reference frame.");
continue;
}

SVO_DEBUG_STREAM("Processing image "<<it->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 "<<it->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)
{
Expand Down