admin管理员组

文章数量:1660220

def estimate(self, src, dst):


作用:Estimate the transformation from a set of corresponding points.

    You can determine the over-, well- and under-determined parameters with the total least-squares method.

    Number of source and destination coordinates must match.

    Parameters
    ----------
    src : (N, 2) array
        Source coordinates.
    dst : (N, 2) array
        Destination coordinates.

    Returns
    -------
    success : bool
    True, if model estimation succeeds.

 

from skimage import transform as trans
import numpy as np
src = np.array([
    [38.2946, 51.6963],
    [73.5318, 51.5014],
    [56.0252, 71.7366],
    [41.5493, 92.3655],
    [70.7299, 92.2041] ], dtype=np.float32)
dst = np.array([
    [38.2946, 51.6963],
    [73.5318, 51.5014],
    [56.0252, 71.7366],
    [41.5493, 92.3655],
    [70.7299, 92.2041] ], dtype=np.float32)
tform = trans.SimilarityTransform()
res =tform.estimate(dst, src)

M = tform.params
print(res)
print(M)

本文标签: estimate