Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | Friends | List of all members
aruco::CameraParameters Class Reference

Parameters of the camera. More...

#include <cameraparameters.h>

Public Member Functions

 CameraParameters ()
 
 CameraParameters (const CameraParameters &CI)
 
 CameraParameters (cv::Mat cameraMatrix, cv::Mat distorsionCoeff, cv::Size size)
 
void clear ()
 
void glGetProjectionMatrix (cv::Size orgImgSize, cv::Size size, double proj_matrix[16], double gnear, double gfar, bool invert=false)
 
bool isValid () const
 
void OgreGetProjectionMatrix (cv::Size orgImgSize, cv::Size size, double proj_matrix[16], double gnear, double gfar, bool invert=false)
 
CameraParametersoperator= (const CameraParameters &CI)
 
void readFromXMLFile (std::string filePath)
 
void resize (cv::Size size)
 
void saveToFile (std::string path, bool inXML=true)
 
void setParams (cv::Mat cameraMatrix, cv::Mat distorsionCoeff, cv::Size size)
 

Static Public Member Functions

static cv::Point3f getCameraLocation (const cv::Mat &Rvec, const cv::Mat &Tvec)
 
static cv::Mat getRTMatrix (const cv::Mat &R_, const cv::Mat &T_, int forceType)
 

Public Attributes

cv::Mat CameraMatrix
 
cv::Size CamSize
 
cv::Mat Distorsion
 
cv::Mat ExtrinsicMatrix
 

Static Private Member Functions

static void argConvGLcpara2 (double cparam[3][4], int width, int height, double gnear, double gfar, double m[16], bool invert)
 
static int arParamDecompMat (double source[3][4], double cpara[3][4], double trans[3][4])
 
static double dot (double a1, double a2, double a3, double b1, double b2, double b3)
 
static double norm (double a, double b, double c)
 

Friends

ARUCO_EXPORT friend std::ostream & operator<< (std::ostream &str, const CameraParameters &cp)
 
ARUCO_EXPORT friend std::istream & operator>> (std::istream &str, CameraParameters &cp)
 

Detailed Description

Parameters of the camera.

Definition at line 29 of file cameraparameters.h.

Constructor & Destructor Documentation

◆ CameraParameters() [1/3]

aruco::CameraParameters::CameraParameters ( )

Empty constructor

Definition at line 27 of file cameraparameters.cpp.

◆ CameraParameters() [2/3]

aruco::CameraParameters::CameraParameters ( cv::Mat  cameraMatrix,
cv::Mat  distorsionCoeff,
cv::Size  size 
)

Creates the object from the info passed

Parameters
cameraMatrix3x3 matrix (fx 0 cx, 0 fy cy, 0 0 1)
distorsionCoeff4x1 matrix (k1,k2,p1,p2)
sizeimage size

Definition at line 39 of file cameraparameters.cpp.

◆ CameraParameters() [3/3]

aruco::CameraParameters::CameraParameters ( const CameraParameters CI)

Copy constructor

Definition at line 45 of file cameraparameters.cpp.

Member Function Documentation

◆ argConvGLcpara2()

void aruco::CameraParameters::argConvGLcpara2 ( double  cparam[3][4],
int  width,
int  height,
double  gnear,
double  gfar,
double  m[16],
bool  invert 
)
staticprivate

Definition at line 295 of file cameraparameters.cpp.

◆ arParamDecompMat()

int aruco::CameraParameters::arParamDecompMat ( double  source[3][4],
double  cpara[3][4],
double  trans[3][4] 
)
staticprivate

Definition at line 361 of file cameraparameters.cpp.

◆ clear()

void aruco::CameraParameters::clear ( )

Makes this invalid

Definition at line 63 of file cameraparameters.cpp.

◆ dot()

double aruco::CameraParameters::dot ( double  a1,
double  a2,
double  a3,
double  b1,
double  b2,
double  b3 
)
staticprivate

Definition at line 285 of file cameraparameters.cpp.

◆ getCameraLocation()

cv::Point3f aruco::CameraParameters::getCameraLocation ( const cv::Mat &  Rvec,
const cv::Mat &  Tvec 
)
static

Returns the location of the camera in the reference system of the marker.

Rvec and Tvec are the transform from the marker to the camera as calculated in other parts of the library NOT TESTED

Definition at line 106 of file cameraparameters.cpp.

◆ getRTMatrix()

cv::Mat aruco::CameraParameters::getRTMatrix ( const cv::Mat &  R_,
const cv::Mat &  T_,
int  forceType 
)
static

