title: Un-Distort raw images received from the Leap motion cameras
body: <p>I've been working with the leap for a long time now. 2.1.+ SDK version allows us to access the cameras and get raw images. I want to use those images with OpenCV for square/circle detection and stuff... the problem is i can't get those images undistorted. i read the docs, but don't quite get what they mean. here's one thing i need to understand properly before going forward</p>
  
  <pre><code>        distortion_data_ = image.distortion();
          for (int d = 0; d &lt; image.distortionWidth() * image.distortionHeight(); d += 2)
          {
              float dX = distortion_data_[d];
              float dY = distortion_data_[d + 1];
              if(!((dX &lt; 0) || (dX &gt; 1)) &amp;&amp; !((dY &lt; 0) || (dY &gt; 1)))
              {
                 //what do i do now to undistort the image?
              }
          }
          data = image.data();
          mat.put(0, 0, data);
          //Imgproc.Canny(mat, mat, 100, 200);
          //mat = findSquare(mat);
          ok.showImage(mat);    
  </code></pre>
  
  <p>in the docs it says something like this "
  The calibration map can be used to correct image distortion due to lens curvature and other imperfections. The map is a 64x64 grid of points. Each point consists of two 32-bit values....(the rest on the dev website)"</p>
  
  <p>can someone explain this in detail please, OR OR, just post the java code to undistort the images give me an output MAT image so i may continue processing that (i'd still prefer a good explanation if possible)</p>