EasyMVS
simple 3D reconstruction framework
|
Classes | |
class | RelatedFrameInfo |
the related frame info class, related frame can be defined as the frames that have common field of views. which store Interframe information such as pose between two frames, prior believe of the pose, and the matched keypoints between frames. More... | |
Public Types | |
using | Ptr = std::shared_ptr< FrameObject > |
Public Types inherited from DataFlowObject | |
using | Ptr = std::shared_ptr< DataFlowObject > |
the shared pointer type of DataFlowObject | |
Public Member Functions | |
FrameObject () | |
Construct a new Frame Object object. | |
FrameObject (int ID, uint32_t Timestamp=0) | |
Construct a new Frame Object object. More... | |
virtual | ~FrameObject () |
Destroy the Frame Object object. | |
int | getID () |
Get the Frame ID. More... | |
uint32_t | getTimestamp () |
Get the timestamp. More... | |
bool | setTimestamp (uint32_t time) |
set the timestamp. More... | |
bool | setBestFrame (RelatedFrameInfo::Ptr FramePtr) |
set the best frame, the best camera pair is the camera that will be used during dual camera dense reconstruction. the best frame should be set after pose reconstruction in mono camera scenario, or be set when the frame is generated in dual camera or RGBD camera scenario. More... | |
RelatedFrameInfo::Ptr | getBestFrame () |
get the best frame. More... | |
bool | addRelatedFrame (RelatedFrameInfo::Ptr FramePtr) |
add relate frame, the related frame is the frame with common field of view, it may because the two frames have matched feature points, or because the two frames are created from an dual cameras, or RGBD camera. More... | |
bool | removeRelatedFrame (int FrameID) |
remove the related camera frame, the related camera frame is the frame which has the common filed of view with current frame. More... | |
bool | removeAllRelatedFrames () |
remove all of the related camera frame of current frame. More... | |
bool | updateRelatedFrame (RelatedFrameInfo::Ptr FramePtr) |
update related frame. More... | |
RelatedFrameInfo::Ptr | getRelatedFrame (int FrameID) |
Get the Related Frame object. More... | |
bool | getAllRelatedFrames (std::set< RelatedFrameInfo::Ptr > &Frames) |
Get all the Related Frames object. More... | |
bool | getAllRelatedFrames (std::set< int > &FrameID) |
get all the related frame id. More... | |
int | hasRelatedFrame () |
bool | addMapPoint (int KeyPointID, std::shared_ptr< MapPointObject > MapPoint, const Eigen::Vector4d &LocalCoordinate) |
add frame observed map point More... | |
bool | removeMapPoint (int KeyPointID) |
remove map point from frame More... | |
bool | removeAllMapPoints () |
remove all map points More... | |
bool | getMapPoint (int KeyPointID, std::shared_ptr< MapPointObject > &MapPoint, Eigen::Vector4d &LocalCoordinate) |
Get the Map Point object. More... | |
bool | getMapPoint (int KeyPointID, int &MappointID, Eigen::Vector4d &LocalCoordinate) |
get mappoint id related to keypoint. More... | |
std::shared_ptr< MapPointObject > | getMapPoint (int KeyPointID) |
Get the Map Point object. | |
bool | hasMappoint (int KeyPointID) |
bool | getAllMappointID (std::set< int > &KeyPointID) |
get all keypoint id related to mappoint. More... | |
bool | updateMapPoint (int KeyPointID, std::shared_ptr< MapPointObject > MapPoint, const Eigen::Vector4d &LocalCoordinate) |
update the map point More... | |
virtual bool | load (JsonNode &fs) override |
load data and settings from file More... | |
virtual bool | save (JsonNode &fs) override |
save data and settings to file More... | |
virtual std::string | type_name () override |
get the typename. More... | |
Sophus::SE3d | getGlobalPose () |
void | setGlobalPose (Sophus::SE3d &pose) |
Sophus::SE3d & | GlobalPose () |
bool | isGlobalPoseKnown () |
Public Member Functions inherited from DataFlowObject | |
DataFlowObject () | |
Construct a new Data Flow Object object. | |
virtual | ~DataFlowObject () |
Destroy the Data Flow Object object. | |
Public Member Functions inherited from MVSObject | |
MVSObject () | |
Construct a new MVSObject object. | |
virtual | ~MVSObject () |
Destroy the MVSObject object. | |
virtual bool | save (JsonNode &fs)=0 |
save data and settings to file More... | |
virtual bool | load (JsonNode &fs)=0 |
load data and settings from file More... | |
virtual std::string | type_name () |
get the typename. More... | |
Static Public Member Functions | |
static Ptr | Create (int ID, int MapID, const cv::Mat &RGBMat, uint32_t Timestamp=0, const cv::Mat &XYZMat=cv::Mat()) |
Create FrameObject object. More... | |
static Ptr | Create (int ID, int MapID, uint32_t Timestamp=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Static Public Member Functions inherited from DataFlowObject | |
static void | cvMat2Sophus (const cv::Mat1d &Mat, Sophus::SE3d &Pose) |
create shared pointer of DataFlowObject, do NOT use this method directly, use the Create() method in derived class. More... | |
static void | Sophus2cvMat (const Sophus::SE3d &pose, cv::Mat1d &Mat) |
static cv::Mat1d | Rt2T (const cv::Mat1d &R, const cv::Mat1d &t) |
static std::tuple< cv::Mat1d, cv::Mat1d > | T2Rt (const cv::Mat1d &T) |
Protected Types | |
using | MapPointInfo = std::tuple< std::weak_ptr< MapPointObject >, Eigen::Vector4d, int > |
Protected Attributes | |
int | FrameID |
uint32_t | Timestamp |
RelatedFrameInfo::Ptr | BestCamera |
pointer of the related frame, the pose of related frame, the pose confidence of related frame (-1 means invalid) | |
std::map< int, RelatedFrameInfo::Ptr > | RelatedFrame |
int is the frame ID, the second is the related frame pointer. the related frame pose might inaccurate once the global pose is found. | |
std::map< int, MapPointInfo > | ObservedMapPoints |
bool | KnownPose = false |
Friends | |
std::ostream & | operator<< (std::ostream &os, FrameObject &frame) |
Additional Inherited Members | |
Protected Member Functions inherited from MVSObject | |
bool | isDirExist (std::string path) |
check if the directory is exist. More... | |
bool | mkdir (std::string path) |
create directory in given path. More... | |
FrameObject::FrameObject | ( | int | ID, |
uint32_t | Timestamp = 0 |
||
) |
Construct a new Frame Object object.
ID | unique frame ID |
bool FrameObject::addMapPoint | ( | int | KeyPointID, |
std::shared_ptr< MapPointObject > | MapPoint, | ||
const Eigen::Vector4d & | LocalCoordinate | ||
) |
add frame observed map point
KeyPointID | map point related key point ID |
MapPoint | Pointer of map point |
LocalCoordinate | map point coordinate in the current camera frame |
bool FrameObject::addRelatedFrame | ( | RelatedFrameInfo::Ptr | FramePtr | ) |
add relate frame, the related frame is the frame with common field of view, it may because the two frames have matched feature points, or because the two frames are created from an dual cameras, or RGBD camera.
FramePtr | the shared pointer of related frame. |
|
static |
Create FrameObject object.
ID | Unique frame ID |
the | map ID, which is assigned by GlobalMap |
RGBMat | the undistorted RGB image. |
XYZMap | the XYZ map or depth map, the RGBD camera may already compute the original depth map when frame is created. |
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
ID |
bool FrameObject::getAllMappointID | ( | std::set< int > & | KeyPointID | ) |
get all keypoint id related to mappoint.
KeyPointID | output set of keypoint ID. |
bool FrameObject::getAllRelatedFrames | ( | std::set< int > & | FrameID | ) |
get all the related frame id.
FrameID |
bool FrameObject::getAllRelatedFrames | ( | std::set< RelatedFrameInfo::Ptr > & | Frames | ) |
Get all the Related Frames object.
Frames | array of the shared pointer of the frame |
FrameObject::RelatedFrameInfo::Ptr FrameObject::getBestFrame | ( | ) |
get the best frame.
int FrameObject::getID | ( | ) |
Get the Frame ID.
bool FrameObject::getMapPoint | ( | int | KeyPointID, |
int & | MappointID, | ||
Eigen::Vector4d & | LocalCoordinate | ||
) |
get mappoint id related to keypoint.
KeyPointID |
bool FrameObject::getMapPoint | ( | int | KeyPointID, |
std::shared_ptr< MapPointObject > & | MapPoint, | ||
Eigen::Vector4d & | LocalCoordinate | ||
) |
Get the Map Point object.
KeyPointID | input key point ID |
MapPoint | output map point pointer |
LocalCoordinate | output map point coordinate in local frame |
FrameObject::RelatedFrameInfo::Ptr FrameObject::getRelatedFrame | ( | int | FrameID | ) |
Get the Related Frame object.
FrameID | frame ID |
uint32_t FrameObject::getTimestamp | ( | ) |
Get the timestamp.
|
overridevirtual |
load data and settings from file
this method will load data such as keypoints, descriptors, translation matrices in DataFlowObject and its sub-classes from the given JsonNode instance. or will load parameters and settings in WorkFlowObject and its sub-classes to the given JsonNode instance, and automatically initialize the WorkFlow with these parameters
fs | the json handler |
Implements MVSObject.
Reimplemented in PinholeFrameObject.
bool FrameObject::removeAllMapPoints | ( | ) |
remove all map points
bool FrameObject::removeAllRelatedFrames | ( | ) |
remove all of the related camera frame of current frame.
bool FrameObject::removeMapPoint | ( | int | KeyPointID | ) |
remove map point from frame
KeyPointID | the map point related keypoint ID |
bool FrameObject::removeRelatedFrame | ( | int | FrameID | ) |
remove the related camera frame, the related camera frame is the frame which has the common filed of view with current frame.
FrameID | the ID of the frame to be removed |
|
overridevirtual |
save data and settings to file
this method will save data such as keypoints, descriptors, translation matrices in DataFlowObject and its sub-classes to the given JsonNode instance, or will save parameters and settings in WorkFlowObject and its sub-classes to the given JsonNode instance.
fs | the json handler |
Implements MVSObject.
Reimplemented in PinholeFrameObject.
bool FrameObject::setBestFrame | ( | RelatedFrameInfo::Ptr | FramePtr | ) |
set the best frame, the best camera pair is the camera that will be used during dual camera dense reconstruction. the best frame should be set after pose reconstruction in mono camera scenario, or be set when the frame is generated in dual camera or RGBD camera scenario.
the | shared pointer of best frame. |
bool FrameObject::setTimestamp | ( | uint32_t | time | ) |
set the timestamp.
time | the new timestamp |
|
overridevirtual |
bool FrameObject::updateMapPoint | ( | int | KeyPointID, |
std::shared_ptr< MapPointObject > | MapPoint, | ||
const Eigen::Vector4d & | LocalCoordinate | ||
) |
update the map point
KeyPointID | input key point ID |
MapPoint | input map point pointer |
LocalCoordinate | input mappoint coordinate |
bool FrameObject::updateRelatedFrame | ( | RelatedFrameInfo::Ptr | FramePtr | ) |
update related frame.
FramePtr |