title: How to undistort points in camera shot coordinates and obtain corresponding undistorted image coordinates?
body: <p>I use OpenCV to undestort set of points after camera calibration.
  The code follows.</p>
  
  <pre><code>const int npoints = 2; // number of point specified 
  
  // Points initialization. 
  // Only 2 ponts in this example, in real code they are read from file.
  float input_points[npoints][2] = {{0,0}, {2560, 1920}}; 
  
  CvMat * src = cvCreateMat(1, npoints, CV_32FC2);
  CvMat * dst = cvCreateMat(1, npoints, CV_32FC2);
  
  // fill src matrix
  float * src_ptr = (float*)src-&gt;data.ptr;
  for (int pi = 0; pi &lt; npoints; ++pi) {
      for (int ci = 0; ci &lt; 2; ++ci) {
          *(src_ptr + pi * 2 + ci) = input_points[pi][ci];
      }
  }
  
  cvUndistortPoints(src, dst, &amp;camera1, &amp;distCoeffs1);
  </code></pre>
  
  <p>After the code above <code>dst</code> contains following numbers:</p>
  
  <pre><code>-8.82689655e-001 -7.05507338e-001 4.16228324e-001 3.04863811e-001
  </code></pre>
  
  <p>which are too small in comparison with numbers in <code>src</code>.</p>
  
  <p>At the same time if I undistort image via the call:</p>
  
  <pre><code>cvUndistort2( srcImage, dstImage, &amp;camera1, &amp;dist_coeffs1 );
  </code></pre>
  
  <p>I receive good undistorted image which means that pixel coordinates are not modified so drastically in comparison with separate points.</p>
  
  <p>How to obtain the same undistortion for specific points as for images?
  Thanks.</p>