|
NASA Astrobee Robot Software
0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
|
Go to the documentation of this file.
19 #ifndef SPARSE_MAPPING_SPARSE_MAPPING_H_
20 #define SPARSE_MAPPING_SPARSE_MAPPING_H_
25 #include <Eigen/Geometry>
39 class CameraParameters;
46 class ZeroCopyInputStream;
47 class ZeroCopyOutputStream;
74 Eigen::Quaternion<double>
slerp_n(std::vector<double>
const& W, std::vector<Eigen::Quaternion<double> >
const& Q);
82 void WriteNVM(std::vector<Eigen::Matrix2Xd>
const& cid_to_keypoint_map, std::vector<std::string>
const& cid_to_filename,
83 std::vector<std::map<int, int> >
const& pid_to_cid_fid, std::vector<Eigen::Vector3d>
const& pid_to_xyz,
84 std::vector<Eigen::Affine3d>
const& cid_to_cam_t_global,
double focal_length,
85 std::string
const& output_filename);
87 void ReadNVM(std::string
const& input_filename, std::vector<Eigen::Matrix2Xd>* cid_to_keypoint_map,
88 std::vector<std::string>* cid_to_filename, std::vector<std::map<int, int> >* pid_to_cid_fid,
89 std::vector<Eigen::Vector3d>* pid_to_xyz, std::vector<Eigen::Affine3d>* cid_to_cam_t_global);
92 std::string
ImageToFeatureFile(std::string
const& image_file, std::string
const& detector_name);
98 std::string
MatchesFile(std::string
const& map_file);
104 void WriteFeatures(std::string
const& detector_name, std::vector<cv::KeyPoint>
const& keypoints,
105 cv::Mat
const& descriptors, std::string
const& output_filename);
108 bool ReadFeatures(std::string
const& input_filename, std::string
const& detector_name,
109 std::vector<cv::KeyPoint>* keypoints, cv::Mat* descriptors);
112 int ReadFeaturesSIFT(std::string
const& filename, cv::Mat* descriptors, std::vector<cv::KeyPoint>* keypoints);
123 Eigen::Matrix3d* essential);
126 void DecomposeEMatIntoRT(Eigen::Matrix3d
const& essential, Eigen::Matrix2Xd
const& unnormalized_pts1,
127 Eigen::Matrix2Xd
const& unnormalized_pts2, std::vector<cv::DMatch>
const& matches,
128 double focal_length1,
129 double focal_length2,
135 void ListToListMap(std::vector<std::string>
const& big_list, std::vector<std::string>
const& small_list,
136 std::map<int, int>* map);
138 void MergePids(
int repeat_index,
int num_unique, std::vector<std::map<int, int> >* pid_to_cid_fid);
140 void PrintPidStats(std::vector<std::map<int, int> >
const& pid_to_cid_fid);
144 void ParseHuginControlPoints(std::string
const& hugin_file, std::vector<std::string>* images, Eigen::MatrixXd* points);
147 void ParseXYZ(std::string
const& xyz_file, Eigen::MatrixXd* xyz);
153 void ParseCSV(std::string
const& csv_file, std::map<std::string, std::vector<double> >* cols);
157 google::protobuf::io::ZeroCopyOutputStream* rawOutput);
160 bool WriteFileTo(
const char* filename, google::protobuf::io::ZeroCopyOutputStream* rawOutput);
163 bool ReadProtobufFrom(google::protobuf::io::ZeroCopyInputStream* rawInput, google::protobuf::MessageLite* message);
166 bool ReadFileFrom(google::protobuf::io::ZeroCopyInputStream* rawInput,
const char* filename);
171 std::vector<Eigen::Vector3d>* xyz);
174 double GetErrThresh(
const std::vector<double>& errors,
double factor);
179 double ComputeRaysAngle(
int pid, std::vector<std::map<int, int> >
const& pid_to_cid_fid,
180 std::vector<Eigen::Vector3d>
const& cam_ctrs, std::vector<Eigen::Vector3d>
const& pid_to_xyz);
184 std::vector<Eigen::Affine3d>
const& cid_to_cam_t_global,
185 std::vector<Eigen::Matrix2Xd>
const& cid_to_keypoint_map,
186 std::vector<std::map<int, int> >* pid_to_cid_fid, std::vector<Eigen::Vector3d>* pid_to_xyz,
187 bool print_stats =
true,
double multiple_of_median = 3.0);
191 std::vector<std::map<int, int> >
const& pid_to_cid_fid, std::vector<Eigen::Vector3d>
const& pid_to_xyz,
192 std::vector<Eigen::Affine3d>
const& cid_to_cam_t_global,
193 std::vector<Eigen::Matrix2Xd>
const& cid_to_keypoint_map);
198 void PoseInterpolation(std::vector<std::string>
const& images, std::vector<double>
const& out_time,
199 std::map<std::string, std::vector<double> >
const& data,
200 std::vector<Eigen::Affine3d>* cid_to_cam_t, std::vector<std::string>* good_images);
204 #endif // SPARSE_MAPPING_SPARSE_MAPPING_H_
Eigen::Vector3d TriangulatePoint(Eigen::Vector3d const &unnormalized_pt1, Eigen::Vector3d const &unnormalized_pt2, Eigen::Matrix3d const &cam2_r_cam1, Eigen::Vector3d const &cam2_t_cam1, double *error)
Definition: sparse_mapping.cc:418
@ kUnknown
Definition: sparse_mapping.h:72
HistogramEqualizationType
Definition: sparse_mapping.h:72
double ComputeRaysAngle(int pid, std::vector< std::map< int, int > > const &pid_to_cid_fid, std::vector< Eigen::Vector3d > const &cam_ctrs, std::vector< Eigen::Vector3d > const &pid_to_xyz)
Definition: sparse_mapping.cc:1026
Definition: localization_parameters.h:22
std::string CvMatTypeStr(cv::Mat const &Mat)
Definition: sparse_mapping.cc:522
bool IsBinaryDescriptor(std::string const &descriptor)
Definition: sparse_mapping.cc:135
Definition: camera_params.h:58
bool WriteProtobufTo(const google::protobuf::MessageLite &message, google::protobuf::io::ZeroCopyOutputStream *rawOutput)
Definition: sparse_mapping.cc:873
std::string MatchesFile(std::string const &map_file)
Definition: sparse_mapping.cc:296
bool WriteBAL(const std::string &filename, camera::CameraParameters const &camera_params, std::vector< std::map< int, int > > const &pid_to_cid_fid, std::vector< Eigen::Vector3d > const &pid_to_xyz, std::vector< Eigen::Affine3d > const &cid_to_cam_t_global, std::vector< Eigen::Matrix2Xd > const &cid_to_keypoint_map)
Definition: sparse_mapping.cc:1169
bool ReadFileFrom(google::protobuf::io::ZeroCopyInputStream *rawInput, const char *filename)
Definition: sparse_mapping.cc:951
void ParseHuginControlPoints(std::string const &hugin_file, std::vector< std::string > *images, Eigen::MatrixXd *points)
Definition: sparse_mapping.cc:709
double GetErrThresh(const std::vector< double > &errors, double factor)
Definition: sparse_mapping.cc:1010
void PoseInterpolation(std::vector< std::string > const &images, std::vector< double > const &out_time, std::map< std::string, std::vector< double > > const &data, std::vector< Eigen::Affine3d > *cid_to_cam_t, std::vector< std::string > *good_images)
Definition: sparse_mapping.cc:1244
bool ReadProtobufFrom(google::protobuf::io::ZeroCopyInputStream *rawInput, google::protobuf::MessageLite *message)
Definition: sparse_mapping.cc:929
void ParseXYZ(std::string const &xyz_file, Eigen::MatrixXd *xyz)
Definition: sparse_mapping.cc:780
void FilterPID(double reproj_thresh, camera::CameraParameters const &camera_params, std::vector< Eigen::Affine3d > const &cid_to_cam_t_global, std::vector< Eigen::Matrix2Xd > const &cid_to_keypoint_map, std::vector< std::map< int, int > > *pid_to_cid_fid, std::vector< Eigen::Vector3d > *pid_to_xyz, bool print_stats=true, double multiple_of_median=3.0)
Definition: sparse_mapping.cc:1056
@ kNone
Definition: sparse_mapping.h:72
Eigen::Vector3d Vector3d(const PointType &point)
Definition: utilities.h:328
bool HistogramEqualizationCheck(int histogram_equalization1, int histogram_equalization2, bool fatal_failure=true)
Definition: sparse_mapping.cc:118
void DecomposeFMatIntoEMat(Eigen::Matrix3d const &fundamental, Eigen::Matrix3d const &intrinsics, Eigen::Matrix3d *essential)
Definition: sparse_mapping.cc:442
void WriteNVM(std::vector< Eigen::Matrix2Xd > const &cid_to_keypoint_map, std::vector< std::string > const &cid_to_filename, std::vector< std::map< int, int > > const &pid_to_cid_fid, std::vector< Eigen::Vector3d > const &pid_to_xyz, std::vector< Eigen::Affine3d > const &cid_to_cam_t_global, double focal_length, std::string const &output_filename)
std::string ImageToFeatureFile(std::string const &image_file, std::string const &detector_name)
Definition: sparse_mapping.cc:287
std::string EssentialFile(std::string const &map_file)
Definition: sparse_mapping.cc:300
void MergePids(int repeat_index, int num_unique, std::vector< std::map< int, int > > *pid_to_cid_fid)
Definition: sparse_mapping.cc:566
void ReadNVM(std::string const &input_filename, std::vector< Eigen::Matrix2Xd > *cid_to_keypoint_map, std::vector< std::string > *cid_to_filename, std::vector< std::map< int, int > > *pid_to_cid_fid, std::vector< Eigen::Vector3d > *pid_to_xyz, std::vector< Eigen::Affine3d > *cid_to_cam_t_global)
Definition: sparse_mapping.cc:204
void PrintPidStats(std::vector< std::map< int, int > > const &pid_to_cid_fid)
Definition: sparse_mapping.cc:691
uint8_t error
Definition: signal_lights.h:89
Eigen::Affine3d Affine3d(const Eigen::Matrix< double, 7, 1 > &affine_vector)
Definition: utilities.cc:43
std::string DBImagesFile(std::string const &db_name)
Definition: sparse_mapping.cc:292
bool ReadFeatures(std::string const &input_filename, std::string const &detector_name, std::vector< cv::KeyPoint > *keypoints, cv::Mat *descriptors)
Definition: sparse_mapping.cc:395
void TransformCamerasAndPoints(Eigen::Affine3d const &A, std::vector< Eigen::Affine3d > *cid_to_cam_t, std::vector< Eigen::Vector3d > *xyz)
Definition: sparse_mapping.cc:992
Eigen::Quaternion< double > slerp_n(std::vector< double > const &W, std::vector< Eigen::Quaternion< double > > const &Q)
Definition: sparse_mapping.cc:54
void DecomposeEMatIntoRT(Eigen::Matrix3d const &essential, Eigen::Matrix2Xd const &unnormalized_pts1, Eigen::Matrix2Xd const &unnormalized_pts2, std::vector< cv::DMatch > const &matches, double focal_length1, double focal_length2, Eigen::Matrix3d *cam2_r_cam1, Eigen::Vector3d *cam2_t_cam1)
Definition: sparse_mapping.cc:453
void ParseCSV(std::string const &csv_file, std::map< std::string, std::vector< double > > *cols)
Definition: sparse_mapping.cc:816
Definition: camera_params.h:31
@ kCLAHE
Definition: sparse_mapping.h:72
bool WriteFileTo(const char *filename, google::protobuf::io::ZeroCopyOutputStream *rawOutput)
Definition: sparse_mapping.cc:895
int ReadFeaturesSIFT(std::string const &filename, cv::Mat *descriptors, std::vector< cv::KeyPoint > *keypoints)
Definition: sparse_mapping.cc:304
void WriteFeatures(std::string const &detector_name, std::vector< cv::KeyPoint > const &keypoints, cv::Mat const &descriptors, std::string const &output_filename)
Definition: sparse_mapping.cc:384
void ListToListMap(std::vector< std::string > const &big_list, std::vector< std::string > const &small_list, std::map< int, int > *map)
Definition: sparse_mapping.cc:545
Definition: sparse_mapping.h:42
@ kEqualizeHist
Definition: sparse_mapping.h:72
Definition: sparse_mapping.h:38