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 WorldToImageCoordinates(const Vec3d &worldPoint, Vec2d &imagePoint, bool bUseDistortionParameters=true) const
Transforms 3D world coordinates to 2D image 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.
bool SaveCameraParameters(const char *pCameraParameterFileName) const
Writes the parameters of the camera model to camera parameter file.
bool LoadCameraParameters(const char *pCameraParameterFileName, int nCamera=0, bool bSetExtrinsicToIdentity=false)
Initializes the camera model, given a file path to a camera parameter file.
void CameraToImageCoordinates(const Vec3d &cameraPoint, Vec2d &imagePoint, bool bUseDistortionParameters=true) const
Transforms 3D camera coordinates to 2D image coordinates.
void ImageToWorldCoordinates(const Vec2d &imagePoint, Vec3d &worldPoint, float zc=1.0f, bool bUseDistortionParameters=true) const
Transforms 2D image coordinates to 3D world coordinates.
Data structure for the representation of a 3D vector.
void DistortImageCoordinates(const Vec2d &undistortedImagePoint, Vec2d &distortedImagePoint) const
Transforms 2D undistorted image coordinates to 2D distorted image coordinates.
void WorldToCameraCoordinates(const Vec3d &worldPoint, Vec3d &cameraPoint) const
Transforms 3D world coordinates to 3D camera coordinates.
void GetWorldCoordinates(const Vec2d &imagePoint, Vec3d &worldPoint, float zc=1.0f, bool bUseDistortionParameters=true) const
Deprecated.
void ImageToCameraCoordinates(const Vec2d &imagePoint, Vec3d &cameraPoint, float zc=1.0f, bool bUseDistortionParameters=true) const
Transforms 2D image coordinates to 3D camera coordinates.
void UndistortImageCoordinates(const Vec2d &distortedImagePoint, Vec2d &undistortedImagePoint) const
Transforms 2D distorted image coordinates to 2D undistorted image coordinates.
void SetIntrinsicBase(float cx, float cy, float fx, float fy)
Sets the principal point and the focal lengths.
void DistortCameraCoordinates(const Vec2d &undistortedCameraPoint, Vec2d &distortedCameraPoint) const
Deprecated.
~CCalibration()
The destructor.
void GetProjectionMatrix(Mat3d &P1, Vec3d &p2) const
Sets up the projection matrix P.
CCalibration()
The default constructor.
Vec3d m_translation_inverse
Translation vector of the inverted extrinsic transformation.
void PrintCameraParameters() const
Prints all camera parameters in the console window (STDOUT).
GLenum GLsizei GLsizei height
void Set(const CCalibration &calibration)
Initializes the camera model, given an instance of CCalibration.
void CalculateRadialLensDistortion()
void GetCameraCoordinates(const Vec3d &worldPoint, Vec2d &imagePoint, bool bUseDistortionParameters=true) const
Deprecated.
Data structure for the representation of a 2D vector.
void CameraToWorldCoordinates(const Vec3d &cameraPoint, Vec3d &worldPoint) const
Transforms 3D camera coordinates to 3D world coordinates.
void SetTranslation(const Vec3d &t)
Sets the extrinsic parameter t (translation vector).
void UndistortCameraCoordinates(const Vec2d &distortedCameraPoint, Vec2d &undistortedCameraPoint) const
Deprecated.
void CalculateInverseTransformation()
void GetCalibrationMatrix(Mat3d &K) const
Sets up the calibration matrix K.
const CCameraParameters & GetCameraParameters() const
Gives access to the camera parameters.
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.