SaDVIO
Public Member Functions | Public Attributes | List of all members
isae::Mesh3D Class Reference

A class to build and update a 3D mesh from 2D features and landmarks. More...

#include <mesh.h>

Public Member Functions

 Mesh3D ()=default
 
 Mesh3D (double ZNCC_tsh, double max_length_tsh)
 
 ~Mesh3D ()=default
 
std::vector< std::shared_ptr< Polygon > > getPolygonVector () const
 
std::vector< Eigen::Vector3d > getPointCloud () const
 
std::shared_ptr< FramegetFrame () const
 
std::unordered_map< std::shared_ptr< ALandmark >, std::shared_ptr< Vertex > > getMap ()
 
void updateMesh (std::vector< FeatPolygon > feats_polygon, std::shared_ptr< Frame > frame)
 Update the 3D mesh with a 2D Mesh of features for a given frame. More...
 
bool checkTriangle (std::vector< std::shared_ptr< Vertex >> vertices)
 Check if a triangle is valid. (i.e. no accute angles or too long edges) More...
 
bool checkPolygon (std::shared_ptr< Polygon > polygon)
 Photometric check of a polygon using ZNCC on a patch on the barycenter of the polygon. More...
 
bool checkPolygonArea (std::shared_ptr< Polygon > polygon, double area2d)
 EXPERIMENTAL Photometric check of a polygon using ZNCC on a patch on the barycenter of the polygon of a given 2D area. More...
 
bool checkPolygonTri (std::shared_ptr< Polygon > polygon3d, FeatPolygon polygon2d)
 EXPERIMENTAL Photometric check of a polygon using ZNCC on a patch with the full 2D polygon in it. More...
 
void removePolygon (std::shared_ptr< Polygon > polygon)
 
void analysePolygon (std::shared_ptr< Polygon > polygon)
 Compute the barycenter and the normal of a polygon. More...
 
void filterMesh ()
 Remove polygon outliers from the 3D mesh. More...
 
void projectMesh ()
 Project the mesh on camera 0 of the current frame for raycasting. More...
 
void generatePointCloud ()
 Generate a point cloud from the mesh with raycasting. More...
 

Public Attributes

std::mutex _mesh_mtx
 
std::mutex _pc_mtx
 

Detailed Description

A class to build and update a 3D mesh from 2D features and landmarks.

It saves all the usefull variables of the current frame used to build / update the mesh. The Mesh data structure is pretty naive for now: it is a vector of polygons where each polygon is a vector of vertices. There is room for improvement here. Moreover, it contains all the methods to filter the mesh and to perform raycasting on it.

Constructor & Destructor Documentation

◆ Mesh3D() [1/2]

isae::Mesh3D::Mesh3D ( )
default

◆ Mesh3D() [2/2]

isae::Mesh3D::Mesh3D ( double  ZNCC_tsh,
double  max_length_tsh 
)
inline

◆ ~Mesh3D()

isae::Mesh3D::~Mesh3D ( )
default

Member Function Documentation

◆ analysePolygon()

void isae::Mesh3D::analysePolygon ( std::shared_ptr< Polygon polygon)

Compute the barycenter and the normal of a polygon.

◆ checkPolygon()

bool isae::Mesh3D::checkPolygon ( std::shared_ptr< Polygon polygon)

Photometric check of a polygon using ZNCC on a patch on the barycenter of the polygon.

◆ checkPolygonArea()

bool isae::Mesh3D::checkPolygonArea ( std::shared_ptr< Polygon polygon,
double  area2d 
)

EXPERIMENTAL Photometric check of a polygon using ZNCC on a patch on the barycenter of the polygon of a given 2D area.

◆ checkPolygonTri()

bool isae::Mesh3D::checkPolygonTri ( std::shared_ptr< Polygon polygon3d,
FeatPolygon  polygon2d 
)

EXPERIMENTAL Photometric check of a polygon using ZNCC on a patch with the full 2D polygon in it.

◆ checkTriangle()

bool isae::Mesh3D::checkTriangle ( std::vector< std::shared_ptr< Vertex >>  vertices)

Check if a triangle is valid. (i.e. no accute angles or too long edges)

◆ filterMesh()

void isae::Mesh3D::filterMesh ( )

Remove polygon outliers from the 3D mesh.

◆ generatePointCloud()

void isae::Mesh3D::generatePointCloud ( )

Generate a point cloud from the mesh with raycasting.

◆ getFrame()

std::shared_ptr<Frame> isae::Mesh3D::getFrame ( ) const
inline

◆ getMap()

std::unordered_map<std::shared_ptr<ALandmark>, std::shared_ptr<Vertex> > isae::Mesh3D::getMap ( )
inline

◆ getPointCloud()

std::vector<Eigen::Vector3d> isae::Mesh3D::getPointCloud ( ) const
inline

◆ getPolygonVector()

std::vector<std::shared_ptr<Polygon> > isae::Mesh3D::getPolygonVector ( ) const
inline

◆ projectMesh()

void isae::Mesh3D::projectMesh ( )

Project the mesh on camera 0 of the current frame for raycasting.

◆ removePolygon()

void isae::Mesh3D::removePolygon ( std::shared_ptr< Polygon polygon)
inline

◆ updateMesh()

void isae::Mesh3D::updateMesh ( std::vector< FeatPolygon feats_polygon,
std::shared_ptr< Frame frame 
)

Update the 3D mesh with a 2D Mesh of features for a given frame.

Parameters
feats_polygonA vector of features to build the mesh.
frameA shared pointer to the frame containing the features.

Member Data Documentation

◆ _mesh_mtx

std::mutex isae::Mesh3D::_mesh_mtx
mutable

◆ _pc_mtx

std::mutex isae::Mesh3D::_pc_mtx
mutable

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