SaDVIO
mesher.h
Go to the documentation of this file.
1 #ifndef MESHER_H
2 #define MESHER_H
3 
4 #include <opencv2/core.hpp>
5 #include <opencv2/imgproc.hpp>
6 #include <queue>
7 #include <thread>
8 
12 #include "utilities/timer.h"
13 
14 namespace isae {
15 
21 class Mesher {
22 
23  public:
24  Mesher(std::string slam_mode, double ZNCC_tsh, double max_length_tsh);
25 
27  std::vector<FeatPolygon> createMesh2D(std::shared_ptr<ImageSensor> sensor);
28 
30  std::vector<cv::Vec6f> computeMesh2D(const cv::Size img_size, const std::vector<cv::Point2f> p2f_to_triangulate);
31 
33  void addNewKF(std::shared_ptr<Frame> frame);
34  bool getNewKf();
35 
37  void run();
38 
39  std::queue<std::shared_ptr<Frame>> _kf_queue;
40  std::shared_ptr<Frame> _curr_kf;
41  std::shared_ptr<Mesh3D> _mesh_3d;
42  std::string _slam_mode;
43  double _avg_mesh_t;
44  int _n_kf;
45 
46  mutable std::mutex _mesher_mtx;
47 };
48 
49 } // namespace isae
50 
51 #endif // MESHER_H
isae::Mesher::computeMesh2D
std::vector< cv::Vec6f > computeMesh2D(const cv::Size img_size, const std::vector< cv::Point2f > p2f_to_triangulate)
Compute the Delaunnay triangulation of a set of openCV points in an image.
Definition: mesher.cpp:99
isae::Mesher::run
void run()
The thread function.
Definition: mesher.cpp:71
isae::Mesher::_slam_mode
std::string _slam_mode
The SLAM mode (e.g., "nofov", "bimono", etc.)
Definition: mesher.h:42
isae::Mesher::getNewKf
bool getNewKf()
Definition: mesher.cpp:56
isae::Mesher::createMesh2D
std::vector< FeatPolygon > createMesh2D(std::shared_ptr< ImageSensor > sensor)
Create a 2D mesh for a given image sensor.
Definition: mesher.cpp:134
timer.h
isae::Mesher::_kf_queue
std::queue< std::shared_ptr< Frame > > _kf_queue
The queue of keyframes to process.
Definition: mesher.h:39
aFeatureDetector.h
mesh.h
isae
Definition: AFeature2D.h:8
isae::Mesher::_mesher_mtx
std::mutex _mesher_mtx
Definition: mesher.h:46
isae::Mesher::_n_kf
int _n_kf
Number of keyframes processed for profiling.
Definition: mesher.h:44
isae::Mesher::_avg_mesh_t
double _avg_mesh_t
Average time taken to process a mesh update for profiling.
Definition: mesher.h:43
isae::Mesher::_mesh_3d
std::shared_ptr< Mesh3D > _mesh_3d
The 3D mesh object.
Definition: mesher.h:41
isae::Mesher::_curr_kf
std::shared_ptr< Frame > _curr_kf
The current keyframe being processed.
Definition: mesher.h:40
isae::Mesher::Mesher
Mesher(std::string slam_mode, double ZNCC_tsh, double max_length_tsh)
Definition: mesher.cpp:33
ASensor.h
isae::Mesher
A class to handles 3D meshing via 2D triangulation on successive KFs.
Definition: mesher.h:21
isae::Mesher::addNewKF
void addNewKF(std::shared_ptr< Frame > frame)
add a new KF in the queue (for the thread)
Definition: mesher.cpp:51