NASA Astrobee Robot Software
0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
|
Classes | |
class | BinaryDB |
struct | filename_ordering |
struct | FilterStats |
struct | LocalizationParameters |
class | ProtobufDatabase |
class | ProtobufVocabulary |
class | RandomSampleConsensus |
RANSAC Driver class. More... | |
struct | ReprojectionError |
struct | SparseMap |
struct | TransformError |
struct | TranslationRotationScaleFittingFunctor |
struct | VocabDB |
Typedefs | |
typedef 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 |
typedef std::array< std::pair< std::pair< int, int >, Eigen::Affine3d >, 3 > | CIDAffineTuple |
typedef std::vector< CIDAffineTuple, Eigen::aligned_allocator< CIDAffineTuple > > | CIDAffineTupleVec |
typedef ProtobufVocabulary< DBoW2::FBrief::TDescriptor, DBoW2::FBrief > | BinaryVocabulary |
typedef ProtobufDatabase< DBoW2::FBrief::TDescriptor, DBoW2::FBrief > | BriefDatabase |
Enumerations | |
enum | HistogramEqualizationType { kNone = 0, kEqualizeHist = 1, kUnknown = 2, kCLAHE = 3 } |
Functions | |
void | get_n_unique_integers (int min_val, int max_val, int num, std::mt19937 *generator, std::vector< int > *values) |
template<class ContainerT1 , class ContainerT2 , class FittingFuncT , class ErrorFuncT > | |
FittingFuncT::result_type | ransac (std::vector< ContainerT1 > const &p1, std::vector< ContainerT2 > const &p2, FittingFuncT const &fitting_func, ErrorFuncT const &error_func, int num_iterations, double inlier_threshold, int min_num_output_inliers, bool reduce_min_num_output_inliers_if_no_fit, bool increase_threshold_if_no_fit) |
ceres::LossFunction * | GetLossFunction (std::string cost_fun, double th) |
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 >()) |
void | BundleAdjustSmallSet (std::vector< Eigen::Matrix2Xd > const &features_n, double focal_length, std::vector< Eigen::Affine3d > *cam_t_global_n, Eigen::Matrix3Xd *pid_to_xyz, ceres::LossFunction *loss, ceres::Solver::Options const &options, ceres::Solver::Summary *summary) |
int | RandomInt (int min, int max) |
void | SelectRandomObservations (const std::vector< Eigen::Vector3d > &all_landmarks, const std::vector< Eigen::Vector2d > &all_observations, size_t num_selected, std::vector< cv::Point3d > *landmarks, std::vector< cv::Point2d > *observations) |
size_t | CountInliers (const std::vector< Eigen::Vector3d > &landmarks, const std::vector< Eigen::Vector2d > &observations, const camera::CameraModel &camera, int tolerance, std::vector< size_t > *inliers) |
void | EstimateCamera (camera::CameraModel *camera_estimate, std::vector< Eigen::Vector3d > *landmarks, const std::vector< Eigen::Vector2d > &observations, const ceres::Solver::Options &options, ceres::Solver::Summary *summary) |
int | RansacEstimateCamera (const std::vector< Eigen::Vector3d > &landmarks, const std::vector< Eigen::Vector2d > &observations, int num_tries, int inlier_tolerance, camera::CameraModel *camera_estimate, std::vector< Eigen::Vector3d > *inlier_landmarks_out=NULL, std::vector< Eigen::Vector2d > *inlier_observations_out=NULL, bool verbose=false) |
void | Find3DAffineTransform (Eigen::Matrix3Xd const &in, Eigen::Matrix3Xd const &out, Eigen::Affine3d *result) |
void | InitializeCidFidToPid (int num_cid, std::vector< std::map< int, int > > const &pid_to_cid_fid, std::vector< std::map< int, int > > *cid_fid_to_pid) |
Eigen::Quaternion< double > | slerp_n (std::vector< double > const &W, std::vector< Eigen::Quaternion< double > > const &Q) |
bool | IsBinaryDescriptor (std::string const &descriptor) |
bool | HistogramEqualizationCheck (int histogram_equalization1, int histogram_equalization2, bool fatal_failure=true) |
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) |
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) |
std::string | ImageToFeatureFile (std::string const &image_file, std::string const &detector_name) |
std::string | DBImagesFile (std::string const &db_name) |
std::string | MatchesFile (std::string const &map_file) |
std::string | EssentialFile (std::string const &map_file) |
void | WriteFeatures (std::string const &detector_name, std::vector< cv::KeyPoint > const &keypoints, cv::Mat const &descriptors, std::string const &output_filename) |
bool | ReadFeatures (std::string const &input_filename, std::string const &detector_name, std::vector< cv::KeyPoint > *keypoints, cv::Mat *descriptors) |
int | ReadFeaturesSIFT (std::string const &filename, cv::Mat *descriptors, std::vector< cv::KeyPoint > *keypoints) |
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) |
void | DecomposeFMatIntoEMat (Eigen::Matrix3d const &fundamental, Eigen::Matrix3d const &intrinsics, Eigen::Matrix3d *essential) |
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) |
std::string | CvMatTypeStr (cv::Mat const &Mat) |
void | ListToListMap (std::vector< std::string > const &big_list, std::vector< std::string > const &small_list, std::map< int, int > *map) |
void | MergePids (int repeat_index, int num_unique, std::vector< std::map< int, int > > *pid_to_cid_fid) |
void | PrintPidStats (std::vector< std::map< int, int > > const &pid_to_cid_fid) |
void | ParseHuginControlPoints (std::string const &hugin_file, std::vector< std::string > *images, Eigen::MatrixXd *points) |
void | ParseXYZ (std::string const &xyz_file, Eigen::MatrixXd *xyz) |
void | ParseCSV (std::string const &csv_file, std::map< std::string, std::vector< double > > *cols) |
bool | WriteProtobufTo (const google::protobuf::MessageLite &message, google::protobuf::io::ZeroCopyOutputStream *rawOutput) |
bool | WriteFileTo (const char *filename, google::protobuf::io::ZeroCopyOutputStream *rawOutput) |
bool | ReadProtobufFrom (google::protobuf::io::ZeroCopyInputStream *rawInput, google::protobuf::MessageLite *message) |
bool | ReadFileFrom (google::protobuf::io::ZeroCopyInputStream *rawInput, const char *filename) |
void | TransformCamerasAndPoints (Eigen::Affine3d const &A, std::vector< Eigen::Affine3d > *cid_to_cam_t, std::vector< Eigen::Vector3d > *xyz) |
double | GetErrThresh (const std::vector< double > &errors, double factor) |
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) |
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) |
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) |
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) |
void | MatchFeatures (const std::string &essential_file, const std::string &matches_file, sparse_mapping::SparseMap *s) |
void | BuildTracks (bool rm_invalid_xyz, const std::string &matches_file, sparse_mapping::SparseMap *s) |
void | IncrementalBA (std::string const &essential_file, sparse_mapping::SparseMap *s) |
void | CloseLoop (sparse_mapping::SparseMap *s) |
void | BundleAdjust (bool fix_all_cameras, sparse_mapping::SparseMap *map, std::set< int > const &fixed_cameras=std::set< int >()) |
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 >()) |
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) |
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) |
void | ExtractSubmap (std::vector< std::string > *keep_ptr, sparse_mapping::SparseMap *map_ptr) |
double | RegistrationOrVerification (std::vector< std::string > const &data_files, bool verification, sparse_mapping::SparseMap *s) |
void | WriteAffineCSV (CIDPairAffineMap const &relative_affines, std::string const &output_filename) |
void | WriteAffineCSV (CIDAffineTupleVec const &relative_affines, std::string const &output_filename) |
void | ReadAffineCSV (std::string const &input_filename, CIDPairAffineMap *relative_affines) |
void | ReadAffineCSV (std::string const &input_filename, CIDAffineTupleVec *relative_affines) |
void | PrintTrackStats (std::vector< std::map< int, int > >const &pid_to_cid_fid, std::string const &step) |
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) |
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) |
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 | GenerateTupleListing (CIDPairAffineMap const &relative_affines, std::set< std::tuple< int, int, int > > *tuple_listing) |
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) |
std::vector< cv::KeyPoint > | Keypoints (const Eigen::Matrix2Xd &keypoints_mat) |
std::vector< cv::KeyPoint > | DistortedKeypoints (const Eigen::Matrix2Xd &keypoints_mat, const camera::CameraParameters &camera_params) |
void | ViewMatches (const Eigen::Matrix2Xd &input_keypoints_mat, const Eigen::Matrix2Xd &map_keypoints_mat, const std::vector< cv::DMatch > &matches, const camera::CameraParameters &camera_params, const cv::Mat &input_image, const cv::Mat &map_image) |
void | DBSanityChecks (std::string const &db_type, std::string const &descriptor) |
void | BuildDB (std::string const &map_file, std::string const &descriptor, int depth, int branching_factor, int restarts) |
void | ResetDB (VocabDB *db) |
void | QueryDB (std::string const &descriptor, VocabDB *vocab_db, int num_similar, cv::Mat const &descriptors, std::vector< int > *indices, std::vector< double > *scores) |
void | BuildDBforDBoW2 (sparse_mapping::SparseMap *map, std::string const &descriptor, int depth, int branching_factor, int restarts) |
bool | P3P (const std::vector< cv::Point3d > &landmarks, const std::vector< cv::Point2d > &observations, const camera::CameraParameters ¶ms, Eigen::Vector3d *pos, Eigen::Matrix3d *rotation) |
std::string | print_vec (double a) |
std::string | print_vec (Eigen::Vector3d a) |
int | ReadMatches (std::string const &matches_file, openMVG::matching::PairWiseMatches *match_map) |
void | WriteMatches (openMVG::matching::PairWiseMatches const &match_map, std::string const &matches_file) |
void | BuildMapPerformMatching (openMVG::matching::PairWiseMatches *match_map, std::vector< Eigen::Matrix2Xd > const &cid_to_keypoint_map, std::vector< cv::Mat > const &cid_to_descriptor_map, camera::CameraParameters const &camera_params, CIDPairAffineMap *relative_affines, std::mutex *match_mutex, int i, int j, bool compute_rays_angle, double *rays_angle) |
double | estimateCloseDistance (std::vector< Eigen::Vector3d > const &vec) |
void | TransformTracks (std::map< int, int > const &cid2cid, bool rm_tracks_of_len_one, std::vector< std::map< int, int > > *pid_to_cid_fid) |
void | FindPidCorrespondences (std::vector< std::map< int, int > > const &A_cid_fid_to_pid, std::vector< std::map< int, int > > const &B_cid_fid_to_pid, std::vector< std::map< int, int > > const &C_pid_to_cid_fid, int num_acid, std::map< int, int > *A2B, std::map< int, int > *B2A) |
void | findMatchingTracks (sparse_mapping::SparseMap *A_in, sparse_mapping::SparseMap *B_in, sparse_mapping::SparseMap *C_out, std::string const &output_map, int num_image_overlaps_at_endpoints, std::map< int, int > &A2B, std::map< int, int > &B2A) |
void | findTracksForSharedImages (sparse_mapping::SparseMap *A_in, sparse_mapping::SparseMap *B_in, std::map< int, int > &A2B, std::map< int, int > &B2A) |
void | TransformMap (std::map< int, int > &cid2cid, sparse_mapping::SparseMap *C_out) |
template<class IterT > | |
void | WriteCIDPairAffineIterator (IterT it, IterT end, std::ofstream *file) |
template<class IterT > | |
void | ReadAffine (std::ifstream *file, IterT output_iter) |
template<class IterT > | |
void | PushBackCIDPairAffine (std::ifstream *file, IterT output_iter, IterT output_iter_end) |
template<class IterT > | |
void | PushBackCIDPairAffine (std::ifstream *file, IterT iter) |
void | MatDescrToVec (cv::Mat const &mat, std::vector< float > *vec) |
void | MatDescrToVec (cv::Mat const &mat, DBoW2::BriefDescriptor *brief) |
cv::Point2f | CvPoint2 (const Eigen::Vector2d &point) |
void | CreateSubdirectory (const std::string &directory, const std::string &subdirectory) |
boost::optional< vc::FeatureMatches > | Matches (const vc::FeatureImage ¤t_image, const vc::FeatureImage &next_image, vc::LKOpticalFlowFeatureDetectorAndMatcher &detector_and_matcher) |
Eigen::Affine3d | EstimateAffine3d (const vc::FeatureMatches &matches, const camera::CameraParameters &camera_params, std::vector< cv::DMatch > &inliers) |
vc::FeatureImage | LoadImage (const int index, const std::vector< std::string > &image_names, cv::Feature2D &detector) |
vc::LKOpticalFlowFeatureDetectorAndMatcherParams | LoadParams () |
bool | LowMovementImagePair (const vision_common::FeatureMatches &matches, const double max_low_movement_mean_distance) |
bool | LowMovementImagePair (const vc::FeatureImage ¤t_image, const vc::FeatureImage &next_image, const double max_low_movement_mean_distance, vc::LKOpticalFlowFeatureDetectorAndMatcher &detector_and_matcher) |
std::vector< std::string > | GetImageNames (const std::string &image_directory, const std::string &image_extension) |
typedef ProtobufVocabulary<DBoW2::FBrief::TDescriptor, DBoW2::FBrief> sparse_mapping::BinaryVocabulary |
typedef ProtobufDatabase<DBoW2::FBrief::TDescriptor, DBoW2::FBrief> sparse_mapping::BriefDatabase |
typedef std::array<std::pair<std::pair<int, int>, Eigen::Affine3d>, 3> sparse_mapping::CIDAffineTuple |
typedef std::vector<CIDAffineTuple, Eigen::aligned_allocator<CIDAffineTuple> > sparse_mapping::CIDAffineTupleVec |
typedef 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> > > sparse_mapping::CIDPairAffineMap |
void sparse_mapping::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 | ||
) |
Append map file.
void sparse_mapping::BuildDB | ( | std::string const & | map_file, |
std::string const & | descriptor, | ||
int | depth, | ||
int | branching_factor, | ||
int | restarts | ||
) |
void sparse_mapping::BuildDBforDBoW2 | ( | sparse_mapping::SparseMap * | map, |
std::string const & | descriptor, | ||
int | depth, | ||
int | branching_factor, | ||
int | restarts | ||
) |
void sparse_mapping::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 | ||
) |
void sparse_mapping::BuildMapPerformMatching | ( | openMVG::matching::PairWiseMatches * | match_map, |
std::vector< Eigen::Matrix2Xd > const & | cid_to_keypoint_map, | ||
std::vector< cv::Mat > const & | cid_to_descriptor_map, | ||
camera::CameraParameters const & | camera_params, | ||
CIDPairAffineMap * | relative_affines, | ||
std::mutex * | match_mutex, | ||
int | i, | ||
int | j, | ||
bool | compute_rays_angle, | ||
double * | rays_angle | ||
) |
void sparse_mapping::BuildTracks | ( | bool | rm_invalid_xyz, |
const std::string & | matches_file, | ||
sparse_mapping::SparseMap * | s | ||
) |
Build the tracks based on the matches
void sparse_mapping::BundleAdjust | ( | bool | fix_all_cameras, |
sparse_mapping::SparseMap * | map, | ||
std::set< int > const & | fixed_cameras = std::set<int>() |
||
) |
Improve the map with bundle adjustment. Vary only the cameras between given indices.
void sparse_mapping::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>() |
||
) |
Perform bundle adjustment.
cid_to_cam_t_global is the camera transforms focal_length is the focal_length pid_to_xyz are landmark locations All should be set to initial guesses and are modified to improved guesses when the function returns.
pid_to_cid_fid is maps from landmark id to camera id and feature id cid_to_keypoint_map gives a list of observations for each camera Ceres loss function and options can be specified, and summary returns results from ceres. Optimize only the cameras with indices in [first, last].
void sparse_mapping::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>() |
||
) |
void sparse_mapping::BundleAdjustSmallSet | ( | std::vector< Eigen::Matrix2Xd > const & | features_n, |
double | focal_length, | ||
std::vector< Eigen::Affine3d > * | cam_t_global_n, | ||
Eigen::Matrix3Xd * | pid_to_xyz, | ||
ceres::LossFunction * | loss, | ||
ceres::Solver::Options const & | options, | ||
ceres::Solver::Summary * | summary | ||
) |
Perform bundle adjustment.
This variant assumes that all cameras see that same points. This is meant to be used to do 2 or 3 camera refinements however it can do N cameras just fine.
void sparse_mapping::CloseLoop | ( | sparse_mapping::SparseMap * | s | ) |
Close a loop with repeated images.
double sparse_mapping::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 | ||
) |
size_t sparse_mapping::CountInliers | ( | const std::vector< Eigen::Vector3d > & | landmarks, |
const std::vector< Eigen::Vector2d > & | observations, | ||
const camera::CameraModel & | camera, | ||
int | tolerance, | ||
std::vector< size_t > * | inliers | ||
) |
void sparse_mapping::CreateSubdirectory | ( | const std::string & | directory, |
const std::string & | subdirectory | ||
) |
std::string sparse_mapping::CvMatTypeStr | ( | cv::Mat const & | Mat | ) |
cv::Point2f sparse_mapping::CvPoint2 | ( | const Eigen::Vector2d & | point | ) |
std::string sparse_mapping::DBImagesFile | ( | std::string const & | db_name | ) |
void sparse_mapping::DBSanityChecks | ( | std::string const & | db_type, |
std::string const & | descriptor | ||
) |
void sparse_mapping::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 | ||
) |
void sparse_mapping::DecomposeFMatIntoEMat | ( | Eigen::Matrix3d const & | fundamental, |
Eigen::Matrix3d const & | intrinsics, | ||
Eigen::Matrix3d * | essential | ||
) |
std::vector< cv::KeyPoint > sparse_mapping::DistortedKeypoints | ( | const Eigen::Matrix2Xd & | keypoints_mat, |
const camera::CameraParameters & | camera_params | ||
) |
std::string sparse_mapping::EssentialFile | ( | std::string const & | map_file | ) |
Eigen::Affine3d sparse_mapping::EstimateAffine3d | ( | const vc::FeatureMatches & | matches, |
const camera::CameraParameters & | camera_params, | ||
std::vector< cv::DMatch > & | inliers | ||
) |
void sparse_mapping::EstimateCamera | ( | camera::CameraModel * | camera_estimate, |
std::vector< Eigen::Vector3d > * | landmarks, | ||
const std::vector< Eigen::Vector2d > & | observations, | ||
const ceres::Solver::Options & | options, | ||
ceres::Solver::Summary * | summary | ||
) |
Estimate the camera matrix, with translation and rotation, that maps the points in landmarks to the image coordinates observed in observations. This uses a least squares solver and the initial estimate must be in the neighborhood of the true position for it to converge.
After the function is called, camera_estimate is updated to contain the results, and summary summarizes them.
double sparse_mapping::estimateCloseDistance | ( | std::vector< Eigen::Vector3d > const & | vec | ) |
void sparse_mapping::ExtractSubmap | ( | std::vector< std::string > * | keep_ptr, |
sparse_mapping::SparseMap * | map_ptr | ||
) |
Take a map. Form a map with only a subset of the images. Bundle adjustment will happen later.
void sparse_mapping::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 |
||
) |
void sparse_mapping::Find3DAffineTransform | ( | Eigen::Matrix3Xd const & | in, |
Eigen::Matrix3Xd const & | out, | ||
Eigen::Affine3d * | result | ||
) |
void sparse_mapping::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 |
||
) |
void sparse_mapping::findMatchingTracks | ( | sparse_mapping::SparseMap * | A_in, |
sparse_mapping::SparseMap * | B_in, | ||
sparse_mapping::SparseMap * | C_out, | ||
std::string const & | output_map, | ||
int | num_image_overlaps_at_endpoints, | ||
std::map< int, int > & | A2B, | ||
std::map< int, int > & | B2A | ||
) |
void sparse_mapping::FindPidCorrespondences | ( | std::vector< std::map< int, int > > const & | A_cid_fid_to_pid, |
std::vector< std::map< int, int > > const & | B_cid_fid_to_pid, | ||
std::vector< std::map< int, int > > const & | C_pid_to_cid_fid, | ||
int | num_acid, | ||
std::map< int, int > * | A2B, | ||
std::map< int, int > * | B2A | ||
) |
void sparse_mapping::findTracksForSharedImages | ( | sparse_mapping::SparseMap * | A_in, |
sparse_mapping::SparseMap * | B_in, | ||
std::map< int, int > & | A2B, | ||
std::map< int, int > & | B2A | ||
) |
void sparse_mapping::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 sparse_mapping::GenerateTupleListing | ( | CIDPairAffineMap const & | relative_affines, |
std::set< std::tuple< int, int, int > > * | tuple_listing | ||
) |
void sparse_mapping::get_n_unique_integers | ( | int | min_val, |
int | max_val, | ||
int | num, | ||
std::mt19937 * | generator, | ||
std::vector< int > * | values | ||
) |
double sparse_mapping::GetErrThresh | ( | const std::vector< double > & | errors, |
double | factor | ||
) |
std::vector< std::string > sparse_mapping::GetImageNames | ( | const std::string & | image_directory, |
const std::string & | image_extension | ||
) |
ceres::LossFunction * sparse_mapping::GetLossFunction | ( | std::string | cost_fun, |
double | th | ||
) |
bool sparse_mapping::HistogramEqualizationCheck | ( | int | histogram_equalization1, |
int | histogram_equalization2, | ||
bool | fatal_failure = true |
||
) |
std::string sparse_mapping::ImageToFeatureFile | ( | std::string const & | image_file, |
std::string const & | detector_name | ||
) |
void sparse_mapping::IncrementalBA | ( | std::string const & | essential_file, |
sparse_mapping::SparseMap * | s | ||
) |
Incremental bundle adjustment.
void sparse_mapping::InitializeCidFidToPid | ( | int | num_cid, |
std::vector< std::map< int, int > > const & | pid_to_cid_fid, | ||
std::vector< std::map< int, int > > * | cid_fid_to_pid | ||
) |
bool sparse_mapping::IsBinaryDescriptor | ( | std::string const & | descriptor | ) |
std::vector< cv::KeyPoint > sparse_mapping::Keypoints | ( | const Eigen::Matrix2Xd & | keypoints_mat | ) |
void sparse_mapping::ListToListMap | ( | std::vector< std::string > const & | big_list, |
std::vector< std::string > const & | small_list, | ||
std::map< int, int > * | map | ||
) |
vision_common::FeatureImage sparse_mapping::LoadImage | ( | const int | index, |
const std::vector< std::string > & | image_names, | ||
cv::Feature2D & | detector | ||
) |
vision_common::LKOpticalFlowFeatureDetectorAndMatcherParams sparse_mapping::LoadParams | ( | ) |
bool sparse_mapping::LowMovementImagePair | ( | const vc::FeatureImage & | current_image, |
const vc::FeatureImage & | next_image, | ||
const double | max_low_movement_mean_distance, | ||
vc::LKOpticalFlowFeatureDetectorAndMatcher & | detector_and_matcher | ||
) |
bool sparse_mapping::LowMovementImagePair | ( | const vision_common::FeatureMatches & | matches, |
const double | max_low_movement_mean_distance | ||
) |
boost::optional< vision_common::FeatureMatches > sparse_mapping::Matches | ( | const vc::FeatureImage & | current_image, |
const vc::FeatureImage & | next_image, | ||
vc::LKOpticalFlowFeatureDetectorAndMatcher & | detector_and_matcher | ||
) |
std::string sparse_mapping::MatchesFile | ( | std::string const & | map_file | ) |
void sparse_mapping::MatchFeatures | ( | const std::string & | essential_file, |
const std::string & | matches_file, | ||
sparse_mapping::SparseMap * | s | ||
) |
Create the initial map by feature matching and essential affine computation.
void sparse_mapping::MatDescrToVec | ( | cv::Mat const & | mat, |
DBoW2::BriefDescriptor * | brief | ||
) |
void sparse_mapping::MatDescrToVec | ( | cv::Mat const & | mat, |
std::vector< float > * | vec | ||
) |
void sparse_mapping::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 | ||
) |
Merge two maps.
void sparse_mapping::MergePids | ( | int | repeat_index, |
int | num_unique, | ||
std::vector< std::map< int, int > > * | pid_to_cid_fid | ||
) |
bool sparse_mapping::P3P | ( | const std::vector< cv::Point3d > & | landmarks, |
const std::vector< cv::Point2d > & | observations, | ||
const camera::CameraParameters & | params, | ||
Eigen::Vector3d * | pos, | ||
Eigen::Matrix3d * | rotation | ||
) |
void sparse_mapping::ParseCSV | ( | std::string const & | csv_file, |
std::map< std::string, std::vector< double > > * | cols | ||
) |
void sparse_mapping::ParseHuginControlPoints | ( | std::string const & | hugin_file, |
std::vector< std::string > * | images, | ||
Eigen::MatrixXd * | points | ||
) |
void sparse_mapping::ParseXYZ | ( | std::string const & | xyz_file, |
Eigen::MatrixXd * | xyz | ||
) |
void sparse_mapping::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 | ||
) |
std::string sparse_mapping::print_vec | ( | double | a | ) |
std::string sparse_mapping::print_vec | ( | Eigen::Vector3d | a | ) |
void sparse_mapping::PrintPidStats | ( | std::vector< std::map< int, int > > const & | pid_to_cid_fid | ) |
void sparse_mapping::PrintTrackStats | ( | std::vector< std::map< int, int > >const & | pid_to_cid_fid, |
std::string const & | step | ||
) |
void sparse_mapping::PushBackCIDPairAffine | ( | std::ifstream * | file, |
IterT | iter | ||
) |
void sparse_mapping::PushBackCIDPairAffine | ( | std::ifstream * | file, |
IterT | output_iter, | ||
IterT | output_iter_end | ||
) |
void sparse_mapping::QueryDB | ( | std::string const & | descriptor, |
VocabDB * | vocab_db, | ||
int | num_similar, | ||
cv::Mat const & | descriptors, | ||
std::vector< int > * | indices, | ||
std::vector< double > * | scores | ||
) |
int sparse_mapping::RandomInt | ( | int | min, |
int | max | ||
) |
FittingFuncT::result_type sparse_mapping::ransac | ( | std::vector< ContainerT1 > const & | p1, |
std::vector< ContainerT2 > const & | p2, | ||
FittingFuncT const & | fitting_func, | ||
ErrorFuncT const & | error_func, | ||
int | num_iterations, | ||
double | inlier_threshold, | ||
int | min_num_output_inliers, | ||
bool | reduce_min_num_output_inliers_if_no_fit, | ||
bool | increase_threshold_if_no_fit | ||
) |
int sparse_mapping::RansacEstimateCamera | ( | const std::vector< Eigen::Vector3d > & | landmarks, |
const std::vector< Eigen::Vector2d > & | observations, | ||
int | num_tries, | ||
int | inlier_tolerance, | ||
camera::CameraModel * | camera_estimate, | ||
std::vector< Eigen::Vector3d > * | inlier_landmarks_out = NULL , |
||
std::vector< Eigen::Vector2d > * | inlier_observations_out = NULL , |
||
bool | verbose = false |
||
) |
Estimate the camera matrix, with translation and rotation, that maps the points in landmarks to the image coordinates observed in observations. This uses ransac with a three point perspective algorithm, and does not use an initial guess for the camera pose.
After the function is called, camera_estimate is updated to contain the results.
Returns zero on success, nonzero on failure.
void sparse_mapping::ReadAffine | ( | std::ifstream * | file, |
IterT | output_iter | ||
) |
void sparse_mapping::ReadAffineCSV | ( | std::string const & | input_filename, |
CIDAffineTupleVec * | relative_affines | ||
) |
void sparse_mapping::ReadAffineCSV | ( | std::string const & | input_filename, |
CIDPairAffineMap * | relative_affines | ||
) |
bool sparse_mapping::ReadFeatures | ( | std::string const & | input_filename, |
std::string const & | detector_name, | ||
std::vector< cv::KeyPoint > * | keypoints, | ||
cv::Mat * | descriptors | ||
) |
int sparse_mapping::ReadFeaturesSIFT | ( | std::string const & | filename, |
cv::Mat * | descriptors, | ||
std::vector< cv::KeyPoint > * | keypoints | ||
) |
bool sparse_mapping::ReadFileFrom | ( | google::protobuf::io::ZeroCopyInputStream * | rawInput, |
const char * | filename | ||
) |
int sparse_mapping::ReadMatches | ( | std::string const & | matches_file, |
openMVG::matching::PairWiseMatches * | match_map | ||
) |
void sparse_mapping::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 | ||
) |
bool sparse_mapping::ReadProtobufFrom | ( | google::protobuf::io::ZeroCopyInputStream * | rawInput, |
google::protobuf::MessageLite * | message | ||
) |
double sparse_mapping::RegistrationOrVerification | ( | std::vector< std::string > const & | data_files, |
bool | verification, | ||
sparse_mapping::SparseMap * | s | ||
) |
Register the map to the world coordinate system or verify how well registration did.
void sparse_mapping::ResetDB | ( | VocabDB * | db | ) |
void sparse_mapping::SelectRandomObservations | ( | const std::vector< Eigen::Vector3d > & | all_landmarks, |
const std::vector< Eigen::Vector2d > & | all_observations, | ||
size_t | num_selected, | ||
std::vector< cv::Point3d > * | landmarks, | ||
std::vector< cv::Point2d > * | observations | ||
) |
Eigen::Quaternion< double > sparse_mapping::slerp_n | ( | std::vector< double > const & | W, |
std::vector< Eigen::Quaternion< double > > const & | Q | ||
) |
void sparse_mapping::TransformCamerasAndPoints | ( | Eigen::Affine3d const & | A, |
std::vector< Eigen::Affine3d > * | cid_to_cam_t, | ||
std::vector< Eigen::Vector3d > * | xyz | ||
) |
void sparse_mapping::TransformMap | ( | std::map< int, int > & | cid2cid, |
sparse_mapping::SparseMap * | C_out | ||
) |
void sparse_mapping::TransformTracks | ( | std::map< int, int > const & | cid2cid, |
bool | rm_tracks_of_len_one, | ||
std::vector< std::map< int, int > > * | pid_to_cid_fid | ||
) |
void sparse_mapping::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 | ||
) |
Eigen::Vector3d sparse_mapping::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 | ||
) |
void sparse_mapping::ViewMatches | ( | const Eigen::Matrix2Xd & | input_keypoints_mat, |
const Eigen::Matrix2Xd & | map_keypoints_mat, | ||
const std::vector< cv::DMatch > & | matches, | ||
const camera::CameraParameters & | camera_params, | ||
const cv::Mat & | input_image, | ||
const cv::Mat & | map_image | ||
) |
void sparse_mapping::WriteAffineCSV | ( | CIDAffineTupleVec const & | relative_affines, |
std::string const & | output_filename | ||
) |
void sparse_mapping::WriteAffineCSV | ( | CIDPairAffineMap const & | relative_affines, |
std::string const & | output_filename | ||
) |
bool sparse_mapping::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 | ||
) |
void sparse_mapping::WriteCIDPairAffineIterator | ( | IterT | it, |
IterT | end, | ||
std::ofstream * | file | ||
) |
void sparse_mapping::WriteFeatures | ( | std::string const & | detector_name, |
std::vector< cv::KeyPoint > const & | keypoints, | ||
cv::Mat const & | descriptors, | ||
std::string const & | output_filename | ||
) |
bool sparse_mapping::WriteFileTo | ( | const char * | filename, |
google::protobuf::io::ZeroCopyOutputStream * | rawOutput | ||
) |
void sparse_mapping::WriteMatches | ( | openMVG::matching::PairWiseMatches const & | match_map, |
std::string const & | matches_file | ||
) |
void sparse_mapping::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 | ||
) |
bool sparse_mapping::WriteProtobufTo | ( | const google::protobuf::MessageLite & | message, |
google::protobuf::io::ZeroCopyOutputStream * | rawOutput | ||
) |