I have two images that I want to compute the affine motion model parameters. The model that I use is $$x' = a_1x+a_2y+a_3$$ $$y' = a_4x+a_5y+a_6$$ To calculate those 6 parameters, I picked 6 points (overdetermined system) between two images, and calculated those parameters by using MATLAB (A = X\X_primes). However, when I apply the transformation, even the points that I picked (X) do not translate into the specified locations (X_prime). I inferred that my least square solution should be wrong, and I am looking for how to make it better, i.e. what kind of points should I choose on the image to obtain better parameters for affine motion model?
As a complement to the comments above, I am adding the slides for Image Registration by Leow Wee Kheng, where one can find:
Given two images, how to register one with the other?
- Determine the corresponding points between the images. Manually mark corresponding points, or Detect and match features between views (see lecture on feature detection and matching).
- Determine the transformation between corresponding points. Assume that all pairs of corresponding points are related by the same transformation. Compute parameters of transformation given corresponding points.
Importance is laid on corresponding points. Indeed, even with an over-determined system, if the chosen pixels an weakly informative (on flat or noisy parts of the image), the matching might not be efficient. One can instead detect features (edges, corners, textural patches), and compute the registration based on them.
Sometimes, one does not have the same points, or the same number of features between images. I recently have tested a efficient algorithm (CDP, or Coherent Point Drift) for non-standard chromatographic images (made of peaks or blobs), that can be tuned from rigid to smooth deformations:
- Point-Set Registration: Coherent Point Drift, 2010
- Our application, for the record: BARCHAN: Blob Alignment for Robust CHromatographic ANalysis, 2017