Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
rtabmap::CameraModel Class Reference

#include <CameraModel.h>

Public Member Functions

 CameraModel ()
 
 CameraModel (const std::string &name, const cv::Size &imageSize, const cv::Mat &K, const cv::Mat &D, const cv::Mat &R, const cv::Mat &P, const Transform &localTransform=opticalRotation())
 
 CameraModel (double fx, double fy, double cx, double cy, const Transform &localTransform=opticalRotation(), double Tx=0.0f, const cv::Size &imageSize=cv::Size(0, 0))
 
 CameraModel (const std::string &name, double fx, double fy, double cx, double cy, const Transform &localTransform=opticalRotation(), double Tx=0.0f, const cv::Size &imageSize=cv::Size(0, 0))
 
double cx () const
 
double cy () const
 
cv::Mat D () const
 
cv::Mat D_raw () const
 
unsigned int deserialize (const std::vector< unsigned char > &data)
 
unsigned int deserialize (const unsigned char *data, unsigned int dataSize)
 
double fovX () const
 
double fovY () const
 
double fx () const
 
double fy () const
 
double horizontalFOV () const
 
int imageHeight () const
 
const cv::Size & imageSize () const
 
int imageWidth () const
 
bool inFrame (int u, int v) const
 
bool initRectificationMap ()
 
bool isFisheye () const
 
bool isRectificationMapInitialized () const
 
bool isValidForProjection () const
 
bool isValidForRectification () const
 
bool isValidForReprojection () const
 
cv::Mat K () const
 
cv::Mat K_raw () const
 
bool load (const std::string &filePath)
 
bool load (const std::string &directory, const std::string &cameraName)
 
const TransformlocalTransform () const
 
const std::stringname () const
 
cv::Mat P () const
 
void project (float u, float v, float depth, float &x, float &y, float &z) const
 
cv::Mat R () const
 
cv::Mat rectifyDepth (const cv::Mat &raw) const
 
cv::Mat rectifyImage (const cv::Mat &raw, int interpolation=cv::INTER_LINEAR) const
 
void reproject (float x, float y, float z, float &u, float &v) const
 
void reproject (float x, float y, float z, int &u, int &v) const
 
CameraModel roi (const cv::Rect &roi) const
 
bool save (const std::string &directory) const
 
CameraModel scaled (double scale) const
 
std::vector< unsigned char > serialize () const
 
void setImageSize (const cv::Size &size)
 
void setLocalTransform (const Transform &transform)
 
void setName (const std::string &name)
 
double Tx () const
 
double verticalFOV () const
 
virtual ~CameraModel ()
 

Static Public Member Functions

static Transform opticalRotation ()
 

Private Attributes

cv::Mat D_
 
cv::Size imageSize_
 
cv::Mat K_
 
Transform localTransform_
 
cv::Mat mapX_
 
cv::Mat mapY_
 
std::string name_
 
cv::Mat P_
 
cv::Mat R_
 

Detailed Description

Definition at line 38 of file CameraModel.h.

Constructor & Destructor Documentation

◆ CameraModel() [1/4]

rtabmap::CameraModel::CameraModel ( )

Definition at line 40 of file CameraModel.cpp.

◆ CameraModel() [2/4]

rtabmap::CameraModel::CameraModel ( const std::string name,
const cv::Size &  imageSize,
const cv::Mat &  K,
const cv::Mat &  D,
const cv::Mat &  R,
const cv::Mat &  P,
const Transform localTransform = opticalRotation() 
)

Definition at line 46 of file CameraModel.cpp.

◆ CameraModel() [3/4]

rtabmap::CameraModel::CameraModel ( double  fx,
double  fy,
double  cx,
double  cy,
const Transform localTransform = opticalRotation(),
double  Tx = 0.0f,
const cv::Size &  imageSize = cv::Size(0,0) 
)

Definition at line 68 of file CameraModel.cpp.

◆ CameraModel() [4/4]

rtabmap::CameraModel::CameraModel ( const std::string name,
double  fx,
double  fy,
double  cx,
double  cy,
const Transform localTransform = opticalRotation(),
double  Tx = 0.0f,
const cv::Size &  imageSize = cv::Size(0,0) 
)

