Function estimate_rigid_transform

Source
pub fn estimate_rigid_transform(
    src: &impl ToInputArray,
    dst: &impl ToInputArray,
    full_affine: bool,
) -> Result<Mat>
👎Deprecated: Use cv::estimateAffine2D, cv::estimateAffinePartial2D instead. If you are using this function
Expand description

Computes an optimal affine transformation between two 2D point sets.

§Parameters

  • src: First input 2D point set stored in std::vector or Mat, or an image stored in Mat.
  • dst: Second input 2D point set of the same size and the same type as A, or another image.
  • fullAffine: If true, the function finds an optimal affine transformation with no additional restrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is limited to combinations of translation, rotation, and uniform scaling (4 degrees of freedom).

The function finds an optimal affine transform [A|b] (a 2 x 3 floating-point matrix) that approximates best the affine transformation between:

  • Two point sets
  • Two raster images. In this case, the function first finds some features in the src image and finds the corresponding features in dst image. After that, the problem is reduced to the first case. In case of point sets, the problem is formulated as follows: you need to find a 2x2 matrix A and 2x1 vector b so that:

block formula where src[i] and dst[i] are the i-th points in src and dst, respectively inline formula can be either arbitrary (when fullAffine=true ) or have a form of block formula when fullAffine=false.

Deprecated: Use cv::estimateAffine2D, cv::estimateAffinePartial2D instead. If you are using this function with images, extract points using cv::calcOpticalFlowPyrLK and then use the estimation functions.

§See also

estimateAffine2D, estimateAffinePartial2D, getAffineTransform, getPerspectiveTransform, findHomography