|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
#include <boost/lexical_cast.hpp> |
|
|
|
|
#include <string> |
|
|
|
|
#include "CsvWriter.h" |
|
|
|
|
|
|
|
|
|
CsvWriter::CsvWriter(const std::string &path, const std::string &separator){ |
|
|
|
@ -17,9 +17,9 @@ void CsvWriter::writeXYZ(const std::vector<cv::Point3f> &list_points3d) |
|
|
|
|
std::string x, y, z; |
|
|
|
|
for(unsigned int i = 0; i < list_points3d.size(); ++i) |
|
|
|
|
{ |
|
|
|
|
x = boost::lexical_cast< std::string >(list_points3d[i].x); |
|
|
|
|
y = boost::lexical_cast< std::string >(list_points3d[i].y); |
|
|
|
|
z = boost::lexical_cast< std::string >(list_points3d[i].z); |
|
|
|
|
x = std::to_string(list_points3d[i].x); |
|
|
|
|
y = std::to_string(list_points3d[i].y); |
|
|
|
|
z = std::to_string(list_points3d[i].z); |
|
|
|
|
|
|
|
|
|
_file << x << _separator << y << _separator << z << std::endl; |
|
|
|
|
} |
|
|
|
@ -31,18 +31,18 @@ void CsvWriter::writeUVXYZ(const std::vector<cv::Point3f> &list_points3d, const |
|
|
|
|
std::string u, v, x, y, z, descriptor_str; |
|
|
|
|
for(int i = 0; i < list_points3d.size(); ++i) |
|
|
|
|
{ |
|
|
|
|
u = boost::lexical_cast< std::string >(list_points2d[i].x); |
|
|
|
|
v = boost::lexical_cast< std::string >(list_points2d[i].y); |
|
|
|
|
x = boost::lexical_cast< std::string >(list_points3d[i].x); |
|
|
|
|
y = boost::lexical_cast< std::string >(list_points3d[i].y); |
|
|
|
|
z = boost::lexical_cast< std::string >(list_points3d[i].z); |
|
|
|
|
u = std::to_string(list_points2d[i].x); |
|
|
|
|
v = std::to_string(list_points2d[i].y); |
|
|
|
|
x = std::to_string(list_points3d[i].x); |
|
|
|
|
y = std::to_string(list_points3d[i].y); |
|
|
|
|
z = std::to_string(list_points3d[i].z); |
|
|
|
|
|
|
|
|
|
_file << u << _separator << v << _separator << x << _separator << y << _separator << z; |
|
|
|
|
|
|
|
|
|
for(int j = 0; j < 32; ++j) |
|
|
|
|
{ |
|
|
|
|
std::cout << descriptors.at<float>(i,j) << std::endl; |
|
|
|
|
descriptor_str = boost::lexical_cast< std::string >(descriptors.at<float>(i,j)); |
|
|
|
|
descriptor_str = std::to_string(descriptors.at<float>(i,j)); |
|
|
|
|
_file << _separator << descriptor_str; |
|
|
|
|
} |
|
|
|
|
_file << std::endl; |
|
|
|
|