# Analyze the AJAX request and capture &#8220;Today&#8217;s Headline&#8217;s Street Shooting&#8221;

2023-01-26

```[Time] 2019.09.04
[Title] Transform.similalicytransform () of the Skimage libraryI. SimiLARITYTRANSFORMSimilar transformation: Waiting transformation+uniform scale zoom, the so -called equivalent transformation is translation+rotation transformation.```

transform matrix:

transform effect: angle, parallelism and verticality do not change.

2, transform.similalicytransform () usage

Reference: Help (TF.SIMILARITYTRANSFORM)

Input parameters:

• matrix : (3, 3) array, optional , Homogeneous transformation matrix.

optional, that is, the (3,3) change matrix in the above (3,3), depending on the description below.

• scale: float, optional (zoom factor, S)
• rotation : float, optional  Rotation angle in counter-clockwise direction as radians.

(Rotating angle θ, counterclockwise, expressed from the angle from the arc)

• translation : (tx, ty) as array, list or tuple, optional ，x, y translation parameters.

Transfer parameters (TX, TY)

Return:

`A SKIMAGE.TRANSFORM._Geometric.similalicytransform Object`
```(3,3) Quality change matrix:

[[A0 B0 A1]
[B0 A0 B1]
[0 0 1]]
Compared with the transformation matrix, we can see: A0 = S * cos (rotation), B0 = s * sin (rotation), A1 = TX, B1 = TY.```

The final similar transformation result of this is:

``` X = a0 * x - b0 * y + a1 =
= s * x * cos(rotation) - s * y * sin(rotation) + a1

Y = b0 * x + a0 * y + b1 =
= s * x * sin(rotation) + s * y * cos(rotation) + b1```
```3. Related methods:

3.1 ESTIMATE (SELF, SRC, DST): From a set of corresponding points (source point, target point), estimate change matrixinput parameters:
| src: (n, 2) array
| Source Coordinates. (Source coordinates)
| dst: (n, 2) array
| Destination Coordinates.
return:
| Success: BOOL
| True, if Model Estimation Succeeds.3.2 INVERSE (Self, Coords): From the target coordinates, the source coordinates| Apply Inverse Transformation.
Input parameters:

| Coords: (n, 2) array
| Destination Coordinates.
return:
| Coords: (n, 2) array
| Source Coordinates.3.3 Residuals (SELF, SRC, DST): Determine the residues of the target coordinates after the conversion, and determine the distance between Eujide with each source coordinates to each target coordinate.Input parameters:
| src: (n, 2) array
| Source Coordinates.
| dst: (n, 2) array
| Destination Coordinates.
return:
| Residuals: (n,) array
| Residual for coordinal.
| |```

4, example

4.1

``````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)``````

[Run results]:

4.2

``````from skimage import io,data
from skimage import transform as tf
img = data.camera()
io.imshow(img)
img1 = tf.warp(img,tform)
io.imshow(img1)``````

Original map The picture after similar transformation source