62 void CUndistortion::CUndistortionMapper::Init(
const CCalibration *pCalibration)
64 m_pCalibration = pCalibration;
65 ComputeMap(m_pCalibration->GetCameraParameters().width, m_pCalibration->GetCameraParameters().height);
68 void CUndistortion::CUndistortionMapper::ComputeOriginalCoordinates(
const Vec2d &newCoordinates,
Vec2d &originalCoordinates)
84 m_pUndistortionMapperLeft =
new CUndistortionMapper(bInterpolate);
85 m_pUndistortionMapperRight =
new CUndistortionMapper(bInterpolate);
90 delete m_pStereoCalibration;
91 delete m_pCalibration;
93 delete m_pUndistortionMapperLeft;
94 delete m_pUndistortionMapperRight;
119 m_pCalibrationLeft = m_pCalibration;
120 m_pCalibrationRight = 0;
133 m_pCalibrationLeft = pCalibration;
134 m_pCalibrationRight = 0;
149 if (!m_pCalibrationLeft && !m_pCalibrationRight)
151 printf(
"error: CUndistortion object has not been initialized for CUndistortion::UpdateMaps\n");
155 if (m_pCalibrationLeft)
156 m_pUndistortionMapperLeft->Init(m_pCalibrationLeft);
158 if (m_pCalibrationRight)
159 m_pUndistortionMapperRight->Init(m_pCalibrationRight);
165 m_pUndistortionMapperLeft->PerformMapping(pInputImage, pOutputImage);
171 m_pUndistortionMapperLeft->PerformMapping(ppInputImages[0], ppOutputImages[0]);
172 m_pUndistortionMapperRight->PerformMapping(ppInputImages[1], ppOutputImages[1]);
const CCalibration * GetRightCalibration() const
Access to the instance of CCalibration for the camera model of the right camera.
Data structure for the representation of a 2D vector.
int Init(const char *pCameraParameterFileName)
bool LoadCameraParameters(const char *pCameraParameterFileName, bool bTransformLeftCameraToIdentity=true)
Initializes the stereo camera model, given a file path to a stereo camera parameter file...
CUndistortion(bool bInterpolate=true)
bool LoadCameraParameters(const char *pCameraParameterFileName, int nCamera=0, bool bSetExtrinsicToIdentity=false)
Initializes the camera model, given a file path to a camera parameter file.
const CCalibration * GetLeftCalibration() const
Access to the instance of CCalibration for the camera model of the left camera.
Camera model parameters and functions for a single camera.
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
void DistortImageCoordinates(const Vec2d &undistortedImagePoint, Vec2d &distortedImagePoint) const
Transforms 2D undistorted image coordinates to 2D distorted image coordinates.
void Undistort(const CByteImage *pInputImage, CByteImage *pOutputImage)
Camera model and functions for a stereo camera system.