OpenCV  4.7.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 <opencv2/rgbd/depth.hpp>

Inheritance diagram for cv::rgbd::Odometry:
cv::Algorithm cv::rgbd::FastICPOdometry 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, OutputArray Rt, const Mat &initRt=Mat()) const
 
bool compute (Ptr< OdometryFrame > &srcFrame, Ptr< OdometryFrame > &dstFrame, OutputArray 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...
 
void write (FileStorage &fs, const String &name) const
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 

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, OutputArray Rt, const Mat &initRt) const =0
 
- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 

Detailed Description

Base class for computation of odometry.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

A class of transformation

Enumerator
ROTATION 
TRANSLATION 
RIGID_BODY_MOTION 

Member Function Documentation

◆ checkParams()

virtual void cv::rgbd::Odometry::checkParams ( ) const
protectedpure virtual

◆ compute() [1/2]

bool cv::rgbd::Odometry::compute ( const Mat srcImage,
const Mat srcDepth,
const Mat srcMask,
const Mat dstImage,
const Mat dstDepth,
const Mat dstMask,
OutputArray  Rt,
const Mat initRt = Mat() 
) const
Python:
cv.rgbd.Odometry.compute(srcImage, srcDepth, srcMask, dstImage, dstDepth, dstMask[, Rt[, initRt]]) -> retval, Rt
cv.rgbd.Odometry.compute2(srcFrame, dstFrame[, Rt[, initRt]]) -> retval, Rt

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 computations 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)

◆ compute() [2/2]

bool cv::rgbd::Odometry::compute ( Ptr< OdometryFrame > &  srcFrame,
Ptr< OdometryFrame > &  dstFrame,
OutputArray  Rt,
const Mat initRt = Mat() 
) const
Python:
cv.rgbd.Odometry.compute(srcImage, srcDepth, srcMask, dstImage, dstDepth, dstMask[, Rt[, initRt]]) -> retval, Rt
cv.rgbd.Odometry.compute2(srcFrame, dstFrame[, Rt[, initRt]]) -> retval, Rt

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.).

◆ computeImpl()

virtual bool cv::rgbd::Odometry::computeImpl ( const Ptr< OdometryFrame > &  srcFrame,
const Ptr< OdometryFrame > &  dstFrame,
OutputArray  Rt,
const Mat initRt 
) const
protectedpure virtual

◆ create()

static Ptr<Odometry> cv::rgbd::Odometry::create ( const String odometryType)
static
Python:
cv.rgbd.Odometry.create(odometryType) -> retval
cv.rgbd.Odometry_create(odometryType) -> retval

◆ DEFAULT_MAX_DEPTH()

static float cv::rgbd::Odometry::DEFAULT_MAX_DEPTH ( )
inlinestatic
Python:
cv.rgbd.Odometry.DEFAULT_MAX_DEPTH() -> retval

◆ DEFAULT_MAX_DEPTH_DIFF()

static float cv::rgbd::Odometry::DEFAULT_MAX_DEPTH_DIFF ( )
inlinestatic
Python:
cv.rgbd.Odometry.DEFAULT_MAX_DEPTH_DIFF() -> retval

◆ DEFAULT_MAX_POINTS_PART()

static float cv::rgbd::Odometry::DEFAULT_MAX_POINTS_PART ( )
inlinestatic
Python:
cv.rgbd.Odometry.DEFAULT_MAX_POINTS_PART() -> retval

◆ DEFAULT_MAX_ROTATION()

static float cv::rgbd::Odometry::DEFAULT_MAX_ROTATION ( )
inlinestatic
Python:
cv.rgbd.Odometry.DEFAULT_MAX_ROTATION() -> retval

◆ DEFAULT_MAX_TRANSLATION()

static float cv::rgbd::Odometry::DEFAULT_MAX_TRANSLATION ( )
inlinestatic
Python:
cv.rgbd.Odometry.DEFAULT_MAX_TRANSLATION() -> retval

◆ DEFAULT_MIN_DEPTH()

static float cv::rgbd::Odometry::DEFAULT_MIN_DEPTH ( )
inlinestatic
Python:
cv.rgbd.Odometry.DEFAULT_MIN_DEPTH() -> retval

◆ getCameraMatrix()

virtual cv::Mat cv::rgbd::Odometry::getCameraMatrix ( ) const
pure virtual
Python:
cv.rgbd.Odometry.getCameraMatrix() -> retval

◆ getTransformType()

virtual int cv::rgbd::Odometry::getTransformType ( ) const
pure virtual
Python:
cv.rgbd.Odometry.getTransformType() -> retval

◆ prepareFrameCache()

virtual Size cv::rgbd::Odometry::prepareFrameCache ( Ptr< OdometryFrame > &  frame,
int  cacheType 
) const
virtual
Python:
cv.rgbd.Odometry.prepareFrameCache(frame, cacheType) -> retval

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::FastICPOdometry, cv::rgbd::RgbdICPOdometry, cv::rgbd::ICPOdometry, and cv::rgbd::RgbdOdometry.

◆ setCameraMatrix()

virtual void cv::rgbd::Odometry::setCameraMatrix ( const cv::Mat val)
pure virtual
Python:
cv.rgbd.Odometry.setCameraMatrix(val) -> None

◆ setTransformType()

virtual void cv::rgbd::Odometry::setTransformType ( int  val)
pure virtual
Python:
cv.rgbd.Odometry.setTransformType(val) -> None

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