skimage 0.17.2

ParametersReturnsBackRef
estimate_transform(ttype, src, dst, **kwargs)

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

ttype : {'euclidean', similarity', 'affine', 'piecewise-affine', 'projective', 'polynomial'}

Type of transform.

kwargs : array or int

Function parameters (src, dst, n, angle):

NAME / TTYPE        FUNCTION PARAMETERS
'euclidean'         `src, `dst`
'similarity'        `src, `dst`
'affine'            `src, `dst`
'piecewise-affine'  `src, `dst`
'projective'        `src, `dst`
'polynomial'        `src, `dst`, `order` (polynomial order,
                                          default order is 2)

Also see examples below.

Returns

tform : :class:`GeometricTransform`

Transform object containing the transformation parameters and providing access to forward and inverse transformation functions.

Estimate 2D geometric transformation parameters.

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy as np
... from skimage import transform
This example is valid syntax, but we were not able to check execution
>>> # estimate transformation parameters
... src = np.array([0, 0, 10, 10]).reshape((2, 2))
... dst = np.array([12, 14, 1, -20]).reshape((2, 2))
This example is valid syntax, but we were not able to check execution
>>> tform = transform.estimate_transform('similarity', src, dst)
This example is valid syntax, but we were not able to check execution
>>> np.allclose(tform.inverse(tform(src)), src)
True
This example is valid syntax, but we were not able to check execution
>>> # warp image using the estimated transformation
... from skimage import data
... image = data.camera()
This example is valid syntax, but we were not able to check execution
>>> warp(image, inverse_map=tform.inverse) # doctest: +SKIP
This example is valid syntax, but we were not able to check execution
>>> # create transformation with explicit parameters
... tform2 = transform.SimilarityTransform(scale=1.1, rotation=1,
...  translation=(10, 20))
This example is valid syntax, but we were not able to check execution
>>> # unite transformations, applied in order from left to right
... tform3 = tform + tform2
... np.allclose(tform3(src), tform2(tform(src))) True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.transform._geometric.estimate_transform

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/transform/_geometric.py#1339
type: <class 'function'>
Commit: