tested and fixed benchmark node on synthetic dataset
This commit is contained in:
@@ -130,7 +130,7 @@ void BenchmarkNode::runBenchmark(const std::string& dataset_dir)
|
|||||||
void BenchmarkNode::runBlenderBenchmark(const std::string& dataset_dir)
|
void BenchmarkNode::runBlenderBenchmark(const std::string& dataset_dir)
|
||||||
{
|
{
|
||||||
// create image reader and load dataset
|
// create image reader and load dataset
|
||||||
std::string filename_benchmark(dataset_dir + "/images.txt");
|
std::string filename_benchmark(dataset_dir + "/trajectory.txt");
|
||||||
vk::FileReader<vk::blender_utils::file_format::ImageNameAndPose> dataset_reader(filename_benchmark);
|
vk::FileReader<vk::blender_utils::file_format::ImageNameAndPose> dataset_reader(filename_benchmark);
|
||||||
dataset_reader.skipComments();
|
dataset_reader.skipComments();
|
||||||
if(!dataset_reader.next()) {
|
if(!dataset_reader.next()) {
|
||||||
@@ -144,7 +144,7 @@ void BenchmarkNode::runBlenderBenchmark(const std::string& dataset_dir)
|
|||||||
for(auto it = dataset.begin(); it != dataset.end() && ros::ok(); ++it, ++frame_count_)
|
for(auto it = dataset.begin(); it != dataset.end() && ros::ok(); ++it, ++frame_count_)
|
||||||
{
|
{
|
||||||
// Read image
|
// Read image
|
||||||
std::string img_filename(dataset_dir + "/" + it->image_name_ + "_0.png");
|
std::string img_filename(dataset_dir + "/img/" + it->image_name_ + "_0.png");
|
||||||
cv::Mat img(cv::imread(img_filename, 0));
|
cv::Mat img(cv::imread(img_filename, 0));
|
||||||
if(img.empty()) {
|
if(img.empty()) {
|
||||||
SVO_ERROR_STREAM("Reading image "<<img_filename<<" failed.");
|
SVO_ERROR_STREAM("Reading image "<<img_filename<<" failed.");
|
||||||
@@ -177,6 +177,7 @@ void BenchmarkNode::runBlenderBenchmark(const std::string& dataset_dir)
|
|||||||
Eigen::Vector3d pt_pos_world = frame_ref->T_f_w_.inverse()*pt_pos_cur;
|
Eigen::Vector3d pt_pos_world = frame_ref->T_f_w_.inverse()*pt_pos_cur;
|
||||||
svo::Point* point = new svo::Point(pt_pos_world, svo::Point::DEPTH);
|
svo::Point* point = new svo::Point(pt_pos_world, svo::Point::DEPTH);
|
||||||
ftr->point = point;
|
ftr->point = point;
|
||||||
|
ftr->point->addFrameRef(ftr);
|
||||||
frame_ref->addFeature(ftr);
|
frame_ref->addFeature(ftr);
|
||||||
}
|
}
|
||||||
SVO_INFO_STREAM("Added "<<corners.size()<<" 3d pts to the reference frame.");
|
SVO_INFO_STREAM("Added "<<corners.size()<<" 3d pts to the reference frame.");
|
||||||
@@ -202,6 +203,9 @@ int main(int argc, char** argv)
|
|||||||
ros::NodeHandle nh;
|
ros::NodeHandle nh;
|
||||||
svo::BenchmarkNode benchmark(nh);
|
svo::BenchmarkNode benchmark(nh);
|
||||||
std::string benchmark_dir(vk::getParam<std::string>("svo/dataset_directory"));
|
std::string benchmark_dir(vk::getParam<std::string>("svo/dataset_directory"));
|
||||||
|
if(vk::getParam<bool>("svo/dataset_is_blender", false))
|
||||||
|
benchmark.runBlenderBenchmark(benchmark_dir);
|
||||||
|
else
|
||||||
benchmark.runBenchmark(benchmark_dir);
|
benchmark.runBenchmark(benchmark_dir);
|
||||||
printf("BenchmarkNode finished.\n");
|
printf("BenchmarkNode finished.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user