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
00041
00042 #ifndef _STEREO_CALIBRATION_H_
00043 #define _STEREO_CALIBRATION_H_
00044
00045
00046
00047
00048
00049
00050 #include "Math/Math3d.h"
00051
00052
00053
00054
00055
00056
00057 class CCalibration;
00058 class CByteImage;
00059 struct Vec2d;
00060 struct Vec3d;
00061 struct Mat3d;
00062 struct PointPair2d;
00063 struct PointPair3d;
00064
00065
00066
00067
00068
00069
00070
00087 class CStereoCalibration
00088 {
00089 public:
00098 CStereoCalibration();
00099
00103 ~CStereoCalibration();
00104
00108 CStereoCalibration(const CStereoCalibration &stereoCalibration);
00109
00110
00115 void Set(const CStereoCalibration &stereoCalibration);
00116
00127 void SetSingleCalibrations(const CCalibration &leftCalibration, const CCalibration &rightCalibration, bool bTransformLeftCameraToIdentity = false);
00128
00141 void SetDistortionParameters(float d1_left, float d2_left, float d3_left, float d4_left, float d1_right, float d2_right, float d3_right, float d4_right);
00142
00157 void SetExtrinsicParameters(const Mat3d& left_rotation, const Vec3d& left_translation, const Mat3d& right_rotation, const Vec3d& right_translation, bool bTransformLeftCameraToIdentity = false);
00158
00172 bool LoadCameraParameters(const char *pCameraParameterFileName, bool bTransformLeftCameraToIdentity = true);
00173
00207 bool SaveCameraParameters(const char *pCameraParameterFileName) const;
00208
00209
00211 const CCalibration* GetLeftCalibration() const { return m_pLeftCalibration; }
00212
00214 const CCalibration* GetRightCalibration() const { return m_pRightCalibration; }
00215
00216
00231 void Calculate3DPoint(const Vec2d &cameraPointLeft, const Vec2d &cameraPointRight, Vec3d &worldPoint, bool bInputImagesAreRectified, bool bUseDistortionParameters = true, PointPair3d *pConnectionLine = 0);
00232
00245 void CalculateEpipolarLineInLeftImage(const Vec2d &pointInRightImage, Vec3d &l);
00246
00255 void CalculateEpipolarLineInLeftImage(const Vec2d &pointInRightImage, PointPair2d &epipolarLine);
00256
00265 void CalculateEpipolarLineInLeftImage(const Vec2d &pointInRightImage, float &m, float &c);
00266
00279 void CalculateEpipolarLineInRightImage(const Vec2d &pointInLeftImage, Vec3d &l);
00280
00289 void CalculateEpipolarLineInRightImage(const Vec2d &pointInLeftImage, PointPair2d &epipolarLine);
00290
00299 void CalculateEpipolarLineInRightImage(const Vec2d &pointInLeftImage, float &m, float &c);
00300
00301
00311 float CalculateEpipolarLineInLeftImageDistance(const Vec2d &pointInLeftImage, const Vec2d &pointInRightImage);
00312
00322 float CalculateEpipolarLineInRightImageDistance(const Vec2d &pointInLeftImage, const Vec2d &pointInRightImage);
00323
00341 void GetProjectionMatricesForRectifiedImages(Mat3d &P1Left, Vec3d &p2Left, Mat3d &P1Right, Vec3d &p2Right) const;
00342
00343
00344
00346 int width;
00348 int height;
00349
00359 Mat3d rectificationHomographyLeft;
00360
00370 Mat3d rectificationHomographyRight;
00371
00372
00373 private:
00374
00375 void TransformLeftCameraToIdentity();
00376 void CalculateFundamentalMatrix();
00377
00378
00379 CCalibration *m_pLeftCalibration;
00380 CCalibration *m_pRightCalibration;
00381
00382 Mat3d F, FT;
00383 };
00384
00385
00386
00387 #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:58