Definition at line 111 of file CameraModel.cpp.

◆ ~CameraModel()

virtual rtabmap::CameraModel::~CameraModel ( )
inlinevirtual

Definition at line 82 of file CameraModel.h.

Member Function Documentation

◆ cx()

double rtabmap::CameraModel::cx ( ) const
inline

Definition at line 104 of file CameraModel.h.

◆ cy()

double rtabmap::CameraModel::cy ( ) const
inline

Definition at line 105 of file CameraModel.h.

◆ D()

cv::Mat rtabmap::CameraModel::D ( ) const
inline

Definition at line 111 of file CameraModel.h.

◆ D_raw()

cv::Mat rtabmap::CameraModel::D_raw ( ) const
inline

Definition at line 109 of file CameraModel.h.

◆ deserialize() [1/2]

unsigned int rtabmap::CameraModel::deserialize ( const std::vector< unsigned char > &  data)

Definition at line 535 of file CameraModel.cpp.

◆ deserialize() [2/2]

unsigned int rtabmap::CameraModel::deserialize ( const unsigned char *  data,
unsigned int  dataSize 
)

Definition at line 539 of file CameraModel.cpp.

◆ fovX()

double rtabmap::CameraModel::fovX ( ) const

Definition at line 676 of file CameraModel.cpp.

◆ fovY()

double rtabmap::CameraModel::fovY ( ) const

Definition at line 680 of file CameraModel.cpp.

◆ fx()

double rtabmap::CameraModel::fx ( ) const
inline

Definition at line 102 of file CameraModel.h.

◆ fy()

double rtabmap::CameraModel::fy ( ) const
inline

Definition at line 103 of file CameraModel.h.

◆ horizontalFOV()

double rtabmap::CameraModel::horizontalFOV ( ) const

Definition at line 685 of file CameraModel.cpp.

◆ imageHeight()

int rtabmap::CameraModel::imageHeight ( ) const
inline

Definition at line 121 of file CameraModel.h.

◆ imageSize()

const cv::Size& rtabmap::CameraModel::imageSize ( ) const
inline

Definition at line 119 of file CameraModel.h.

◆ imageWidth()

int rtabmap::CameraModel::imageWidth ( ) const
inline

Definition at line 120 of file CameraModel.h.

◆ inFrame()

bool rtabmap::CameraModel::inFrame ( int  u,
int  v 
) const

Definition at line 796 of file CameraModel.cpp.

◆ initRectificationMap()

bool rtabmap::CameraModel::initRectificationMap ( )

Definition at line 156 of file CameraModel.cpp.

◆ isFisheye()

bool rtabmap::CameraModel::isFisheye ( ) const
inline

Definition at line 127 of file CameraModel.h.

◆ isRectificationMapInitialized()

bool rtabmap::CameraModel::isRectificationMapInitialized ( ) const
inline

Definition at line 85 of file CameraModel.h.

◆ isValidForProjection()

bool rtabmap::CameraModel::isValidForProjection ( ) const
inline

Definition at line 87 of file CameraModel.h.

◆ isValidForRectification()

bool rtabmap::CameraModel::isValidForRectification ( ) const
inline

Definition at line 89 of file CameraModel.h.

◆ isValidForReprojection()

bool rtabmap::CameraModel::isValidForReprojection ( ) const
inline

Definition at line 88 of file CameraModel.h.

◆ K()

cv::Mat rtabmap::CameraModel::K ( ) const
inline

Definition at line 110 of file CameraModel.h.

◆ K_raw()

cv::Mat rtabmap::CameraModel::K_raw ( ) const
inline

Definition at line 108 of file CameraModel.h.

◆ load() [1/2]

bool rtabmap::CameraModel::load ( const std::string filePath)

Definition at line 215 of file CameraModel.cpp.

◆ load() [2/2]

bool rtabmap::CameraModel::load ( const std::string directory,
const std::string cameraName 
)

Definition at line 383 of file CameraModel.cpp.

◆ localTransform()

const Transform& rtabmap::CameraModel::localTransform ( ) const
inline

Definition at line 116 of file CameraModel.h.

◆ name()

