62 void CRectification::CRectificationMapper::Init(
const Mat3d &homography,
const CCalibration *pCalibration)
64 m_pCalibration = pCalibration;
67 ComputeMap(m_pCalibration->GetCameraParameters().width, m_pCalibration->GetCameraParameters().height);
70 void CRectification::CRectificationMapper::ComputeOriginalCoordinates(
const Vec2d &newCoordinates,
Vec2d &originalCoordinates)
77 m_pCalibration->DistortImageCoordinates(originalCoordinates, originalCoordinates);
90 m_pUsedStereoCalibration = 0;
92 m_pRectificationMapperLeft =
new CRectificationMapper(bInterpolate, bUndistort);
93 m_pRectificationMapperRight =
new CRectificationMapper(bInterpolate, bUndistort);
98 delete m_pStereoCalibration;
100 delete m_pRectificationMapperLeft;
101 delete m_pRectificationMapperRight;
113 m_pUsedStereoCalibration = m_pStereoCalibration;
125 m_pUsedStereoCalibration = pStereoCalibration;
133 if (!m_pUsedStereoCalibration)
135 printf(
"error: CRectification object has not been initialized for CRectification::UpdateMaps\n");
145 m_pRectificationMapperLeft->PerformMapping(ppInputImages[0], ppOutputImages[0]);
146 m_pRectificationMapperRight->PerformMapping(ppInputImages[1], ppOutputImages[1]);
const CCalibration * GetRightCalibration() const
Access to the instance of CCalibration for the camera model of the right camera.
CRectification(bool bInterpolate=true, bool bUndistort=true)
void ApplyHomography(const Mat3d &A, const Vec2d &p, Vec2d &result)
Data structure for the representation of a 2D vector.
void Rectify(const CByteImage *const *ppInputImages, CByteImage **ppOutputImages)
bool LoadCameraParameters(const char *pCameraParameterFileName, bool bTransformLeftCameraToIdentity=true)
Initializes the stereo camera model, given a file path to a stereo camera parameter file...
bool Init(const char *pCameraParameterFileName)
const CCalibration * GetLeftCalibration() const
Access to the instance of CCalibration for the camera model of the left camera.
void SetMat(Mat3d &matrix, float r1, float r2, float r3, float r4, float r5, float r6, float r7, float r8, float r9)
Camera model parameters and functions for a single camera.
Mat3d rectificationHomographyRight
The homography for the rectification mapping of the right image.
Data structure for the representation of a 3x3 matrix.
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Camera model and functions for a stereo camera system.
Mat3d rectificationHomographyLeft
The homography for the rectification mapping of the right image.