|
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_TENSOR_H_
20 #define SPARSE_MAPPING_TENSOR_H_
24 #include <Eigen/Geometry>
25 #include <ceres/ceres.h>
37 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(std::array<std::pair<std::pair<int, int>,
Eigen::Affine3d>, 3>)
50 typedef std::map<std::pair<int, int>,
Eigen::Affine3d, std::less<std::pair<int, int> >,
51 Eigen::aligned_allocator<std::pair<std::pair<int , int >
const,
Eigen::Affine3d> > >
54 typedef std::vector<CIDAffineTuple, Eigen::aligned_allocator<CIDAffineTuple> >
CIDAffineTupleVec;
63 void MatchFeatures(
const std::string & essential_file,
const std::string & matches_file,
70 const std::string & matches_file,
89 std::set<int>
const& fixed_cameras = std::set<int>());
92 ceres::LossFunction * loss,
93 const ceres::Solver::Options & options,
94 ceres::Solver::Summary * summary,
95 int first = 0,
int last = std::numeric_limits<int>::max(),
96 bool fix_all_cameras =
false,
97 std::set<int>
const& fixed_cameras = std::set<int>());
102 void AppendMapFile(std::string
const& mapOut, std::string
const& mapIn,
103 int num_image_overlaps_at_endpoints,
104 double outlier_factor,
105 bool bundle_adjust,
bool fix_first_map);
112 int num_image_overlaps_at_endpoints,
113 double outlier_factor,
114 std::string
const& output_map,
134 std::string
const& output_filename);
136 std::string
const& output_filename);
144 void PrintTrackStats(std::vector<std::map<int, int> >
const& pid_to_cid_fid,
145 std::string
const& step);
150 std::vector<cv::DMatch>* inlier_matches, std::vector<size_t>* vec_inliers,
151 Eigen::Matrix3d* essential_matrix,
const int ransac_iterations = 4096);
154 const Eigen::Matrix2Xd & keypoints2,
155 const std::vector<cv::DMatch> & matches,
157 bool compute_inliers_only,
158 size_t cam_a_idx,
size_t cam_b_idx,
159 std::mutex * match_mutex,
161 std::vector<cv::DMatch> * inlier_matches,
162 bool compute_rays_angle,
163 double * rays_angle);
169 size_t num_of_cameras,
170 std::vector<std::map<int, int> > * cid_to_pid_fid);
175 std::set<std::tuple<int, int, int> > * tuple_listing);
179 void Triangulate(
bool rm_invalid_xyz,
double focal_length,
180 std::vector<Eigen::Affine3d>
const& cid_to_cam_t_global,
181 std::vector<Eigen::Matrix2Xd>
const& cid_to_keypoint_map,
182 std::vector<std::map<int, int> > * pid_to_cid_fid,
183 std::vector<Eigen::Vector3d> * pid_to_xyz,
184 std::vector<std::map<int, int> > * cid_fid_to_pid);
188 #endif // SPARSE_MAPPING_TENSOR_H_
void BundleAdjustment(sparse_mapping::SparseMap *s, ceres::LossFunction *loss, const ceres::Solver::Options &options, ceres::Solver::Summary *summary, int first=0, int last=std::numeric_limits< int >::max(), bool fix_all_cameras=false, std::set< int > const &fixed_cameras=std::set< int >())
Definition: tensor.cc:639
void WriteAffineCSV(CIDPairAffineMap const &relative_affines, std::string const &output_filename)
Definition: tensor.cc:1890
void BuildTracks(bool rm_invalid_xyz, const std::string &matches_file, sparse_mapping::SparseMap *s)
Definition: tensor.cc:318
Definition: localization_parameters.h:22
void BuildMapFindEssentialAndInliers(const Eigen::Matrix2Xd &keypoints1, const Eigen::Matrix2Xd &keypoints2, const std::vector< cv::DMatch > &matches, camera::CameraParameters const &camera_params, bool compute_inliers_only, size_t cam_a_idx, size_t cam_b_idx, std::mutex *match_mutex, CIDPairAffineMap *relative_b_t_a, std::vector< cv::DMatch > *inlier_matches, bool compute_rays_angle, double *rays_angle)
Definition: tensor.cc:1979
void BundleAdjust(std::vector< std::map< int, int > > const &pid_to_cid_fid, std::vector< Eigen::Matrix2Xd > const &cid_to_keypoint_map, double focal_length, std::vector< Eigen::Affine3d > *cid_to_cam_t_global, std::vector< Eigen::Vector3d > *pid_to_xyz, std::vector< std::map< int, int > > const &user_pid_to_cid_fid, std::vector< Eigen::Matrix2Xd > const &user_cid_to_keypoint_map, std::vector< Eigen::Vector3d > *user_pid_to_xyz, ceres::LossFunction *loss, ceres::Solver::Options const &options, ceres::Solver::Summary *summary, int first=0, int last=std::numeric_limits< int >::max(), bool fix_cameras=false, std::set< int > const &fixed_cameras=std::set< int >())
Definition: reprojection.cc:96
Definition: camera_params.h:58
void ExtractSubmap(std::vector< std::string > *keep_ptr, sparse_mapping::SparseMap *map_ptr)
Definition: tensor.cc:1448
void IncrementalBA(std::string const &essential_file, sparse_mapping::SparseMap *s)
Definition: tensor.cc:378
void AppendMapFile(std::string const &mapOut, std::string const &mapIn, int num_image_overlaps_at_endpoints, double outlier_factor, bool bundle_adjust, bool fix_first_map)
Definition: tensor.cc:665
std::vector< CIDAffineTuple, Eigen::aligned_allocator< CIDAffineTuple > > CIDAffineTupleVec
Definition: tensor.h:54
double RegistrationOrVerification(std::vector< std::string > const &data_files, bool verification, sparse_mapping::SparseMap *s)
Definition: tensor.cc:1559
void MatchFeatures(const std::string &essential_file, const std::string &matches_file, sparse_mapping::SparseMap *s)
Definition: tensor.cc:209
void PrintTrackStats(std::vector< std::map< int, int > >const &pid_to_cid_fid, std::string const &step)
Definition: tensor.cc:1804
void CloseLoop(sparse_mapping::SparseMap *s)
Definition: tensor.cc:505
std::map< std::pair< int, int >, Eigen::Affine3d, std::less< std::pair< int, int > >, Eigen::aligned_allocator< std::pair< std::pair< int, int > const, Eigen::Affine3d > > > CIDPairAffineMap
Definition: tensor.h:52
void ReadAffineCSV(std::string const &input_filename, CIDPairAffineMap *relative_affines)
Definition: tensor.cc:1909
void GenerateCIDToPIDFIDMap(std::vector< std::map< int, int > > const &pid_to_cid_fid, size_t num_of_cameras, std::vector< std::map< int, int > > *cid_to_pid_fid)
void FindEssentialAndInliers(Eigen::Matrix2Xd const &keypoints1, Eigen::Matrix2Xd const &keypoints2, std::vector< cv::DMatch > const &matches, camera::CameraParameters const &camera_params, std::vector< cv::DMatch > *inlier_matches, std::vector< size_t > *vec_inliers, Eigen::Matrix3d *essential_matrix, const int ransac_iterations=4096)
Definition: tensor.cc:1937
void Triangulate(bool rm_invalid_xyz, double focal_length, 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, std::vector< std::map< int, int > > *cid_fid_to_pid)
Definition: tensor.cc:2184
std::array< std::pair< std::pair< int, int >, Eigen::Affine3d >, 3 > CIDAffineTuple
Definition: tensor.h:53
Eigen::Affine3d Affine3d(const Eigen::Matrix< double, 7, 1 > &affine_vector)
Definition: utilities.cc:43
void GenerateTupleListing(CIDPairAffineMap const &relative_affines, std::set< std::tuple< int, int, int > > *tuple_listing)
Definition: camera_params.h:31
void MergeMaps(sparse_mapping::SparseMap *A_in, sparse_mapping::SparseMap *B_in, int num_image_overlaps_at_endpoints, double outlier_factor, std::string const &output_map, sparse_mapping::SparseMap *C_out)
Definition: tensor.cc:1169
Definition: sparse_map.h:63