Optimization of Visual Odometry System  1.2.0
CS133 Course Project
VO Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VO()

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.

Parameters
[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 ( )

~VO() The destuctor of class VO.

Definition at line 335 of file VO_tools.cpp.

Member Function Documentation

◆ add_points()

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.

Parameters
[in]POINT_1The inlier which waiting to push into inlier vector as the first frame.
[in]POINT_2The inlier which waiting to push into inlier vector as the second frame.
[in]maskThe indicator to determine whether the point should be added.
[in]all_inliers1The vector which contains all inliers of the first frame.
[in]all_inliers2The vector which contains all inliers of the second frame.
Returns
void

Definition at line 154 of file VO_tools.cpp.

Here is the caller graph for this function:

◆ get_K_()

Eigen::VectorXd VO::get_K_ ( )

get_K_() Get the K of the class.

Returns
The private parameter K

Definition at line 263 of file VO_tools.cpp.

◆ read_file_names()

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.

Returns
Return the number of file in this directory.

Definition at line 20 of file VO_tools.cpp.

◆ read_gt()

void VO::read_gt ( std::string  file_path)

read_gt() This function reads the ground truth from specific file.

Returns
void

Definition at line 268 of file VO_tools.cpp.

◆ SetK()

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.

Parameters
[in]focal_xThe position of focal on x-axis.
[in]focal_yThe position of focal on y-axis.
[in]principal_xThe position of camera center on x-axis.
[in]principal_yThe position of camera center on y-axis.
Return values
NULLvoid output

Definition at line 14 of file VO_tools.cpp.

◆ solve()

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.

Parameters
[in]store_trajectoryWhether we need to store the trajectory parameters into a specific file
[in]need_plotWhether we need to plot the result
[in]all_RThe vector which contains the rotation information between two step
[in]all_tThe vector which contains the translation information between two step
Return values
1Algorithm runs successfully
0Fails

Definition at line 48 of file VO_tools.cpp.

◆ solve_once()

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.

Parameters
[in]all_RThe vector which contains the rotation information between two step
[in]all_tThe vector which contains the translation information between two step
[in]pre_all_inliers1The vector which contains previous all inliers of the first frame.
[in]pre_all_inliers2The vector which contains previous all inliers of the second frame.
[in]all_2d_inliersThe inliers waiting to be stored.
[in]all_indexesThe mapping between all the matched frames.
[in]index_pointsTHe mapping between keypoint and its corresponing index.
[in]index_descriptorsThe mapping between the index and their corresponding feature descriptors.
[in]f2dThe SIFT feature extractor.
[in]indexThe index of the frame that will be process in the solve percedure.
[in]filesThe index of file.
Returns
void

Definition at line 175 of file VO_tools.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ data_path

string VO::data_path
private

The path we get data from.

Definition at line 40 of file VO_tools.hpp.

◆ K

Mat VO::K
private

The internal parameter matrix.

Definition at line 45 of file VO_tools.hpp.

◆ K_

Eigen::VectorXd VO::K_
private

The eigen form of internal parameter matrix k.

Definition at line 50 of file VO_tools.hpp.

◆ Ps

vector<Mat> VO::Ps
private

Definition at line 57 of file VO_tools.hpp.

◆ step_size

int VO::step_size
private

The step size for take critical frames.

Definition at line 30 of file VO_tools.hpp.

◆ store_path

string VO::store_path
private

The path to save the final result.

Definition at line 35 of file VO_tools.hpp.

◆ vector_of_files

vector<string> VO::vector_of_files
private

The parameter waiting to be used.

Definition at line 55 of file VO_tools.hpp.


The documentation for this class was generated from the following files: