OpenCV  3.1.0
Open Source Computer Vision
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
cv::rgbd::Odometry Class Referenceabstract

#include "rgbd.hpp"

Inheritance diagram for cv::rgbd::Odometry:
cv::Algorithm cv::rgbd::ICPOdometry cv::rgbd::RgbdICPOdometry cv::rgbd::RgbdOdometry

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< Odometrycreate (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
 

Detailed Description

Base class for computation of odometry.

Member Function Documentation

virtual void cv::rgbd::Odometry::checkParams ( ) const
protectedpure virtual
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).

Parameters
srcImageImage data of the source frame (CV_8UC1)
srcDepthDepth data of the source frame (CV_32FC1, in meters)
srcMaskMask that sets which pixels have to be used from the source frame (CV_8UC1)
dstImageImage data of the destination frame (CV_8UC1)
dstDepthDepth data of the destination frame (CV_32FC1, in meters)
dstMaskMask that sets which pixels have to be used from the destination frame (CV_8UC1)
RtResulting 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.
initRtInitial 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.).

virtual bool cv::rgbd::Odometry::computeImpl ( const Ptr< OdometryFrame > &  srcFrame,
const Ptr< OdometryFrame > &  dstFrame,
Mat Rt,
const Mat initRt 
) const
protectedpure virtual
static Ptr<Odometry> cv::rgbd::Odometry::create ( const String odometryType)
static
static float cv::rgbd::Odometry::DEFAULT_MAX_DEPTH ( )
inlinestatic
static float cv::rgbd::Odometry::DEFAULT_MAX_DEPTH_DIFF ( )
inlinestatic
static float cv::rgbd::Odometry::DEFAULT_MAX_POINTS_PART ( )
inlinestatic
static float cv::rgbd::Odometry::DEFAULT_MAX_ROTATION ( )
inlinestatic
static float cv::rgbd::Odometry::DEFAULT_MAX_TRANSLATION ( )
inlinestatic
static float cv::rgbd::Odometry::DEFAULT_MIN_DEPTH ( )
inlinestatic
virtual cv::Mat cv::rgbd::Odometry::getCameraMatrix ( ) const
pure virtual
virtual int cv::rgbd::Odometry::getTransformType ( ) const
pure virtual
virtual Size cv::rgbd::Odometry::prepareFrameCache ( Ptr< OdometryFrame > &  frame,
int  cacheType 
) const
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.

Parameters
frameThe odometry which will process the frame.
cacheTypeThe cache type: CACHE_SRC, CACHE_DST or CACHE_ALL.

Reimplemented in cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.

virtual void cv::rgbd::Odometry::setCameraMatrix ( const cv::Mat val)
pure virtual
virtual void cv::rgbd::Odometry::setTransformType ( int  val)
pure virtual

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