Returns the 4x4 homogeneous transform matrix from the R and T vectors computed

Definition at line 472 of file cameraparameters.cpp.

◆ glGetProjectionMatrix()

void aruco::CameraParameters::glGetProjectionMatrix ( cv::Size  orgImgSize,
cv::Size  size,
double  proj_matrix[16],
double  gnear,
double  gfar,
bool  invert = false 
)

Given the intrinsic camera parameters returns the GL_PROJECTION matrix for opengl. PLease NOTE that when using OpenGL, it is assumed no camera distorsion! So, if it is not true, you should have undistor image

Parameters
orgImgSizesize of the original image
sizeof the image/window where to render (can be different from the real camera image). Please not that it must be related to CamMatrix
proj_matrixoutput projection matrix to give to opengl
gnear,gfarvisible rendering range
invertindicates if the output projection matrix has to yield a horizontally inverted image because image data has not been stored in the order of glDrawPixels: bottom-to-top.

Definition at line 248 of file cameraparameters.cpp.

◆ isValid()

bool aruco::CameraParameters::isValid ( ) const
inline

Indicates whether this object is valid

Definition at line 63 of file cameraparameters.h.

◆ norm()

double aruco::CameraParameters::norm ( double  a,
double  b,
double  c 
)
staticprivate

Definition at line 275 of file cameraparameters.cpp.

◆ OgreGetProjectionMatrix()

void aruco::CameraParameters::OgreGetProjectionMatrix ( cv::Size  orgImgSize,
cv::Size  size,
double  proj_matrix[16],
double  gnear,
double  gfar,
bool  invert = false 
)

setup camera for an Ogre project. Use: ... Ogre::Matrix4 PM(proj_matrix[0], proj_matrix[1], ... , proj_matrix[15]); yourCamera->setCustomProjectionMatrix(true, PM); yourCamera->setCustomViewMatrix(true, Ogre::Matrix4::IDENTITY); ... As in OpenGL, it assumes no camera distorsion

Definition at line 442 of file cameraparameters.cpp.

◆ operator=()

CameraParameters & aruco::CameraParameters::operator= ( const CameraParameters CI)

Assign operator

Definition at line 55 of file cameraparameters.cpp.

◆ readFromXMLFile()

void aruco::CameraParameters::readFromXMLFile ( std::string  filePath)

Reads from a YAML file generated with the opencv2.2 calibration utility

Definition at line 189 of file cameraparameters.cpp.

◆ resize()

void aruco::CameraParameters::resize ( cv::Size  size)

Adjust the parameters to the size of the image indicated

Definition at line 166 of file cameraparameters.cpp.

◆ saveToFile()

void aruco::CameraParameters::saveToFile ( std::string  path,
bool  inXML = true 
)

Saves this to a file

Definition at line 128 of file cameraparameters.cpp.

◆ setParams()

void aruco::CameraParameters::setParams ( cv::Mat  cameraMatrix,
cv::Mat  distorsionCoeff,
cv::Size  size 
)

Sets the parameters

Parameters
cameraMatrix3x3 matrix (fx 0 cx, 0 fy cy, 0 0 1)
distorsionCoeff4x1 matrix (k1,k2,p1,p2)
sizeimage size

Definition at line 71 of file cameraparameters.cpp.

Friends And Related Function Documentation

◆ operator<<

ARUCO_EXPORT friend std::ostream& operator<< ( std::ostream &  str,
const CameraParameters cp 
)
friend

Definition at line 528 of file cameraparameters.cpp.

◆ operator>>

ARUCO_EXPORT friend std::istream& operator>> ( std::istream &  str,
CameraParameters cp 
)
friend

Definition at line 541 of file cameraparameters.cpp.

Member Data Documentation

◆ CameraMatrix

cv::Mat aruco::CameraParameters::CameraMatrix

Definition at line 33 of file cameraparameters.h.

◆ CamSize

cv::Size aruco::CameraParameters::CamSize

Definition at line 37 of file cameraparameters.h.

◆ Distorsion

cv::Mat aruco::CameraParameters::Distorsion

Definition at line 35 of file cameraparameters.h.

◆ ExtrinsicMatrix

cv::Mat aruco::CameraParameters::ExtrinsicMatrix

Definition at line 40 of file cameraparameters.h.


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


aruco
Author(s): Rafael Muñoz Salinas , Bence Magyar
autogenerated on Sat Sep 23 2023 02:26:45