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
 
void initRectificationMap ()
 
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::string & name () 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

rtabmap::CameraModel::CameraModel ( )

Definition at line 40 of file CameraModel.cpp.

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.

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.

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.

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

Definition at line 82 of file CameraModel.h.

Member Function Documentation

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

Definition at line 104 of file CameraModel.h.

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

Definition at line 105 of file CameraModel.h.

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

Definition at line 111 of file CameraModel.h.

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

Definition at line 109 of file CameraModel.h.

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

Definition at line 502 of file CameraModel.cpp.

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

Definition at line 506 of file CameraModel.cpp.

double rtabmap::CameraModel::fovX ( ) const

Definition at line 643 of file CameraModel.cpp.

double rtabmap::CameraModel::fovY ( ) const

Definition at line 647 of file CameraModel.cpp.

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

Definition at line 102 of file CameraModel.h.

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

Definition at line 103 of file CameraModel.h.

double rtabmap::CameraModel::horizontalFOV ( ) const

Definition at line 652 of file CameraModel.cpp.

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

Definition at line 121 of file CameraModel.h.

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

Definition at line 119 of file CameraModel.h.

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

Definition at line 120 of file CameraModel.h.

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

Definition at line 763 of file CameraModel.cpp.

void rtabmap::CameraModel::initRectificationMap ( )

Definition at line 156 of file CameraModel.cpp.

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

Definition at line 85 of file CameraModel.h.

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

Definition at line 87 of file CameraModel.h.

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

Definition at line 89 of file CameraModel.h.

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

Definition at line 88 of file CameraModel.h.

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

Definition at line 110 of file CameraModel.h.

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

Definition at line 108 of file CameraModel.h.

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

Definition at line 214 of file CameraModel.cpp.

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

Definition at line 363 of file CameraModel.cpp.

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

Definition at line 116 of file CameraModel.h.

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

Definition at line 100 of file CameraModel.h.

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.

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

Definition at line 113 of file CameraModel.h.

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

Definition at line 733 of file CameraModel.cpp.

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

Definition at line 112 of file CameraModel.h.

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

Definition at line 679 of file CameraModel.cpp.

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

Definition at line 662 of file CameraModel.cpp.

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

Definition at line 748 of file CameraModel.cpp.

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

Definition at line 755 of file CameraModel.cpp.

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

Definition at line 613 of file CameraModel.cpp.

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

Definition at line 368 of file CameraModel.cpp.

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

Definition at line 576 of file CameraModel.cpp.

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

Definition at line 458 of file CameraModel.cpp.

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

Definition at line 188 of file CameraModel.cpp.

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

Definition at line 115 of file CameraModel.h.

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

Definition at line 99 of file CameraModel.h.

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

Definition at line 106 of file CameraModel.h.

double rtabmap::CameraModel::verticalFOV ( ) const

Definition at line 657 of file CameraModel.cpp.

Member Data Documentation

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

Definition at line 153 of file CameraModel.h.

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

Definition at line 151 of file CameraModel.h.

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

Definition at line 152 of file CameraModel.h.

Transform rtabmap::CameraModel::localTransform_
private

Definition at line 158 of file CameraModel.h.

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

Definition at line 156 of file CameraModel.h.

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

Definition at line 157 of file CameraModel.h.

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

Definition at line 150 of file CameraModel.h.

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

Definition at line 155 of file CameraModel.h.

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

Definition at line 154 of file CameraModel.h.


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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:37:08