Affine transformation estimation by means of Least Square method, implemented in C++ with OpenCV (tested on Microsoft Windows with OpenCV 2.4.4).
The estimation is based on the article: SPÄTH, Helmuth. Fitting affine and orthogonal transformations between two sets of points. Mathematical Communications, 2004, 9.1: 27-34.