trajectory similarity

1: First obtain the minimum circumscribed rectangles of the first route and the second route, and obtain the first rectangle (SW1*SH1) and the second rectangle (SW2*SH2) respectively.

Among them, SW1, SH1 are respectively the horizontal side length and the vertical side length of the first rectangle; SW2, SH2 points

are the horizontal side length and vertical side length of the second rectangle.

2: According to the first rectangle (SW1*SH1) and the second rectangle (SW2*SH2), get the fusion source rectangle (SW* SH)

Take the maximum value of the horizontal side length of the first rectangle and the second rectangle as the horizontal side length of the fusion source rectangle, and take the maximum value of the vertical side length of the first rectangle and the second rectangle as the vertical side length of the fusion source rectangle.

That is, SW=Max(SW1 , SW2 ), and SH=Max(SH1 , SH2 ).

3: On the basis that the position of the track point on the first route or the second route remains unchanged relative to the fusion source rectangle, through

By scaling the fusion source rectangle to the size of the target rectangle, new coordinates of multiple track points on the first route and the second route are sequentially obtained.

Among them, the size of the target rectangle is a calibration value. Specifically, it is a square target rectangle (D, D) whose width and height are both D. As shown in Figure 3 [1024*1024] square.

First, take the fusion source rectangle (SW*SH) and the lower left corner of the target rectangle (D, D) as the coordinate origin (0, 0),

Construct the fused source coordinate system and the target coordinate system to obtain source coordinates (Sx, Sy) of multiple track points on the first route or the second route.

Then, by making the ratio of the source coordinate value (Sx, Sy) of multiple trajectory points to the corresponding side length (SW*SH) of the fusion source rectangle, it is equal to the new coordinate value (Dx, Dy) of multiple trajectory points corresponding to the target rectangle The ratio of the side length (D, D) is solved to obtain the new coordinates (Dx, Dy) of multiple trajectory points

4: The trajectory points are scaled, uniformly scaled to positive integers

5: Generate a two-dimensional matrix of routes

6: Similarity module, according to the coincidence degree of 1 corresponding to the two-dimensional matrix

Guess you like

Origin blog.csdn.net/u013385018/article/details/126873945