title: Finding translation and scale on two sets of points to get least square error in their distance?
body: <p>I have two sets of 3D points (original and reconstructed) and correspondence information about pairs - which point from one set represents the second one. I need to find 3D translation and scaling factor which transforms reconstruct set so the sum of square distances would be least (rotation would be nice too, but points are rotated similarly, so this is not main priority and might be omitted in sake of simplicity and speed). And so my question is - is this solved and available somewhere on the Internet? Personally, I would use least square method, but I don't have much time (and although I'm somewhat good at math, I don't use it often, so it would be better for me to avoid it), so I would like to use other's solution if it exists. I prefer solution in C++, for example using OpenCV, but algorithm alone is good enough.</p>
  
  <p>If there is no such solution, I will calculate it by myself, I don't want to bother you so much.</p>
  
  <p><strong>SOLUTION:</strong> (from your answers) <br />
  For me it's Kabsch alhorithm; <br />
  Base info: <a href="http://en.wikipedia.org/wiki/Kabsch_algorithm" rel="noreferrer">http://en.wikipedia.org/wiki/Kabsch_algorithm</a> <br />
  General solution: <a href="http://nghiaho.com/?page_id=671" rel="noreferrer">http://nghiaho.com/?page_id=671</a></p>
  
  <p><strong>STILL NOT SOLVED:</strong>
  I also need scale. Scale values from SVD are not understandable for me; when I need scale about 1-4 for all axises (estimated by me), SVD scale is about [2000, 200, 20], which is not helping at all.</p>