polynomialtransform

PolynomialTransform

class skimage.transform.PolynomialTransform(params=None) [source]

Bases: skimage.transform._geometric.GeometricTransform

2D transformation of the form:

..:math:

X = sum[j=0:order]( sum[i=0:j]( a_ji * x**(j - i) * y**i )) Y = sum[j=0:order]( sum[i=0:j]( b_ji * x**(j - i) * y**i ))
Parameters:

params : (2, N) array, optional

Polynomial coefficients where N * 2 = (order + 1) * (order + 2). So, a_ji is defined in params[0, :] and b_ji in params[1, :].

Attributes

params ((2, N) array) Polynomial coefficients where N * 2 = (order + 1) * (order + 2). So, a_ji is defined in params[0, :] and b_ji in params[1, :].
__init__(params=None) [source]
estimate(src, dst, order=2) [source]

Set the transformation matrix with the explicit transformation parameters.

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

Number of source and destination coordinates must match.

The transformation is defined as:

X = sum[j=0:order]( sum[i=0:j]( a_ji * x**(j - i) * y**i ))
Y = sum[j=0:order]( sum[i=0:j]( b_ji * x**(j - i) * y**i ))

These equations can be transformed to the following form:

0 = sum[j=0:order]( sum[i=0:j]( a_ji * x**(j - i) * y**i )) - X
0 = sum[j=0:order]( sum[i=0:j]( b_ji * x**(j - i) * y**i )) - Y

which exist for each set of corresponding points, so we have a set of N * 2 equations. The coefficients appear linearly so we can write A x = 0, where:

A   = [[1 x y x**2 x*y y**2 ... 0 ...             0 -X]
       [0 ...                 0 1 x y x**2 x*y y**2 -Y]
        ...
        ...
      ]
x.T = [a00 a10 a11 a20 a21 a22 ... ann
       b00 b10 b11 b20 b21 b22 ... bnn c3]

In case of total least-squares the solution of this homogeneous system of equations is the right singular vector of A which corresponds to the smallest singular value normed by the coefficient c3.

Parameters:

src : (N, 2) array

Source coordinates.

dst : (N, 2) array

Destination coordinates.

order : int, optional

Polynomial order (number of coefficients is order + 1).

Returns:

success : bool

True, if model estimation succeeds.

inverse(coords) [source]
doc_scikit_image
2017-01-12 17:22:47
Comments
Leave a Comment

Please login to continue.