const std::string& rtabmap::CameraModel::name ( ) const
inline

Definition at line 100 of file CameraModel.h.

◆ opticalRotation()

static Transform rtabmap::CameraModel::opticalRotation ( )
inlinestatic

Optical rotation used to transform image coordinate frame (x->right, y->down, z->forward) to robot coordinate frame (x->forward, y->left, z->up).

Definition at line 45 of file CameraModel.h.

◆ P()

cv::Mat rtabmap::CameraModel::P ( ) const
inline

Definition at line 113 of file CameraModel.h.

◆ project()

void rtabmap::CameraModel::project ( float  u,
float  v,
float  depth,
float &  x,
float &  y,
float &  z 
) const

Definition at line 766 of file CameraModel.cpp.

◆ R()

cv::Mat rtabmap::CameraModel::R ( ) const
inline

Definition at line 112 of file CameraModel.h.

◆ rectifyDepth()

cv::Mat rtabmap::CameraModel::rectifyDepth ( const cv::Mat &  raw) const

Definition at line 712 of file CameraModel.cpp.

◆ rectifyImage()

cv::Mat rtabmap::CameraModel::rectifyImage ( const cv::Mat &  raw,
int  interpolation = cv::INTER_LINEAR 
) const

Definition at line 695 of file CameraModel.cpp.

◆ reproject() [1/2]

void rtabmap::CameraModel::reproject ( float  x,
float  y,
float  z,
float &  u,
float &  v 
) const

Definition at line 781 of file CameraModel.cpp.

◆ reproject() [2/2]

void rtabmap::CameraModel::reproject ( float  x,
float  y,
float  z,
int &  u,
int &  v 
) const

Definition at line 788 of file CameraModel.cpp.

◆ roi()

CameraModel rtabmap::CameraModel::roi ( const cv::Rect &  roi) const

Definition at line 646 of file CameraModel.cpp.

◆ save()

bool rtabmap::CameraModel::save ( const std::string directory) const

Definition at line 388 of file CameraModel.cpp.

◆ scaled()

CameraModel rtabmap::CameraModel::scaled ( double  scale) const

Definition at line 609 of file CameraModel.cpp.

◆ serialize()

std::vector< unsigned char > rtabmap::CameraModel::serialize ( ) const

Definition at line 491 of file CameraModel.cpp.

◆ setImageSize()

void rtabmap::CameraModel::setImageSize ( const cv::Size &  size)

Definition at line 189 of file CameraModel.cpp.

◆ setLocalTransform()

void rtabmap::CameraModel::setLocalTransform ( const Transform transform)
inline

Definition at line 115 of file CameraModel.h.

◆ setName()

void rtabmap::CameraModel::setName ( const std::string name)
inline

Definition at line 99 of file CameraModel.h.

◆ Tx()

double rtabmap::CameraModel::Tx ( ) const
inline

Definition at line 106 of file CameraModel.h.

◆ verticalFOV()

double rtabmap::CameraModel::verticalFOV ( ) const

Definition at line 690 of file CameraModel.cpp.

Member Data Documentation

◆ D_

cv::Mat rtabmap::CameraModel::D_
private

Definition at line 154 of file CameraModel.h.

◆ imageSize_

cv::Size rtabmap::CameraModel::imageSize_
private

Definition at line 152 of file CameraModel.h.

◆ K_

cv::Mat rtabmap::CameraModel::K_
private

Definition at line 153 of file CameraModel.h.

◆ localTransform_

Transform rtabmap::CameraModel::localTransform_
private

Definition at line 159 of file CameraModel.h.

◆ mapX_

cv::Mat rtabmap::CameraModel::mapX_
private

Definition at line 157 of file CameraModel.h.

◆ mapY_

cv::Mat rtabmap::CameraModel::mapY_
private

Definition at line 158 of file CameraModel.h.

◆ name_

std::string rtabmap::CameraModel::name_
private

Definition at line 151 of file CameraModel.h.

◆ P_

cv::Mat rtabmap::CameraModel::P_
private

Definition at line 156 of file CameraModel.h.

◆ R_

cv::Mat rtabmap::CameraModel::R_
private

Definition at line 155 of file CameraModel.h.


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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:39:00