![]() |
Optimization of Visual Odometry System
1.2.0
CS133 Course Project
|
The main structure for VO algorithm, which contains the parameters we will use in the VO algorithm. More...
#include <VO_tools.hpp>
Public Member Functions | |
VO (string data_path_="", string store_path_="", int step_size_=10) | |
~VO () | |
void | SetK (double focal_x, double focal_y, int principal_x, int principal_y) |
int | read_file_names () |
void | solve (std::vector< Eigen::Matrix3f > &all_R, std::vector< Eigen::Vector3f > &all_t, bool store_trajectory=false, bool need_plot=false) |
void | solve_once (std::vector< Eigen::Matrix3f > &all_R, std::vector< Eigen::Vector3f > &all_t, vector< Eigen::Vector2f > &pre_all_inliers1, vector< Eigen::Vector2f > &pre_all_inliers2, vector< std::vector< Eigen::Vector2f >> &all_2d_inliers, vector< std::map< int, int > > &all_indexes, map< int, vector< KeyPoint >> &index_points, map< int, Mat > &index_descriptors, Ptr< Feature2D > &f2d, int &index, int files) |
void | add_points (vector< Point2d > &POINT_1, vector< Point2d > &POINT_2, Eigen::VectorXi &mask, std::vector< Eigen::Vector2f > &all_inliers1, std::vector< Eigen::Vector2f > &all_inliers2) |
void | read_gt (std::string file_path) |
Eigen::VectorXd | get_K_ () |
Private Attributes | |
int | step_size |
The step size for take critical frames. More... | |
string | store_path |
The path to save the final result. More... | |
string | data_path |
The path we get data from. More... | |
Mat | K |
The internal parameter matrix. More... | |
Eigen::VectorXd | K_ |
The eigen form of internal parameter matrix k. More... | |
vector< string > | vector_of_files |
The parameter waiting to be used. More... | |
vector< Mat > | Ps |
The main structure for VO algorithm, which contains the parameters we will use in the VO algorithm.
Definition at line 24 of file VO_tools.hpp.
VO::VO | ( | string | data_path_ = "" , |
string | store_path_ = "" , |
||
int | step_size_ = 10 |
||
) |
VO() The constuctor of class VO. VO() Pass store_path_, data_path_, step_size_ to the corresponding private parameter.
[in] | store_path_ | The value to be pass to store_path |
[in] | data_path_ | The value to be pass to data_path |
[in] | step_size_ | The value to be pass to step_size |
Definition at line 8 of file VO_tools.cpp.
VO::~VO | ( | ) |
~VO() The destuctor of class VO.
Definition at line 335 of file VO_tools.cpp.
void VO::add_points | ( | vector< Point2d > & | POINT_1, |
vector< Point2d > & | POINT_2, | ||
Eigen::VectorXi & | mask, | ||
std::vector< Eigen::Vector2f > & | all_inliers1, | ||
std::vector< Eigen::Vector2f > & | all_inliers2 | ||
) |
add_points() Be used to add new point into corresponding inlier vectors.
[in] | POINT_1 | The inlier which waiting to push into inlier vector as the first frame. |
[in] | POINT_2 | The inlier which waiting to push into inlier vector as the second frame. |
[in] | mask | The indicator to determine whether the point should be added. |
[in] | all_inliers1 | The vector which contains all inliers of the first frame. |
[in] | all_inliers2 | The vector which contains all inliers of the second frame. |
Definition at line 154 of file VO_tools.cpp.
Eigen::VectorXd VO::get_K_ | ( | ) |
get_K_() Get the K of the class.
Definition at line 263 of file VO_tools.cpp.
int VO::read_file_names | ( | ) |
read_file_names() This function is used to extract the names of files in a specific directory. the internal parameter matrix k will need and send it to k.
Definition at line 20 of file VO_tools.cpp.
void VO::read_gt | ( | std::string | file_path | ) |
read_gt() This function reads the ground truth from specific file.
Definition at line 268 of file VO_tools.cpp.
void VO::SetK | ( | double | focal_x, |
double | focal_y, | ||
int | principal_x, | ||
int | principal_y | ||
) |
SetK() This function which is used to pass the parameters in to the internal parameter matrix.
[in] | focal_x | The position of focal on x-axis. |
[in] | focal_y | The position of focal on y-axis. |
[in] | principal_x | The position of camera center on x-axis. |
[in] | principal_y | The position of camera center on y-axis. |
NULL | void output |
Definition at line 14 of file VO_tools.cpp.
void VO::solve | ( | std::vector< Eigen::Matrix3f > & | all_R, |
std::vector< Eigen::Vector3f > & | all_t, | ||
bool | store_trajectory = false , |
||
bool | need_plot = false |
||
) |
solve() The main structure of VO algorithm.
[in] | store_trajectory | Whether we need to store the trajectory parameters into a specific file |
[in] | need_plot | Whether we need to plot the result |
[in] | all_R | The vector which contains the rotation information between two step |
[in] | all_t | The vector which contains the translation information between two step |
1 | Algorithm runs successfully |
0 | Fails |
Definition at line 48 of file VO_tools.cpp.
void VO::solve_once | ( | std::vector< Eigen::Matrix3f > & | all_R, |
std::vector< Eigen::Vector3f > & | all_t, | ||
vector< Eigen::Vector2f > & | pre_all_inliers1, | ||
vector< Eigen::Vector2f > & | pre_all_inliers2, | ||
vector< std::vector< Eigen::Vector2f >> & | all_2d_inliers, | ||
vector< std::map< int, int > > & | all_indexes, | ||
map< int, vector< KeyPoint >> & | index_points, | ||
map< int, Mat > & | index_descriptors, | ||
Ptr< Feature2D > & | f2d, | ||
int & | index, | ||
int | files | ||
) |
solve_once() Runs the vo algorithm once.
[in] | all_R | The vector which contains the rotation information between two step |
[in] | all_t | The vector which contains the translation information between two step |
[in] | pre_all_inliers1 | The vector which contains previous all inliers of the first frame. |
[in] | pre_all_inliers2 | The vector which contains previous all inliers of the second frame. |
[in] | all_2d_inliers | The inliers waiting to be stored. |
[in] | all_indexes | The mapping between all the matched frames. |
[in] | index_points | THe mapping between keypoint and its corresponing index. |
[in] | index_descriptors | The mapping between the index and their corresponding feature descriptors. |
[in] | f2d | The SIFT feature extractor. |
[in] | index | The index of the frame that will be process in the solve percedure. |
[in] | files | The index of file. |
Definition at line 175 of file VO_tools.cpp.
|
private |
The path we get data from.
Definition at line 40 of file VO_tools.hpp.
|
private |
The internal parameter matrix.
Definition at line 45 of file VO_tools.hpp.
|
private |
The eigen form of internal parameter matrix k.
Definition at line 50 of file VO_tools.hpp.
|
private |
Definition at line 57 of file VO_tools.hpp.
|
private |
The step size for take critical frames.
Definition at line 30 of file VO_tools.hpp.
|
private |
The path to save the final result.
Definition at line 35 of file VO_tools.hpp.
|
private |
The parameter waiting to be used.
Definition at line 55 of file VO_tools.hpp.