Three-dimensional trajectory clustering method and system based on composite three-dimensional similarity distance metric
Patent Information
- Application Number
- CN202510793311.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-06-13
AI Technical Summary
(1)基于几何形状的轨迹聚类方法,以TRACLUS算法及其变种为典型,利用MDL原理对二维轨迹分段,通过定义复合二维几何距离衡量线段相似性聚类;部分三维扩展方法采用简化距离度量,但传统二维方法难以处理三维数据,难以精确感知三维形状和方向,丢失关键空间结构信息,使得相似空间位置下不同运动模式的轨迹难以区分
(1)本发明首先通过一种适应三维轨迹特性的最小描述长度(MDL)原理对轨迹进行分段,提取出关键的特征线段;然后,设计并应用一种新颖的复合三维相似性距离度量来精确衡量这些三维线段之间的几何相似性,综合考虑角度、垂直距离、平行距离和欧式距离,实现基于结构信息、运动模式的相似度计算;最后,利用基于密度的聚类算法,依据该复合距离将形状相似的线段聚集在一起,从而实现对运动模式相同的三维轨迹的精确聚类。
Smart Images

Figure CN120931967B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of trajectory processing technology, and in particular to a three-dimensional trajectory clustering method and system based on a composite three-dimensional similarity distance metric. Background Technology
[0002] With the rapid development of technologies such as the Global Positioning System (GPS) and the BeiDou Navigation Satellite System, it is now possible to easily acquire large amounts of 3D trajectory data. These data come from a wide range of sources, from activity records from personal wearable devices to the motion trajectories of aircraft and ships, and even VR / AR user interaction data, forming rich datasets. Cluster analysis of this data can uncover group movement patterns, playing a crucial role in many fields such as intelligent transportation and public safety.
[0003] Currently, there are three main types of trajectory clustering methods: (1) Trajectory clustering methods based on geometric shape, with the TRACLUS algorithm and its variants as typical, use the MDL principle to segment two-dimensional trajectories and measure the similarity of line segments by defining composite two-dimensional geometric distance; some three-dimensional extension methods use simplified distance measurement, but traditional two-dimensional methods are difficult to process three-dimensional data, difficult to accurately perceive three-dimensional shape and direction, lose key spatial structure information, and make it difficult to distinguish trajectories of different motion modes under similar spatial positions.
[0004] (2) Clustering methods based on the spatial distribution of trajectory points treat the trajectory as a set of points, ignore the sequence and connection structure, and cluster according to the spatial location and density of points. Although it can handle three-dimensional coordinates, it is not sensitive to the key three-dimensional shape and direction features of the trajectory, loses the trajectory structure and semantic information, and thus cannot accurately identify the subtle differences between trajectories.
[0005] (3) Clustering methods based on complete trajectory distance metrics first define trajectory similarity metrics and then use correlation clustering algorithms to preserve trajectory integrity; however, the computational complexity is high and there is insufficient attention to local shape details. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes a three-dimensional trajectory clustering method and system based on a composite three-dimensional similarity distance metric. By using a composite three-dimensional similarity distance metric, the method comprehensively captures the direction, position, and shape features of trajectories, effectively distinguishing trajectories that are spatially close but have different motion patterns, thus providing more reliable data support for three-dimensional motion analysis.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric, comprising: Acquire three-dimensional spatial trajectory data, perform dynamic programming segmentation based on the principle of minimum description length, and extract feature line segments that represent shape characteristics; A composite three-dimensional similarity distance metric algorithm is constructed, which calculates the geometric similarity between the feature line segments by weighted combination of three-dimensional angular distance, three-dimensional perpendicular distance, three-dimensional parallel distance and three-dimensional Euclidean midpoint distance; The feature line segments are clustered based on the geometric similarity using a density-based clustering algorithm, and the clustering results are output. Based on the clustering results, a three-dimensional representative trajectory is generated through main direction alignment, spatial sampling aggregation, and inverse coordinate transformation.
[0008] Secondly, the present invention provides a three-dimensional trajectory clustering system based on a composite three-dimensional similarity distance metric, comprising: The segmentation module is configured to acquire three-dimensional spatial trajectory data, perform dynamic programming segmentation based on the principle of minimum description length, and extract feature line segments that represent shape features. The similarity calculation module is configured to construct a composite three-dimensional similarity distance metric algorithm, which calculates the geometric similarity between the feature line segments by weighted combination of three-dimensional angular distance, three-dimensional perpendicular distance, three-dimensional parallel distance and three-dimensional Euclidean midpoint distance; The clustering module is configured to use a density-based clustering algorithm to cluster feature line segments based on the geometric similarity and output the clustering results. The trajectory generation module is configured to generate a three-dimensional representative trajectory based on the clustering results through main direction alignment, spatial sampling aggregation, and inverse coordinate transformation.
[0009] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric described in the first aspect.
[0010] Fourthly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric described in the first aspect.
[0011] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention first segments the trajectory using a minimum description length (MDL) principle that adapts to the characteristics of three-dimensional trajectories, and extracts key feature line segments; then, it designs and applies a novel composite three-dimensional similarity distance metric to accurately measure the geometric similarity between these three-dimensional line segments, comprehensively considering angle, perpendicular distance, parallel distance and Euclidean distance, to realize similarity calculation based on structural information and motion pattern; finally, it uses a density-based clustering algorithm to group line segments with similar shapes together according to the composite distance, thereby realizing accurate clustering of three-dimensional trajectories with the same motion pattern.
[0012] (2) Unlike general 3D point clustering, which ignores the temporal sequence of points and treats them as an unordered set, this invention specifies that the input trajectory data consists of 3D coordinate points arranged in chronological order. From the starting point of data processing, the chronological relationship of each trajectory point on the time axis is completely preserved. By preserving the original temporal order of the points, important structured information can be obtained, thereby analyzing the dynamic evolution, path direction, and continuity of the trajectory.
[0013] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0014] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute a limitation thereof.
[0015] Figure 1 This is a flowchart illustrating the main process of a three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric provided in an embodiment of the present invention. Figure 2 A detailed flowchart of a three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating an example of three-dimensional MDL trajectory feature segmentation provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of a three-dimensional similarity distance metric provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating an example of an original point provided in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating representative trajectory generation provided in an embodiment of the present invention; Figure 7 This is a comparative diagram of SSTC and TRACLUS provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the two-dimensional TRACLUS clustering results provided in an embodiment of the present invention; Figure 9 This is a schematic diagram illustrating the simple three-dimensional Euclidean distance line segment clustering provided in an embodiment of the present invention. Detailed Implementation
[0016] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0017] Explanation of technical terms 1. Trajectory segment: A three-dimensional straight line segment connecting two points in a trajectory; 2. Minimum Description Length (MDL) principle: An information theory criterion for model selection, seeking models that can describe data with the shortest encoding length. In this invention, it is used for adaptive trajectory segmentation. 3. Composite Distance Metric: This refers to a method that combines multiple different basic distance or similarity components to form a comprehensive metric. 4. Lehmer Mean: A generalized mean, which... The form is .
[0018] Example 1 like Figure 1 As shown, this embodiment discloses a three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric, including the following steps: S1: Acquire three-dimensional spatial trajectory data, perform dynamic programming segmentation based on the principle of minimum description length, and extract feature line segments that represent shape characteristics; S2: Construct a composite three-dimensional similarity distance metric algorithm, which calculates the geometric similarity between the feature line segments by weighted combination of three-dimensional angular distance, three-dimensional perpendicular distance, three-dimensional parallel distance and three-dimensional Euclidean midpoint distance; S3: Using a density-based clustering algorithm, cluster the feature line segments according to the geometric similarity and output the clustering results; S4: Based on the clustering results, a three-dimensional representative trajectory is generated through main direction alignment, spatial sampling aggregation, and inverse coordinate transformation.
[0019] The difference between 3D and 2D trajectories lies in their spatial appearance; while they may appear identical, their actual motion patterns differ. In a 2D scene, trajectories are often confined to planar motion, exhibiting relatively simple characteristics. However, in 3D space, trajectories can exhibit complex forms such as spiral ascent, vertical dive, and spatial entanglement. Even if they appear close in position on a 2D projection, their actual motion patterns can be vastly different. Therefore, motion pattern recognition becomes crucial in 3D trajectory analysis, and motion patterns rely on trajectory features for expression. However, existing technologies cannot acquire effective features when processing 3D trajectories and lack effective analysis methods based on these features. Therefore, this embodiment proposes a 3D trajectory clustering method (SSTC) based on a composite 3D similarity distance metric. Next, combined with… Figure 2 , and will be explained in detail.
[0020] S1: Acquisition and Standardization of 3D Trajectory Data Obtain a dataset D containing N 3D trajectories. Each trajectory... Composed of a series of three-dimensional coordinate points arranged in a time sequence composition.
[0021] Furthermore, to eliminate the influence of coordinate system and scale differences, coordinate transformation and scale normalization are performed to obtain the normalized trajectory. .
[0022] S2: Trajectory Feature Extraction Based on 3D MDL Applying the Minimum Description Length (MDL) principle, from the normalized trajectory (from a series of original line segments) Extract the set of feature line segments that can represent the main three-dimensional shape of the composition. S By simplifying complex trajectories into a few key line segments, the main characteristics of the trajectory can be characterized.
[0023] Segmentation is performed using the three-dimensional similarity distance metric in S3, by minimizing the total cost. Find the optimal feature point set { }:
[0024] Of which, total cost Including model cost and encoding cost By minimizing the total cost, the optimal feature point set { is obtained}. }, with feature point set { The trajectory is segmented based on the given information, thereby obtaining the optimal set of feature line segments.
[0025] Model cost It's based on 3D line segment length calculations and is used to penalize excessive segmentation. If the trajectory is divided too finely, meaning there are too many line segments and each segment is very short, It will get bigger. For each characteristic line segment Three-dimensional length After performing logarithmic square calculations and summing, This is to prevent abnormal situations such as line segment length being 0.
[0026] Encoding cost Based on the original line segment Corresponding feature line segments The deviation is calculated using the three-dimensional similarity between the two sides, and the deviation calculation incorporates the three-dimensional similarity distance metric defined in S3. Distance measures in terms of angle, It represents the distance metric in the vertical direction, reflecting the similarity fitting error in three-dimensional space, that is, the degree of difference between the original line segment and the feature line segment in terms of shape, direction, etc., and is also calculated by summing the logarithmic squares. and Please see below for the specific calculations and meanings.
[0027] To find the optimal segmentation that minimizes the total cost, dynamic programming is employed. Dynamic programming is an algorithmic strategy that efficiently solves a complex problem by decomposing it into a series of subproblems and storing the solutions to these subproblems to avoid redundant computation.
[0028] like Figure 3 The figure illustrates the results of adaptive segmentation of a 3D trajectory based on the Minimum Description Length (MDL) principle described in this embodiment. In the figure, a complete spiral 3D trajectory consists of a series of original line segments connecting points representing the original trajectory in chronological order; color changes represent temporal evolution. After dynamic programming segmentation based on the MDL principle, several red dots with black borders (such as "point 0", "point 9", "point 16"... "point 145") are identified. These points constitute the optimal feature point set { } represents the structural points of the trajectory. The colored line segments connecting these circular feature points are the extracted feature segments. These feature lines constitute a simplified representation of the original complex trajectory, preserving its main three-dimensional shape features.
[0029] Finally, a set of three-dimensional feature lines is output. This allows for the extraction of key trajectory features from the original trajectory.
[0030] The cost function proposed in this embodiment and This differs fundamentally from conventional two-dimensional computation. In two-dimensional computation, describing the shape of a trajectory primarily considers in-plane information, such as the length and angle of line segments on the plane. However, the cost function in this embodiment is for three-dimensional trajectories, taking into account factors in three-dimensional space, such as... and Similarity is measured from the angular differences and vertical offset angles in three-dimensional space, respectively. This does not exist in two-dimensional calculations, as the cross product of direction vectors in three-dimensional space (used for calculation) is not involved in two-dimensional calculations. ) and the perpendicular distance from the endpoint of a line segment to the line containing another line segment in three-dimensional space (used for calculation) (The operation of )
[0031] Therefore, this embodiment involves measuring the similarity between the original line segments and the feature line segments in terms of angle and vertical direction during the segmentation process. This allows the extracted feature line segments to more accurately represent the shape features of the trajectory in three-dimensional space, rather than being limited to the shape of a two-dimensional plane. This new cost function makes the MDL segmentation process tend to retain feature points and line segments that are more important to subsequent three-dimensional clustering. This improves the targeting and effectiveness of feature extraction, provides higher-quality input for subsequent clustering, and indirectly improves the final clustering accuracy. It can more accurately capture the complex features of three-dimensional trajectories, providing more reliable and comprehensive basic data support for subsequent applications such as analysis and decision-making based on three-dimensional trajectory data.
[0032] Traditional MDL segmentation only considers two-dimensional biases, failing to fully incorporate the features most important for subsequent shape clustering. This is in contrast to the principles of MDL computation. and In this embodiment, the "3D angular distance" and "3D perpendicular distance" defined in this embodiment are used to quantify similarity. This means that the segmentation process under the cost function of 3D segmentation has the ability to measure 3D shape. Therefore, this embodiment can more intelligently select feature points, prioritizing the retention of line segments that are more meaningful for subsequent shape-based clustering analysis, improving the effectiveness and relevance of feature extraction, and laying a more solid foundation for obtaining high-quality clustering results.
[0033] S3: Density clustering based on composite 3D similarity distance metric This step is the core of the invention, which achieves similarity clustering through a novel three-dimensional similarity distance metric and the DBSCAN algorithm.
[0034] Define and compute composite 3D composite distance metric Design a method that can comprehensively and accurately measure two three-dimensional feature lines. and The distance function for geometric similarity. The composite distance is constructed as follows:
[0035] in, This distance is used to reflect the degree of difference between two line segments. The smaller the distance value, the more similar the two line segments are; conversely, the greater the difference, the more similar the two line segments are. , , , These are weighting coefficients, used to adjust the 3D geometric features according to the application.
[0036] Visual representation of similarity distance measurement, such as Figure 4 This document demonstrates the visualization results of the distance measurement between two line segments in three-dimensional space in this embodiment. The red and blue solid lines represent the two line segments to be compared, respectively. The green dashed line and the "x" dot represent the perpendicular distance and its foot; the gray dotted line and the purple solid line represent the parallel distance and gap; the cyan dashed line represents the Euclidean distance between the midpoints; and the orange line and arc represent the angular distance. The calculations for each component are as follows: 1. Define three-dimensional angular distance To quantify directional differences:
[0037] In the formula, and Representing three-dimensional feature lines respectively and The unit direction vector; and Representing three-dimensional feature lines respectively and The length.
[0038] It is the cross product of two unit direction vectors, and the square of the magnitude of the cross product. It can reflect the degree of difference in direction between two line segments; the larger the modulus of the cross product, the greater the difference in direction. Indicates taking and The smaller of the lengths. This measure quantifies the difference in direction between two line segments by multiplying the degree of directional difference by the shorter segment length, thus taking into account both the directional difference and the segment's own length. For example, two shorter line segments with significantly different directions will have a relatively larger distance under this metric.
[0039] 2. Define the three-dimensional vertical distance To quantify the degree of parallel offset: Calculate the Lymer average based on the straight-line distance from the endpoint to the other ( ).
[0040]
[0041] In the formula, and They are three-dimensional feature lines. The two endpoints are calculated by taking the distance from these two endpoints to the line segment. The distance between two line segments is used to measure the degree of parallel offset between them. express The line in which it is located. This represents a very small positive constant, used to prevent the denominator from being zero and to ensure the stability of the formula calculation.
[0042] 3. Define three-dimensional parallel distance To quantify collinear proximity: calculate Projected to The interval on the straight line and interval minimum gap ; calculate Projected to The interval on the straight line and interval minimum gap ; Calculate the minimum gap in the collinear direction after the line segments are projected:
[0043] In the formula, and The two gaps reflect the degree of closeness of the two line segments in the collinear direction. Since a smaller gap in one direction indicates that the two line segments are relatively close in the collinear direction, we take... and The minimum value in is used as .
[0044] 4. Define the three-dimensional Euclidean midpoint distance To quantify relative spatial position:
[0045] In the formula, and They are three-dimensional feature lines. The two endpoints of the line segment. The relative spatial position of the two line segments is measured by calculating the Euclidean distance between their midpoints.
[0046] This embodiment creatively designs and combines four key three-dimensional geometric distance components—three-dimensional angular distance ( ), three-dimensional vertical distance ( ), three-dimensional parallel distance ( ) and three-dimensional Euclidean midpoint distance ( It also allows for linear combinations through weights. This is significantly different from existing technologies that only use Euclidean distance or simply extend two-dimensional distance, without fully considering three-dimensional characteristics and combinations of various geometric relationships.
[0047] The composite distance can accurately capture various geometric features between line segments in three-dimensional space, such as position, direction, parallel offset, and collinear proximity. This makes clustering based on this distance highly sensitive to changes in the shape and direction of three-dimensional trajectories, thereby achieving more refined and accurate clustering results and effectively distinguishing complex three-dimensional motion patterns.
[0048] Furthermore, DBSCAN clustering is performed using the feature segment set. S Sum of 4 three-dimensional composite distance metrics The standard DBSCAN process is performed, but the clustering parameters and metrics are entirely based on the composite 3D distance of this embodiment. The final output is the clustering result of three-dimensional trajectory segments. .
[0049] Simple 3D line segment clustering methods typically use only the 3D Euclidean distance between the midpoints of the line segments. This distance metric is extremely insensitive to shape features such as the direction, length, curvature, and torsion of the line segments, and is prone to incorrectly classifying trajectories that are spatially close but have very different shapes or motion trends into the same category.
[0050] The core innovation of this embodiment lies in the composite three-dimensional similarity distance metric. This distance is groundbreaking in that it simultaneously integrates four key three-dimensional geometric components. Capture the directional differences between line segments; Quantify the parallel offset between line segments; It measures the degree of proximity of line segments in collinear directions; These four components measure the relative distance between line segments in space. By weighting and combining these four components, the geometric similarity of three-dimensional line segments can be comprehensively measured. Therefore, this embodiment can effectively distinguish trajectory clusters with similar midpoint positions but different shapes or directions, such as distinguishing straight trajectories from adjacent curved trajectories, parallel but offset trajectories, and trajectories with opposite directions. This makes the clustering results more accurately reflect the inherent geometric patterns of the trajectories.
[0051] Due to the comprehensive consideration and precise measurement of three-dimensional characteristics, shape, and orientation, the clustering results generated by the method in this embodiment are more accurate than those of existing technologies, and can better group truly similar three-dimensional trajectories together. Furthermore, due to the robustness of distance metrics to geometric features, the clustering results are relatively less affected by noise and a small number of outlier trajectories, exhibiting stronger robustness. Representative three-dimensional trajectories can intuitively demonstrate the core three-dimensional morphology and motion trends of each cluster, improving the interpretability of the results.
[0052] S4: Generation of 3D Representative Trajectories The clustering results of the three-dimensional trajectory line segments are obtained through step S3. Subsequently, to provide an intuitive summary and quantitative description of the motion patterns implied in each cluster, a method was developed for each cluster. Calculate and generate a three-dimensional representative trajectory .
[0053] This representative trajectory, expressed by a simple, smooth three-dimensional curve, represents the central spatial path and spatiotemporal evolution trend reflected by all line segments within the cluster.
[0054] The basic process for generating this representative 3D trajectory is as follows: S401, Determine the three-dimensional principal directions of the clusters: Determine clusters The main direction of motion of the inner line segments as a whole is determined, and the unit direction vectors of all effective three-dimensional feature line segments within the cluster are extracted. Principal Component Analysis (PCA) is applied to process this set of direction vectors. The covariance matrix is calculated and eigenvalue decomposition is performed.
[0055] The eigenvector corresponding to the largest eigenvalue is selected as the principal direction vector of the cluster. This vector indicates the direction of maximum data variance, i.e., the primary direction of extension of line segments within a cluster.
[0056] Figure 5 This diagram illustrates the process of determining the three-dimensional principal direction of a cluster as described in this embodiment. In the figure, a series of colored dots represent the constituent points of all valid three-dimensional feature segments belonging to the same cluster. The colors of these dots are defined by the time color bar on the right, ranging from purple to yellow representing time from early to late, demonstrating the time-series characteristics of the trajectory points. From the geometric center of these point sets, three mutually orthogonal arrows are drawn: the red arrow, marked as the "principal direction," represents the direction with the largest variance in the cluster data calculated by Principal Component Analysis (PCA), indicating the most significant extension or movement trend of the trajectory within the cluster. The green arrow, marked as the "secondary direction," represents the direction with the second largest variance. The blue arrow, marked as the "third direction," represents the direction with the smallest variance.
[0057] S402, Perform three-dimensional spatial rotation alignment: To simplify subsequent processing along the principal direction, the entire cluster needs to be rotated in three-dimensional space so that the calculated principal direction vector... With Cartesian coordinate system The axes are parallel.
[0058] Calculate the amount of data required to perform this alignment operation. Rotation matrix Clustering This rotation matrix is applied to all feature segments within the matrix. Perform coordinate transformation to obtain the set of line segments after rotation transformation. .
[0059] S403, sample and aggregate along the principal axis to generate a representative point sequence: Determine the set of line segments after rotation Coordinate coverage on the aligned principal axis Within this range, scanning samples are taken along this main axis. The sampling method adopts an adaptive approach based on data density.
[0060] For each sampling location Identify All elements within the X' axis projection interval Line segments that are not active are called "active segments". For each active segment, a linear interpolation method is used to calculate its position in the x-axis. The coordinates of the intersection point of the plane perpendicular to the principal axis .
[0061] Collect all active line segments generated at this sampling location A set of coordinates. Regarding this... The coordinate set is aggregated to obtain the coordinates of a center representative point at the sampling location. The aggregation method used is median calculation.
[0062] Therefore, each sampling location Each of these points generates a corresponding three-dimensional representative point in a rotated coordinate system. After processing all sampling locations, an initial three-dimensional representative point sequence in a rotating coordinate system is obtained. .
[0063] S404, Perform a three-dimensional reverse rotation: To restore the generated representative point sequence to the original coordinate space, it is necessary to calculate the inverse matrix of the rotation matrix R used in S402. The initial representative point sequence Apply the inverse rotation matrix to each point in the matrix. Perform a coordinate transformation to obtain the final representative point sequence in the original coordinate system. .
[0064] Visualizing clustering results makes it easier to intuitively demonstrate the achievements and patterns of clustering, such as... Figure 6 As shown, the three-dimensional spiral ascent can be visually observed.
[0065] Figure 6 This figure illustrates the morphology of a representative 3D trajectory of a cluster generated in this embodiment. In the figure, a thick orange solid line represents the generated representative trajectory. This trajectory exhibits a smooth, spiraling upward shape, summarizing the core spatial path and spatiotemporal evolution trend commonly reflected by all the original feature segments within the cluster. Scattered in the background are many light gray dots, representing points on the original feature segments constituting the cluster. Compared to these scattered original points, the orange representative trajectory appears more concise, comprehensive, and representative. This figure visually demonstrates how this embodiment, through operations such as principal direction alignment, sampling aggregation along the principal axis, and inverse coordinate transformation, condenses a representative path that clearly expresses the cluster's motion pattern from complex cluster data.
[0066] In this embodiment, by determining the main direction of the clusters and performing rotational alignment, the main motion trends of each cluster can be accurately identified from the complex clustering results of 3D trajectory segments. This is expressed intuitively with concise, smooth curves, facilitating a quick understanding of the motion patterns within each cluster and achieving efficient summarization of trajectory data. Secondly, adaptive sampling and aggregation along the main axis to generate a representative point sequence, considering data density, effectively captures key features of the trajectory. Finally, the reverse rotation operation ensures that the final representative point sequence returns to the original coordinate space, guaranteeing the accuracy and practicality of the trajectory representation and providing a reliable and intuitive data foundation for subsequent applications such as 3D trajectory-based analysis and decision-making.
[0067] To verify the practical effectiveness of this embodiment, a comparative experiment was conducted on a publicly available 3D flight trajectory dataset. 500 original ADS-B system flight trajectory records from Dalian Zhoushuizi International Airport in October 2023 were randomly selected. The SSTC method of this embodiment was compared with the classic 2D TRACLUS method and a simple 3D Euclidean distance line segment clustering method.
[0068] like Figure 7 and Figure 8 The results of three clustering methods are shown. It can be seen that 2D TRACLUS confuses trajectories at different altitudes and cannot distinguish between ascent, descent, and other trajectory patterns.
[0069] Specifically, Figure 7This presentation comprehensively showcases the results of clustering a large-scale 3D trajectory dataset using this embodiment, including the original feature segments of each cluster and representative trajectories generated for the main clusters. Numerous thin colored lines in the figure, each color such as light blue, orange, green, and red, represent an independent cluster, as shown in the right-hand illustrations "Cluster 1 (595 segments)" and "Cluster 2 (1499 segments)." The lines themselves are the original feature segments that constitute these clusters. Among these thin lines, several thick trajectory lines are brightly colored with large colored dots, such as the dark blue trajectory on the far left marked "Representative Trajectory 1." These are representative trajectories generated for the identified main clusters, presenting the core motion patterns of each cluster in a smoother and more generalized form. The blue dashed trajectory lines on the bottom XY plane, as shown in the illustrations "2D Representative Trajectory 1 (Projection)" and "2D Representative Trajectory 2 (Projection)," are representative paths of the 2D trajectory clustering method, and are compared with these lines. This figure illustrates the overall effect of the method in this embodiment on processing complex 3D trajectory datasets. It can effectively identify trajectory clusters with different motion modes and generate representative 3D paths for each cluster.
[0070] The 2D TRACLUS algorithm completely ignores the z-axis information of the trajectory, and cannot distinguish between trajectories that are actually separated in 3D space but coincide or are close to each other in 2D projection. For example... Figure 8 This demonstrates the effectiveness of the 2D trajectory clustering method on 3D datasets by ignoring height information. Figure 7 In the diagram, "2D representative trajectory 1 (projection)" and "2D representative trajectory 2 (projection)" are labeled, with the blue line marking "trajectory 0" and the orange line marking "trajectory 1". These two lines represent the shapes of the representative trajectories of the two generated clusters on the XY plane. By observing the position and shape of these two trajectories on the two-dimensional plane, and comparing them... Figure 8 The three-dimensional clustering results show that the method in this embodiment can effectively distinguish trajectory clusters with different motion modes in three-dimensional space. The representative trajectories generated in this embodiment can clearly express the three-dimensional core motion modes of different clusters.
[0071] This embodiment directly processes three-dimensional coordinate data. Furthermore, this implementation considers three-dimensional spatial geometry in all core calculations. This enables it to accurately identify and distinguish trajectory clusters of different heights, different ascent or descent patterns, or those intertwined in three-dimensional space, fundamentally solving the problem of lost Z-axis information in two-dimensional methods. It can discover motion patterns that are only meaningful in three-dimensional space, achieving true three-dimensional spatial clustering and overcoming the fundamental limitations of two-dimensional methods.
[0072] The simple 3D Euclidean distance method clusters trajectories with different shapes but similar midpoints together, failing to form reasonable trajectories, such as... Figure 9The SSTC provided in this embodiment can accurately identify and separate complex patterns such as trajectory clusters with different climb rates and spatially intertwined but oriented trajectory clusters.
[0073] Figure 9 This demonstrates the results of clustering the same trajectory dataset using a simplified 3D clustering method, which uses only the 3D Euclidean distance between the midpoints of line segments as a similarity metric. This is used in conjunction with the method described in this embodiment (e.g., ...). Figure 7 A comparison of the effects is then performed. The figure shows numerous 3D line segments of varying colors, each color representing a cluster determined using this simple Euclidean distance method. This simple method is insensitive to the shape features of the line segments, such as direction and length. Therefore, it can be observed in this figure that even if line segments have completely different orientations or significantly different lengths, they may still be incorrectly grouped into the same cluster if their geometric midpoints are relatively close in 3D space. For example, many short line segments with random orientations but concentrated spatial locations are clustered together, which fails to reflect meaningful common motion patterns. This figure serves as a counterexample, demonstrating that, in contrast, the SSTC metric proposed in this embodiment can more accurately capture the true structure and motion similarity of trajectories.
[0074] This invention combines 3D MDL segmentation with density clustering based on composite 3D similarity distance metrics to form a systematic, end-to-end 3D trajectory clustering solution. This provides a complete processing flow specifically designed for 3D trajectory data, focusing on capturing shape and orientation. Compared to fragmented improvements or simple extensions of existing technologies, the integrated process of this invention ensures consistency and specificity from data preprocessing to the final clustering results, enabling more effective solutions to complex 3D trajectory clustering problems.
[0075] Example 2 This embodiment provides a three-dimensional trajectory clustering system based on a composite three-dimensional similarity distance metric, including: The segmentation module is configured to acquire three-dimensional spatial trajectory data, perform dynamic programming segmentation based on the principle of minimum description length, and extract feature line segments that represent shape features. The similarity calculation module is configured to construct a composite three-dimensional similarity distance metric algorithm, which calculates the geometric similarity between the feature line segments by weighted combination of three-dimensional angular distance, three-dimensional perpendicular distance, three-dimensional parallel distance and three-dimensional Euclidean midpoint distance; The clustering module is configured to use a density-based clustering algorithm to cluster feature line segments based on the geometric similarity and output the clustering results. The trajectory generation module is configured to generate a three-dimensional representative trajectory based on the clustering results through main direction alignment, spatial sampling aggregation, and inverse coordinate transformation.
[0076] Example 3 This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric as described in Embodiment 1 above.
[0077] Example 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric as described in Embodiment 1 above.
[0078] The steps or modules involved in Embodiments 2 to 4 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0079] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A three-dimensional trajectory clustering method based on a composite three-dimensional similarity distance metric, characterized in that, include: S1. Obtain three-dimensional spatial trajectory data, perform dynamic programming segmentation based on the principle of minimum description length, and extract feature line segments that represent shape characteristics. The dynamic programming segmentation includes: determining the optimal segmentation by minimizing the sum of model cost and encoding cost, wherein the model cost is based on the logarithmic square penalty of the length of the three-dimensional feature line segment, and the encoding cost is calculated based on the three-dimensional angular deviation and vertical deviation between the original line segment and the feature line segment. S2. Construct a composite three-dimensional similarity distance measurement algorithm, and calculate the geometric similarity between the feature line segments by weighted combination of three-dimensional angular distance, three-dimensional perpendicular distance, three-dimensional parallel distance and three-dimensional Euclidean midpoint distance; The three-dimensional angular distance is calculated by multiplying the square of the cross product of the unit direction vectors of the two line segments by the minimum length of the line segments, and is used to quantify the directional difference. The three-dimensional vertical distance is calculated using the Lymer average from the endpoint of the line segment to the opposite straight line, and is used to quantify the degree of parallel offset. The three-dimensional parallel distance is calculated by the minimum gap between the projection intervals of two line segments in the collinear direction, and is used to measure the degree of collinearity. The three-dimensional Euclidean midpoint distance is calculated by the square of the Euclidean distance between the midpoints of two line segments and is used to quantify the relative spatial position. S3. Using a density-based clustering algorithm, cluster the feature line segments according to the geometric similarity and output the clustering results; S4. Based on the clustering results, generate a three-dimensional representative trajectory through principal direction alignment, spatial sampling aggregation, and inverse coordinate transformation, including: S401. Determine the main direction of motion of the line segments within the cluster, extract the unit direction vectors of all effective three-dimensional feature line segments within the cluster, and apply principal component analysis to process the set of unit direction vectors. S402, Implement three-dimensional spatial rotation alignment; S403. Sample and aggregate along the principal axis to generate a representative point sequence; S404, Perform three-dimensional reverse rotation.
2. The three-dimensional trajectory clustering method based on composite three-dimensional similarity distance metric as described in claim 1, characterized in that, Before acquiring the three-dimensional spatial trajectory data, the process also includes: collecting the original three-dimensional spatial trajectory data, performing coordinate transformation and scale normalization processing to obtain standardized three-dimensional spatial trajectory data.
3. A three-dimensional trajectory clustering system based on a composite three-dimensional similarity distance metric, employing the method described in claim 1, characterized in that, include: The segmentation module is configured to acquire three-dimensional spatial trajectory data, perform dynamic programming segmentation based on the principle of minimum description length, and extract feature line segments that represent shape features. The similarity calculation module is configured to construct a composite three-dimensional similarity distance metric algorithm, which calculates the geometric similarity between the feature line segments by weighted combination of three-dimensional angular distance, three-dimensional perpendicular distance, three-dimensional parallel distance and three-dimensional Euclidean midpoint distance; The clustering module is configured to use a density-based clustering algorithm to cluster feature line segments based on the geometric similarity and output the clustering results. The trajectory generation module is configured to generate a three-dimensional representative trajectory based on the clustering results through main direction alignment, spatial sampling aggregation, and inverse coordinate transformation.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the three-dimensional trajectory clustering method based on composite three-dimensional similarity distance metric as described in any one of claims 1-2.
5. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the three-dimensional trajectory clustering method based on composite three-dimensional similarity distance metric as described in any one of claims 1-2.
Citation Information
Patent Citations
Wargame deduction system trajectory clustering algorithm based on space-time and combat marshalling
CN115062203A