42 #ifndef _STEREO_CALIBRATION_H_ 43 #define _STEREO_CALIBRATION_H_ 141 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);
172 bool LoadCameraParameters(
const char *pCameraParameterFileName,
bool bTransformLeftCameraToIdentity =
true);
bool LoadCameraParameters(const char *pCameraParameterFileName, bool bTransformLeftCameraToIdentity=true)
Initializes the stereo camera model, given a file path to a stereo camera parameter file...
Mat3d rectificationHomographyRight
The homography for the rectification mapping of the right image.
CCalibration * m_pRightCalibration
void SetSingleCalibrations(const CCalibration &leftCalibration, const CCalibration &rightCalibration, bool bTransformLeftCameraToIdentity=false)
Initializes the stereo camera model, given two instances of CCalibration.
Data structure for the representation of a 3D vector.
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
const CCalibration * GetLeftCalibration() const
Access to the instance of CCalibration for the camera model of the left camera.
CCalibration * m_pLeftCalibration
void CalculateFundamentalMatrix()
bool SaveCameraParameters(const char *pCameraParameterFileName) const
Writes the parameters of the camera model to camera parameter file.
void CalculateEpipolarLineInLeftImage(const Vec2d &pointInRightImage, Vec3d &l)
Given an image point in the right image, computes the corresponding epipolar line in the left image...
float CalculateEpipolarLineInRightImageDistance(const Vec2d &pointInLeftImage, const Vec2d &pointInRightImage)
Given a point correspondence, computes the distance from the epipolar line in the right image...
void Calculate3DPoint(const Vec2d &cameraPointLeft, const Vec2d &cameraPointRight, Vec3d &worldPoint, bool bInputImagesAreRectified, bool bUseDistortionParameters=true, PointPair3d *pConnectionLine=0)
Computes a 3D point, given a point correspondence in both images, by performing stereo triangulation...
float CalculateEpipolarLineInLeftImageDistance(const Vec2d &pointInLeftImage, const Vec2d &pointInRightImage)
Given a point correspondence, computes the distance from the epipolar line in the left image...
int height
The height of the images of the stereo camera system in pixels.
int width
The width of the images of the stereo camera system in pixels.
Camera model and functions for a stereo camera system.
const CCalibration * GetRightCalibration() const
Access to the instance of CCalibration for the camera model of the right camera.
void SetExtrinsicParameters(const Mat3d &left_rotation, const Vec3d &left_translation, const Mat3d &right_rotation, const Vec3d &right_translation, bool bTransformLeftCameraToIdentity=false)
Sets the extrinsic parameters of both cameras.
~CStereoCalibration()
The destructor.
Mat3d rectificationHomographyLeft
The homography for the rectification mapping of the right image.
CStereoCalibration()
The default constructor.
Data structure for the representation of a 2D vector.
void CalculateEpipolarLineInRightImage(const Vec2d &pointInLeftImage, Vec3d &l)
Given an image point in the left image, computes the corresponding epipolar line in the right image...
void GetProjectionMatricesForRectifiedImages(Mat3d &P1Left, Vec3d &p2Left, Mat3d &P1Right, Vec3d &p2Right) const
Sets up the projection matrix P for the rectified images.
void TransformLeftCameraToIdentity()
Data structure for the representation of a 3x3 matrix.
Camera model parameters and functions for a single camera.
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)
Sets the distortion parameters of the distortion models of both cameras.
void Set(const CStereoCalibration &stereoCalibration)
Initializes the stereo camera model, given an instance of CStereoCalibration.