Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00044 #ifndef _CALIBRATION_H_
00045 #define _CALIBRATION_H_
00046
00047
00048
00049
00050
00051
00052 #include "Math/Math2d.h"
00053 #include "Math/Math3d.h"
00054
00055
00056
00057
00058
00059
00060
00125 class CCalibration
00126 {
00127 public:
00133 struct CCameraParameters
00134 {
00136 int width;
00138 int height;
00140 Vec2d principalPoint;
00142 Vec2d focalLength;
00144 float distortion[4];
00146 Mat3d rotation;
00148 Vec3d translation;
00149 };
00150
00151
00160 CCalibration();
00161
00165 ~CCalibration();
00166
00167
00172 void Set(const CCalibration &calibration);
00173
00190 void SetCameraParameters(float fx, float fy, float cx, float cy,
00191 float d1, float d2, float d3, float d4,
00192 const Mat3d &R, const Vec3d &t, int width, int height);
00193
00202 void SetIntrinsicBase(float cx, float cy, float fx, float fy);
00203
00212 void SetDistortion(float d1, float d2, float d3, float d4);
00213
00221 void SetRotation(const Mat3d &R);
00222
00230 void SetTranslation(const Vec3d &t);
00231
00232
00248 void GetCalibrationMatrix(Mat3d &K) const;
00249
00262 void GetProjectionMatrix(Mat3d &P1, Vec3d &p2) const;
00263
00268 const CCameraParameters& GetCameraParameters() const { return m_cameraParameters; }
00269
00270
00283 bool LoadCameraParameters(const char *pCameraParameterFileName, int nCamera = 0, bool bSetExtrinsicToIdentity = false);
00284
00293 bool SaveCameraParameters(const char *pCameraParameterFileName) const;
00294
00298 void PrintCameraParameters() const;
00299
00300
00311 void WorldToImageCoordinates(const Vec3d &worldPoint, Vec2d &imagePoint, bool bUseDistortionParameters = true) const;
00312
00326 void ImageToWorldCoordinates(const Vec2d &imagePoint, Vec3d &worldPoint, float zc = 1.0f, bool bUseDistortionParameters = true) const;
00327
00328
00337 void WorldToCameraCoordinates(const Vec3d &worldPoint, Vec3d &cameraPoint) const;
00338
00347 void CameraToWorldCoordinates(const Vec3d &cameraPoint, Vec3d &worldPoint) const;
00348
00349
00360 void CameraToImageCoordinates(const Vec3d &cameraPoint, Vec2d &imagePoint, bool bUseDistortionParameters = true) const;
00361
00375 void ImageToCameraCoordinates(const Vec2d &imagePoint, Vec3d &cameraPoint, float zc = 1.0f, bool bUseDistortionParameters = true) const;
00376
00377
00388 void UndistortImageCoordinates(const Vec2d &distortedImagePoint, Vec2d &undistortedImagePoint) const;
00389
00398 void DistortImageCoordinates(const Vec2d &undistortedImagePoint, Vec2d &distortedImagePoint) const;
00399
00400
00407 void UndistortCameraCoordinates(const Vec2d &distortedCameraPoint, Vec2d &undistortedCameraPoint) const;
00408
00415 void DistortCameraCoordinates(const Vec2d &undistortedCameraPoint, Vec2d &distortedCameraPoint) const;
00416
00423 void GetCameraCoordinates(const Vec3d &worldPoint, Vec2d &imagePoint, bool bUseDistortionParameters = true) const;
00424
00431 void GetWorldCoordinates(const Vec2d &imagePoint, Vec3d &worldPoint, float zc = 1.0f, bool bUseDistortionParameters = true) const;
00432
00433
00443 Mat3d m_rotation_inverse;
00444
00454 Vec3d m_translation_inverse;
00455
00456
00457 private:
00458
00459 void CalculateInverseTransformation();
00460 void CalculateRadialLensDistortion();
00461
00462
00463
00464
00465 CCameraParameters m_cameraParameters;
00466 };
00467
00468
00469
00470 #endif
asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Thu Jun 6 2019 21:46:57