OpenCV
3.0.0
Open Source Computer Vision
|
#include "rgbd.hpp"
Public Types | |
enum | { ROTATION = 1, TRANSLATION = 2, RIGID_BODY_MOTION = 4 } |
Public Member Functions | |
bool | compute (const Mat &srcImage, const Mat &srcDepth, const Mat &srcMask, const Mat &dstImage, const Mat &dstDepth, const Mat &dstMask, Mat &Rt, const Mat &initRt=Mat()) const |
bool | compute (Ptr< OdometryFrame > &srcFrame, Ptr< OdometryFrame > &dstFrame, Mat &Rt, const Mat &initRt=Mat()) const |
virtual cv::Mat | getCameraMatrix () const =0 |
virtual int | getTransformType () const =0 |
virtual Size | prepareFrameCache (Ptr< OdometryFrame > &frame, int cacheType) const |
virtual void | setCameraMatrix (const cv::Mat &val)=0 |
virtual void | setTransformType (int val)=0 |
Public Member Functions inherited from cv::Algorithm | |
Algorithm () | |
virtual | ~Algorithm () |
virtual void | clear () |
Clears the algorithm state. More... | |
virtual bool | empty () const |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More... | |
virtual String | getDefaultName () const |
virtual void | read (const FileNode &fn) |
Reads algorithm parameters from a file storage. More... | |
virtual void | save (const String &filename) const |
virtual void | write (FileStorage &fs) const |
Stores algorithm parameters in a file storage. More... | |
Static Public Member Functions | |
static Ptr< Odometry > | create (const String &odometryType) |
static float | DEFAULT_MAX_DEPTH () |
static float | DEFAULT_MAX_DEPTH_DIFF () |
static float | DEFAULT_MAX_POINTS_PART () |
static float | DEFAULT_MAX_ROTATION () |
static float | DEFAULT_MAX_TRANSLATION () |
static float | DEFAULT_MIN_DEPTH () |
Static Public Member Functions inherited from cv::Algorithm | |
template<typename _Tp > | |
static Ptr< _Tp > | load (const String &filename, const String &objname=String()) |
Loads algorithm from the file. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
Loads algorithm from a String. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | read (const FileNode &fn) |
Reads algorithm from the file node. More... | |
Protected Member Functions | |
virtual void | checkParams () const =0 |
virtual bool | computeImpl (const Ptr< OdometryFrame > &srcFrame, const Ptr< OdometryFrame > &dstFrame, Mat &Rt, const Mat &initRt) const =0 |
Base class for computation of odometry.
|
protectedpure virtual |
Implemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.
bool cv::rgbd::Odometry::compute | ( | const Mat & | srcImage, |
const Mat & | srcDepth, | ||
const Mat & | srcMask, | ||
const Mat & | dstImage, | ||
const Mat & | dstDepth, | ||
const Mat & | dstMask, | ||
Mat & | Rt, | ||
const Mat & | initRt = Mat() |
||
) | const |
Method to compute a transformation from the source frame to the destination one. Some odometry algorithms do not used some data of frames (eg. ICP does not use images). In such case corresponding arguments can be set as empty Mat. The method returns true if all internal computions were possible (e.g. there were enough correspondences, system of equations has a solution, etc) and resulting transformation satisfies some test if it's provided by the Odometry inheritor implementation (e.g. thresholds for maximum translation and rotation).
srcImage | Image data of the source frame (CV_8UC1) |
srcDepth | Depth data of the source frame (CV_32FC1, in meters) |
srcMask | Mask that sets which pixels have to be used from the source frame (CV_8UC1) |
dstImage | Image data of the destination frame (CV_8UC1) |
dstDepth | Depth data of the destination frame (CV_32FC1, in meters) |
dstMask | Mask that sets which pixels have to be used from the destination frame (CV_8UC1) |
Rt | Resulting transformation from the source frame to the destination one (rigid body motion): dst_p = Rt * src_p, where dst_p is a homogeneous point in the destination frame and src_p is homogeneous point in the source frame, Rt is 4x4 matrix of CV_64FC1 type. |
initRt | Initial transformation from the source frame to the destination one (optional) |
bool cv::rgbd::Odometry::compute | ( | Ptr< OdometryFrame > & | srcFrame, |
Ptr< OdometryFrame > & | dstFrame, | ||
Mat & | Rt, | ||
const Mat & | initRt = Mat() |
||
) | const |
One more method to compute a transformation from the source frame to the destination one. It is designed to save on computing the frame data (image pyramids, normals, etc.).
|
protectedpure virtual |
Implemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
pure virtual |
Implemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.
|
pure virtual |
Implemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.
|
virtual |
Prepare a cache for the frame. The function checks the precomputed/passed data (throws the error if this data does not satisfy) and computes all remaining cache data needed for the frame. Returned size is a resolution of the prepared frame.
frame | The odometry which will process the frame. |
cacheType | The cache type: CACHE_SRC, CACHE_DST or CACHE_ALL. |
Reimplemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.
|
pure virtual |
Implemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.
|
pure virtual |
Implemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.