44 #ifndef _CALIBRATION_H_ 45 #define _CALIBRATION_H_ 191 float d1,
float d2,
float d3,
float d4,
283 bool LoadCameraParameters(
const char *pCameraParameterFileName,
int nCamera = 0,
bool bSetExtrinsicToIdentity =
false);
Struct containing all parameters of the camera model.
Mat3d m_rotation_inverse
Rotation matrix of the inverted extrinsic transformation.
void SetDistortion(float d1, float d2, float d3, float d4)
Sets the distortion parameters of the distortion model.
void ImageToCameraCoordinates(const Vec2d &imagePoint, Vec3d &cameraPoint, float zc=1.0f, bool bUseDistortionParameters=true) const
Transforms 2D image coordinates to 3D camera coordinates.
CCameraParameters m_cameraParameters
void SetCameraParameters(float fx, float fy, float cx, float cy, float d1, float d2, float d3, float d4, const Mat3d &R, const Vec3d &t, int width, int height)
Initializes the camera model, given a complete parameter set.
void UndistortImageCoordinates(const Vec2d &distortedImagePoint, Vec2d &undistortedImagePoint) const
Transforms 2D distorted image coordinates to 2D undistorted image coordinates.
void CameraToWorldCoordinates(const Vec3d &cameraPoint, Vec3d &worldPoint) const
Transforms 3D camera coordinates to 3D world coordinates.
bool LoadCameraParameters(const char *pCameraParameterFileName, int nCamera=0, bool bSetExtrinsicToIdentity=false)
Initializes the camera model, given a file path to a camera parameter file.
Data structure for the representation of a 3D vector.
void CameraToImageCoordinates(const Vec3d &cameraPoint, Vec2d &imagePoint, bool bUseDistortionParameters=true) const
Transforms 3D camera coordinates to 2D image coordinates.
void DistortImageCoordinates(const Vec2d &undistortedImagePoint, Vec2d &distortedImagePoint) const
Transforms 2D undistorted image coordinates to 2D distorted image coordinates.
void GetCalibrationMatrix(Mat3d &K) const
Sets up the calibration matrix K.
void PrintCameraParameters() const
Prints all camera parameters in the console window (STDOUT).
const CCameraParameters & GetCameraParameters() const
Gives access to the camera parameters.
bool SaveCameraParameters(const char *pCameraParameterFileName) const
Writes the parameters of the camera model to camera parameter file.
void GetCameraCoordinates(const Vec3d &worldPoint, Vec2d &imagePoint, bool bUseDistortionParameters=true) const
Deprecated.
void ImageToWorldCoordinates(const Vec2d &imagePoint, Vec3d &worldPoint, float zc=1.0f, bool bUseDistortionParameters=true) const
Transforms 2D image coordinates to 3D world coordinates.
void GetProjectionMatrix(Mat3d &P1, Vec3d &p2) const
Sets up the projection matrix P.
void SetIntrinsicBase(float cx, float cy, float fx, float fy)
Sets the principal point and the focal lengths.
void GetWorldCoordinates(const Vec2d &imagePoint, Vec3d &worldPoint, float zc=1.0f, bool bUseDistortionParameters=true) const
Deprecated.
~CCalibration()
The destructor.
void UndistortCameraCoordinates(const Vec2d &distortedCameraPoint, Vec2d &undistortedCameraPoint) const
Deprecated.
void DistortCameraCoordinates(const Vec2d &undistortedCameraPoint, Vec2d &distortedCameraPoint) const
Deprecated.
CCalibration()
The default constructor.
Vec3d m_translation_inverse
Translation vector of the inverted extrinsic transformation.
GLenum GLsizei GLsizei height
void Set(const CCalibration &calibration)
Initializes the camera model, given an instance of CCalibration.
void CalculateRadialLensDistortion()
Data structure for the representation of a 2D vector.
void SetTranslation(const Vec3d &t)
Sets the extrinsic parameter t (translation vector).
void CalculateInverseTransformation()
void WorldToCameraCoordinates(const Vec3d &worldPoint, Vec3d &cameraPoint) const
Transforms 3D world coordinates to 3D camera coordinates.
void SetRotation(const Mat3d &R)
Sets the extrinsic parameter R (rotation matrix).
Data structure for the representation of a 3x3 matrix.
Camera model parameters and functions for a single camera.
void WorldToImageCoordinates(const Vec3d &worldPoint, Vec2d &imagePoint, bool bUseDistortionParameters=true) const
Transforms 3D world coordinates to 2D image coordinates.