62 this->
cx = 0.5f * float(width - 1);
63 this->
cy = 0.5f * float(height - 1);
71 const float x = newCoordinates.
x -
cx;
72 const float y = newCoordinates.
y -
cy;
74 const float rr = x * x + y *
y;
75 const float factor = 1.0f +
d * rr;
77 originalCoordinates.
x =
cx + factor *
x;
78 originalCoordinates.
y =
cy + factor *
y;
void ComputeMap(int width, int height)
This method initializes the instance for mapping of images of a specific size.
void Undistort(const CByteImage *pInputImage, CByteImage *pOutputImage)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
void Init(int width, int height, float d)
void PerformMapping(const CByteImage *pInputImage, CByteImage *pOutputImage)
This method performs the mapping.
GLenum GLsizei GLsizei height
Data structure for the representation of a 2D vector.
void ComputeOriginalCoordinates(const Vec2d &newCoordinates, Vec2d &originalCoordinates)
CUndistortionMapper(bool bInterpolate)
CUndistortionMapper * m_pUndistortionMapper
CUndistortionSimple(int width, int height, float d, bool bInterpolate=true)