I am trying to un-distort the pixel coordinate of two points using the code below but I am not successful.
vector<Point2f> pts;
cv::Mat upts;
pts.push_back(diagStartPnt);
pts.push_back(diagEndPnt);
cerr << "m_cameraMat = \n" << m_cameraMat << endl;
cerr << "m_distortionCoefMat = \n" << m_distortionCoefMat << endl;
cerr << "pts = \n" << pts << endl;
undistortPoints(Mat(pts), upts, m_cameraMat, m_distortionCoefMat);
cerr << "upts = " << upts << endl;
But it doesn't seem to be working, I get weird output ... !!!???
m_cameraMat =
[606.184487913021, 0, 320;
0, 606.184487913021, 240;
0, 0, 1]
m_distortionCoefMat =
[-0.02448317075341529;
0.3189340323130755;
0;
0;
-1.013832345303472]
pts =
[533.44543, 347.06061;
529.32397, 234.65332]
upts =
[0.35208049, 0.1765976;
0.34534943, -0.0088211242]
I am totally clueless ... :|