cv.estimateAffinePartial2D - MATLAB File Help
cv.estimateAffinePartial2D

Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets

H = cv.estimateAffinePartial2D(from, to)
[H, inliers] = cv.estimateAffinePartial2D(...)
[...] = cv.estimateAffinePartial2D(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function estimates an optimal 2D affine transformation with 4 degrees of freedom limited to combinations of translation, rotation, and uniform scaling. Uses the selected algorithm for robust estimation.

The computed transformation is then refined further (using only inliers) with the Levenberg-Marquardt method to reduce the re-projection error even more.

Estimated transformation matrix is:

[cos(theta)*s, -sin(theta)*s, tx;
 sin(theta)*s,  cos(theta)*s, ty]

Where theta is the rotation angle, s the scaling factor and tx, ty are translations in x, y axes respectively.

Note: The RANSAC method can handle practically any ratio of outliers but need a threshold to distinguish inliers from outliers. The method LMedS does not need any threshold but it works correctly only when there are more than 50% of inliers.

See also