Cross-camera vehicle tracking and trajectory matching method
By dynamically adjusting the clustering threshold and staged clustering strategy, combined with strict spatiotemporal constraints, the accuracy and stability problems of trajectory matching in multi-camera surveillance systems are solved, and high-precision merging and robustness of cross-camera trajectories are achieved.
Patent Information
- Application Number
- CN202511173531.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-08-21
AI Technical Summary
In the existing technology of multi-camera monitoring systems, trajectory matching has problems such as insufficient adaptability of fixed thresholds, lack of dynamic adaptability of clustering strategies, incomplete spatiotemporal constraints, and lack of posterior backtracking optimization, resulting in insufficient trajectory merging accuracy and stability.
A method of dynamically adjusting clustering thresholds, a staged clustering strategy, and strict spatiotemporal constraints is adopted. The confidence and duration features of trajectory segments are combined with ReID features to perform cross-camera trajectory matching, including feature information extraction, similarity calculation, multi-stage clustering, and spatiotemporal constraint merging.
The accuracy and robustness of trajectory matching are improved, over-merging or missed merging is avoided, the rationality and accuracy of trajectory merging are ensured, and the stability of the system in complex traffic scenarios is enhanced.
Smart Images

Figure CN120672803A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent transportation technology, and in particular to a method for cross-camera vehicle tracking and trajectory matching. Background Art
[0002] With the rapid development of intelligent transportation systems and computer vision technology, multi-camera monitoring networks have become a core component of modern traffic management systems. In complex traffic scenarios such as highways, service areas, and urban roads, the same vehicle is often captured in segments by multiple cameras, forming several independent trajectory segments. However, due to differences in monitoring angles, camera depth of field, and pixel specifications, the same vehicle in the video images of different cameras often shows significant differences in target size, shooting angle, image clarity, and target integrity. In addition, the spatiotemporal complexity of the vehicle's movement from one camera's field of view to another makes the collaborative association mechanism between multiple devices the key to cross-camera target trajectory matching. Therefore, how to accurately merge the trajectory segments of the same vehicle captured by different cameras, construct a complete cross-camera trajectory, and effectively avoid identity switching errors has become a core technical challenge that needs to be overcome in intelligent traffic monitoring systems.
[0003] Currently, mainstream multi-target multi-camera (MTMC) tracking technology generally uses a fixed-threshold trajectory segment similarity clustering method to achieve trajectory merging. However, this method has the following technical limitations: Fixed thresholds lack adaptability: A globally unified similarity threshold is used to perform trajectory merging, but the judgment criteria cannot be dynamically adjusted based on the quality characteristics of trajectory segments (such as confidence and completeness). This leads to the dual problems of high-confidence trajectories being over-merged due to threshold restrictions, and low-confidence trajectories being under-merged due to loose thresholds.
[0004] Clustering strategies lack dynamic adaptability: Relying on a single clustering strategy throughout the entire process fails to match the characteristics and requirements of different clustering stages (such as initial large-scale merging and later refined optimization), which can easily lead to incorrect trajectory association or omission of key segments.
[0005] The spatiotemporal constraint mechanism is not sound: The spatiotemporal constraint check for cross-camera trajectory merging is not systematic enough and does not fully cover physical rationality checks (such as temporal connection logic and spatial motion laws), which can easily lead to trajectory merging results that violate objective laws.
[0006] Lack of posterior backtracking optimization: After clustering is completed, no confidence assessment system and error correction mechanism for the merged results are established, making it difficult to identify low-quality merged trajectories and perform backtracking optimization, resulting in erroneous results that directly affect the overall tracking accuracy. Summary of the Invention
[0007] One of the objectives of the present application is to provide a cross-camera vehicle tracking and trajectory matching method that can solve at least one of the defects in the above-mentioned background technology.
[0008] To achieve at least one of the above purposes, the technical solution adopted in this application is: a cross-camera vehicle tracking and trajectory matching method, comprising the following steps: S100: Obtain vehicle trajectory segments detected by each camera and extract feature information of each trajectory segment, including ReID features, confidence, duration, and spatial position; S200: Calculating the similarity and clustering threshold of any two trajectory segments based on the feature information of the trajectory segments, and clustering the trajectory segments whose similarity is greater than or equal to the clustering threshold in sequence; S300: After each clustering is completed, the number of remaining unmerged trajectory segments is identified; the entire clustering process is divided into three stages: initial, intermediate, and final according to the number of remaining unmerged trajectory segments; the similarity values of the three stages are respectively the maximum similarity, the average similarity, and the minimum similarity; S400: performing time, space and connection relationship constraints on the cameras corresponding to the clustered trajectory segments, and merging the trajectory segments that satisfy all the constraints.
[0009] Preferably, in step S200, for the clustering threshold It is calculated by the confidence and duration of the trajectory segment. The specific calculation formula is as follows: ; ; in, and Represents the given highest and lowest thresholds respectively, Score represents the comprehensive score, norm conf Represents normalized confidence, norm dur represents the normalized duration, α represents the confidence weight, and β represents the duration weight.
[0010] Preferably, the normalization process of confidence and duration is suitable for normalizing the parameters of the actual range to the interval [0, 1]; the normalized confidence norm conf and normalized duration norm dur The expression is as follows: ; ; Among them, avg conf Represents the average confidence of two trajectory segments, conf maxand conf min Respectively represent the preset maximum and minimum confidence values; duration represents the number of frames of the trajectory segment with fewer frames in the two trajectory segments, dur max and dur min Respectively represent the maximum and minimum duration of the preset track segment.
[0011] Preferably, the lower limit of the clustering threshold is set to 0.5-0.6; when calculating the clustering threshold of the trajectory segment in step S200, if the duration of the trajectory segment is less than 10 frames or the average confidence is lower than 0.3, the set lower limit is used as the calculated value of the clustering threshold for comparison with the similarity.
[0012] Preferably, in step S300, if the number of remaining trajectory segments is greater than or equal to 30% of the total number of trajectory segments, it is defined as the initial stage; if the number of remaining trajectory segments is greater than 5% of the total number of trajectory segments and less than 30% of the total number of trajectory segments, it is defined as the mid-term stage; if the number of remaining trajectory segments is less than or equal to 5% of the total number of trajectory segments, it is defined as the ending stage.
[0013] Preferably, when clustering the trajectory segments in step S300, the trajectory segments of different cameras are clustered; wherein the maximum similarity sim single , average similarity sim average And the minimum similarity sim complete The calculation formula is as follows: ; ; ; ; Among them, sim(T i , T j ) represents the trajectory segment T corresponding to any two cameras i and T j The cosine similarity of M i and M j Respectively represent all trajectory segments T i and T j A and B represent the trajectory clusters M i and M j The number of trajectory segments within and Represents the trajectory segment T i and T j ReID features.
[0014] Preferably, when performing step S400, the following four constraints are set for the merging of trajectory segments: a same-camera frame overlap constraint is set to prevent the two trajectory segments to be merged from coming from the same camera; a position overlap constraint is set for camera pairs with non-overlapping fields of view to prevent trajectories with similar ReID features but too far apart in space from being mistakenly merged; an adjacent camera constraint is set to avoid impossible cross-camera merging; and a time window constraint is set to avoid merging two trajectory segments with too short or too long intervals.
[0015] Preferably, a confidence calculation is performed on the trajectory segment obtained after merging multiple trajectory segments in step S400; if the calculated confidence is lower than a set threshold, the corresponding trajectory segment is split; if the calculated confidence is higher than the set threshold, the trajectory segment is retained.
[0016] Preferably, the confidence C for each trajectory segment i The calculation formula is as follows: ; ; ; Among them, w1, w2 and w3 represent the internal similarity C internal , trajectory quality C quality and spatial consistency C spatial The weight of the trajectory; N represents the number of trajectory pairs in the trajectory segment, quality (T k ) represents the trajectory segment T in the trajectory segment k The quality of K represents the number of all trajectory segments in the trajectory segment, and the spatial consistency C spatial It is calculated by the spatial distribution of each trajectory segment in the world coordinate system.
[0017] Preferably, for the trajectory segment T k Quality (T k ) is calculated as follows: ; ; ; in, Represents the trajectory segment T k The confidence quality of Represents the trajectory segment T k The quality of duration, Represents the trajectory segment T k The mean confidence of all detection frames, Represents the trajectory segment T k The number of continuous frames.
[0018] Compared with the prior art, the present invention has the following advantages: (1) This application dynamically adjusts the clustering threshold based on the confidence level, duration and other characteristics of the trajectory segments, and adopts different merging strategies for trajectory segments of different qualities, thereby improving the accuracy and robustness of trajectory matching.
[0019] (2) This application adopts a phased clustering strategy and dynamically adjusts the clustering method according to the number of remaining unmerged trajectory segments. This not only makes full use of the various feature information of the trajectory segments, but also avoids the problems of over-merging or missing merging, thereby improving the accuracy and stability of trajectory matching.
[0020] (3) Compared with the traditional method that only relies on feature similarity to merge trajectories, this application ensures the rationality of trajectory merging through strict spatiotemporal constraints, effectively preventing physically impossible phenomena such as "teleportation" and "excessive stay". BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of the overall working steps of this application.
[0022] Figure 2 This is a schematic diagram of the overall implementation process of this application. DETAILED DESCRIPTION
[0023] Below, the present application is further described in conjunction with specific implementation methods. It should be noted that, in the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.
[0024] In the description of this application, it should be noted that for directional words, such as the terms "center", "horizontal", "longitudinal", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and so on, indicating the orientation and position relationship are based on the orientation or position relationship shown in the accompanying drawings, which is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and cannot be understood as limiting the specific scope of protection of this application.
[0025] It should be noted that the terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0026] In this application, unless otherwise expressly specified or limited, terms such as "mounted," "connected," "connect," and "fixed" should be understood in a broad sense. For example, they may refer to connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; and internal communication between two components or interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on specific circumstances.
[0027] In this application, unless otherwise expressly specified or limited, a first feature being "above" or "below" a second feature may include the first and second features being in direct contact, or may include the first and second features being in contact not directly but through another feature between them. Moreover, a first feature being "above," "above," and "above" a second feature may include the first feature being directly above or obliquely above the second feature, or may simply mean that the first feature is higher in level than the second feature. A first feature being "below," "below," and "below" a second feature may include the first feature being directly below or obliquely below the second feature, or may simply mean that the first feature is lower in level than the second feature.
[0028] The terms "comprises" and "having" and any variations thereof in the specification and claims of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units expressly listed, but may include other steps or units not expressly listed or inherent to such process, method, product or apparatus.
[0029] One of the preferred embodiments of this application is as follows: Figure 1 and Figure 2As shown, a cross-camera vehicle tracking and trajectory matching method includes the following steps: S100: Obtain vehicle trajectory segments detected by each camera and extract feature information of each trajectory segment, where the feature information includes ReID features, confidence, duration, and spatial position.
[0030] It should be noted that ReID features are typically represented by a fixed-dimensional vector. In this step, the ReID feature is the weighted average of the detection box areas of the ReID feature vectors of all frames in the trajectory segment, reflecting the appearance identity characteristics of the trajectory segment. Confidence indicates the degree to which the system trusts the trajectory segment, reflecting the overall detection quality of the trajectory segment. Duration represents the time span of the entire trajectory segment formation process, reflecting the time span information of the trajectory segment. Spatial position represents the position of the trajectory segment in spatial coordinates, reflecting the spatial distribution information of the trajectory segment in the monitoring scene.
[0031] After extracting the ReID features, confidence, duration, spatial location, and other information for each trajectory segment, normalization is performed to eliminate dimensional differences between different features. At the same time, a spatial relationship model is established between the cameras, including camera position, field of view, and adjacency.
[0032] S200: Calculating the similarity and clustering threshold of any two trajectory segments based on feature information of the trajectory segments, and clustering the trajectory segments whose similarity is greater than or equal to the clustering threshold in sequence.
[0033] It should be noted that each camera may correspond to multiple trajectory segments, and the purpose of clustering is to aggregate the trajectory segments with higher feature similarity among the trajectory segments corresponding to different cameras.
[0034] S300: After each clustering is completed, the number of remaining unmerged trajectory segments is identified; the entire clustering process is divided into three stages: initial, intermediate, and final, depending on the number of remaining unmerged trajectory segments; the similarity values of the three stages are respectively the maximum similarity, the average similarity, and the minimum similarity.
[0035] It should be noted that when clustering, there may be some trajectory segments that meet the feature similarity requirements but obviously do not conform to the physical spatiotemporal relationship. Therefore, it is necessary to prevent the merging of trajectory segments in this situation.
[0036] S400: performing time, space and connection relationship constraints on the cameras corresponding to the clustered trajectory segments, merging the trajectory segments that satisfy all the constraints to obtain at least one corresponding trajectory segment.
[0037] It is understandable that the technology of the present application can dynamically adjust the clustering threshold according to the confidence, duration and other characteristics of the trajectory segment, thereby solving the problem of poor adaptability of the traditional method using a fixed threshold. By comprehensively considering multiple features such as confidence and duration, different merging strategies can be adopted for trajectory segments of different qualities, thereby improving the accuracy and robustness of trajectory matching. When performing clustering, the present application adopts a phased clustering strategy and dynamically adjusts the clustering method according to the number of remaining trajectories. Not only can it make full use of the various feature information of the trajectory segments, but it can also avoid the problem of over-merging or missed merging, thereby improving the accuracy and stability of trajectory matching. Compared with the traditional method that only relies on feature similarity for trajectory merging, the present application ensures the rationality of trajectory merging through strict spatiotemporal constraints, and effectively prevents physically impossible phenomena such as "teleportation" and "extra-long stay". For ease of understanding, each step will be described in detail below.
[0038] In this embodiment, when performing step S200, the clustering threshold is determined by the confidence and duration of the trajectory segment. Dynamic calculation of. For any two single camera trajectory segments T i and T j The clustering threshold The calculation formula is: .
[0039] .
[0040] in, and Represents the given highest and lowest thresholds respectively, Score represents the comprehensive score, norm conf Represents normalized confidence, norm dur represents the normalized duration, α represents the confidence weight, and β represents the duration weight.
[0041] It should be noted that the traditional method generally only gives [ , ] is used as a fixed clustering threshold for clustering; in the technical solution of the present application, the clustering threshold is dynamically calculated by introducing confidence and duration, so that the clustering threshold can be adaptive. The specific values of the confidence weight α and the duration weight β can be determined according to the actual needs of those skilled in the art; in this embodiment, the value of the confidence weight α is preferably 0.6~0.8, and the value of the duration weight β is preferably 0.2~0.4; more preferably, the value of the confidence weight α is 0.7, and the value of the duration weight β is 0.3.
[0042] It is understandable that the confidence level is usually a probability value between 0 and 1, which is a dimensionless value; while the unit of duration is generally seconds, which is a dimensionless value. If the two are directly used to calculate the clustering threshold, it will lead to inconsistent dimensions; therefore, in this embodiment, the confidence level and duration are normalized, and the actual range parameters of both are mapped to a unified interval, that is, normalized to the interval [0, 1], to obtain the corresponding normalized confidence level norm conf and normalized duration norm dur ; Among them, the normalized confidence norm conf and normalized duration norm dur The expression is as follows: .
[0043] Among them, avg conf Represents two trajectory segments T i and T j The average confidence level of max and conf min Respectively represent the preset maximum and minimum confidence values. The specific values can be determined by those skilled in the art according to their actual needs. In this embodiment, conf max The value of conf is 0.8~1, min The value of conf is 0.2~0.4, and the more preferred conf max =0.9,conf min =0.3. By normalizing the confidence norm conf , the actual confidence range [0.3, 0.9] can be normalized to the interval [0, 1], that is, the detection results with confidence lower than 0.3 are truncated to norm conf =0, the detection results with confidence higher than 0.9 are adjusted to norm conf =1.
[0044] .
[0045] Among them, duration represents the number of frames of the trajectory segment with fewer frames in the two trajectory segments, and dur max and dur min They represent the maximum and minimum values of the preset track segment duration respectively. The specific values can be determined by those skilled in the art according to their actual needs. In this embodiment, dur max The value of is 40~60, dur min The value of dur is 5~15, and the more preferred value is dur max =50,dur min = 10. By normalizing the duration norm dur, the actual duration range [10, 50] can be normalized to the interval [0, 1], that is, the detection results with a duration less than 10 frames are truncated to norm dur =0, the detection result of duration longer than 50 frames is adjusted to norm dur =1.
[0046] In this embodiment, when calculating the clustering threshold, a preliminary assessment of the quality of the trajectory segments can be performed based on their confidence and duration. Based on this assessment, the trajectory segments can be classified as low-quality or high-quality. Specifically, trajectory segments with a duration of less than 10 frames or an average confidence score below 0.3 can be defined as low-quality. For these low-quality trajectory segments, the clustering threshold calculation results are often lower than the average threshold. For example, a clustering threshold of 0.2 to 0.3 can result in two trajectory segments with low similarity being clustered together.
[0047] Therefore, in this embodiment, to prevent incorrect clustering and merging of low-quality trajectory segments, a protection mechanism can be implemented for low-quality trajectory segments. Specifically, a lower limit for the clustering threshold is set between 0.5 and 0.6, preferably 0.55. When the clustering threshold calculated in step S200 is lower than the set lower limit, if the duration of the trajectory segment is less than 10 frames or the average confidence level is lower than 0.3, the set lower limit is used as the calculated clustering threshold value and compared with the similarity. This protection mechanism can forcibly increase the clustering threshold corresponding to low-quality trajectory segments to no less than 0.55, preventing incorrect merging of low-quality trajectory segments and ensuring the reliability of the merging results.
[0048] In this embodiment, Figure 2 As shown in the figure, after acquiring trajectory segment data from all cameras capturing vehicle motion trajectories, these trajectory segment data can be aggregated to form a trajectory segment set. During clustering, the system also maintains a residual trajectory segment set. Specifically, during each clustering operation, the trajectory segments being clustered are extracted from the trajectory segment set, and the remaining unmerged trajectory segments form a residual trajectory segment set. Based on the number of trajectory segments in the residual trajectory segment set, the entire clustering process can be divided into three phases: initial, mid-term, and final. In the initial phase, a single linkage approach is used to quickly merge locally similar trajectories. In the mid-term, an average linkage approach is used to balance local and global similarities. In the final phase, a full linkage approach is used to strictly constrain cluster compactness. Traditional methods often use a strict linkage approach in the early stages of clustering, which can easily lead to over-merging; or they use a loose linkage approach in the later stages of clustering, which can easily lead to missed merges.
[0049] It is understandable that in each clustering process, the system will select the corresponding similarity value method according to the number of currently remaining trajectory segments to calculate the similarity, and determine whether the merging condition is met based on the ratio of the similarity to the clustering threshold. i and T j Only when the similarity of the formed trajectory pairs is greater than or equal to the calculated clustering threshold and meets the spatiotemporal constraints will they be merged into new multi-camera trajectory segments. As trajectory segments are continuously merged, the size of the remaining trajectory segment set gradually decreases. The system will dynamically switch between different clustering methods based on the number of remaining trajectory segments, realizing a multi-stage clustering process from coarse to fine and from local to global.
[0050] Specifically, in step S300, the three-stage division process of the entire clustering process is as follows: If the number of remaining trajectory segments is greater than or equal to 30% of the total number of trajectory segments, it can be defined as the initial stage, and the similarity is calculated using the maximum similarity of the single-link method. If the number of remaining trajectory segments is greater than 5% of the total number of trajectory segments and less than 30% of the total number of trajectory segments, it can be defined as the mid-stage, and the similarity is calculated using the average similarity of the average-link method. If the number of remaining trajectory segments is less than or equal to 5% of the total number of trajectory segments, it can be defined as the final stage, and the similarity is calculated using the minimum similarity of the full-link method.
[0051] It's understandable that the entire clustering process is performed in multiple steps, or rounds. During each round, for a single trajectory pair, either only the similarity of the corresponding method is calculated, as per the clustering phase, or similarity of all three methods is calculated simultaneously, with only the corresponding value outputted according to the clustering phase. The entire clustering process employs a greedy strategy, merging the trajectory pairs with the highest similarity each time. After merging, the merged trajectory segments are removed from the set of remaining trajectory segments, and the newly merged segments continue to participate in the subsequent clustering process. This iterative merging strategy ensures the continuity and consistency of the clustering process.
[0052] For ease of understanding, we can use two trajectory clusters M corresponding to multi-camera trajectories as follows i and M j The merging process of the maximum similarity sim single , average similarity sim average And the minimum similarity sim complete The specific calculation process of trajectory cluster M is described below. i There are A trajectory segments T i , trajectory cluster M j There are B trajectory segments T j; The values of A and B are at least 1, and each trajectory segment comes from a different camera.
[0053] Specifically, two trajectory clusters M i and M j The similarity between two single-camera trajectory segments T is measured by the ReID features of their internal single-camera trajectory segments. i With T j The similarity between them is defined as the ReID features of the two and The cosine similarity sim(T i , T j ), cosine similarity sim(T i , T j ) is calculated as follows: .
[0054] For two corresponding multi-camera trajectories, the trajectory cluster M i and M j The clustering of different stages can be done by the cosine similarity mentioned above Perform two trajectory clusters M i and M j Calculate the similarity between .
[0055] For the single link method, two trajectory clusters M i and M j The similarity between them is defined as the maximum similarity sim between any two single camera trajectory segments single , maximum similarity sim single The specific calculation formula is as follows: .
[0056] For the average linking method, two trajectory clusters M i and M j The similarity between them is defined as the average similarity sim between all corresponding single camera trajectories average , average similarity sim average The specific calculation formula is as follows: .
[0057] For the full link approach, two trajectory clusters M i and M j The similarity between them is defined as the minimum similarity sim between any two corresponding single camera trajectories complete , minimum similarity sim complete The specific calculation formula is as follows: .
[0058] In this embodiment, Figure 2 As shown in the figure, during the trajectory association process of multi-camera target tracking, two trajectory segments are merged into the same target only when the temporal, spatial, and camera connection relationships are reasonable. This can effectively improve the physical rationality and robustness of the multi-camera target tracking system and avoid false associations caused by unreasonable temporal and spatial relationships. Therefore, before merging trajectory segments, spatiotemporal constraints need to be imposed on the clustered trajectory segments. This constraint mechanism not only improves the accuracy of trajectory matching, but also enhances the robustness of the system in complex traffic scenarios, providing a reliable physical foundation for multi-camera target tracking.
[0059] Based on the above, the spatiotemporal constraints in step S400 can be mainly divided into the following four types: Same camera frame overlap constraint: If two trajectory segments T i and T j If objects from the same camera overlap in the same frame, i.e., are detected at the same time, they are definitely not the same object. Setting this constraint prevents objects with similar appearance from being mistakenly merged within the same camera and frame.
[0060] Position overlap constraint for camera pairs with non-overlapping fields of view: If two cameras do not overlap in field of view, their image coordinates are converted to a unified 3D world coordinate system using the homography matrix to determine whether the track segments overlap in world coordinates. If there is spatial overlap, the mean world coordinate distance between the two track segments in the overlapping frames is calculated. If the mean is above a set threshold, the two tracks are considered to not belong to the same target. This constraint uses spatial distance information to assist in track merging, preventing tracks with similar ReID features but large spatial distances from each other from being mistakenly merged.
[0061] Adjacency Constraint: This constraint uses a predefined camera adjacency table to analyze whether an object can possibly move from one camera's field of view to another. This constraint is used to prevent impossible cross-camera merges, such as on a one-way highway.
[0062] Time window constraint: Whether two track segments are physically connected also considers the reasonable time interval between the target disappearing from one camera and appearing in another. Tracks are considered likely to belong to the same target only if the time interval is within the allowed minimum and maximum ranges. This constraint is used to prevent unreasonable merging such as "teleportation" or "extremely long dwells."
[0063] As can be seen from the foregoing, in this embodiment, the clustering and merging of trajectory segments is performed based on analysis and processing of individual trajectory segments or trajectory clusters comprising multiple trajectory segments, without analyzing and processing the resulting trajectory segments after merging. Therefore, after completing the merging of the trajectory segments in step S400, this embodiment can perform confidence backtracking correction on the resulting trajectory segments. This effectively identifies and corrects erroneous merging during the clustering process, ensuring that the final output multi-camera trajectory segments have high accuracy and reliability.
[0064] Specifically, such as Figure 2 As shown in FIG, after the trajectory pairs are clustered and merged to form trajectory segments, the confidence of each trajectory segment can be calculated and evaluated; if the calculated confidence is lower than the set threshold, the corresponding trajectory segment is split; if the calculated confidence is higher than the set threshold, the trajectory segment is retained and output; the specific value of the threshold for confidence judgment can be selected according to the actual needs of those skilled in the art. For each trajectory segment, the confidence C i The calculation formula is as follows: .
[0065] .
[0066] .
[0067] Among them, w1, w2 and w3 represent the internal similarity C internal , trajectory quality C quality and spatial consistency C spatial The specific values of w1, w2 and w3 can be determined by those skilled in the art according to their actual needs. Preferably, the values of w1, w2 and w3 are: w1=0.5, w2=0.3, w3=0.2. K represents the number of all track segments in a track segment, and N represents the number of track pairs in a track segment. Generally speaking, N=K-1. quality(T k ) represents the trajectory segment T in the trajectory segment k Quality, spatial consistency C spatial The calculation is performed by calculating the spatial distribution of each trajectory segment in the world coordinate system. The specific calculation process is a well-known technology for those skilled in the art and will not be elaborated here in detail.
[0068] It is understandable that the trajectory segment T k The quality of is related to its own confidence and duration, which can be measured by the average of the two. For the trajectory segment T k Quality (T k ) is calculated as follows: .
[0069] .
[0070] .
[0071] in, Represents the trajectory segment T k The confidence quality of Represents the trajectory segment T k The quality of duration, Represents the trajectory segment T k The confidence mean of all detection frames. Tracks with low confidence mean are more likely to be misdetected or incomplete targets. Represents the trajectory segment T k The number of frames of duration is greater than that of the original image. Trajectories with short duration are more likely to be occasional noise or false detection.
[0072] It can be understood that the above-mentioned adaptive trajectory quality control and error correction strategy, combined with the aforementioned adaptive threshold (clustering threshold) calculation, multi-stage clustering strategy and spatiotemporal constraint checking, together constitute the core technical framework of the cross-camera trajectory matching system of this application. This framework can not only handle complex cross-camera target association problems, but also has good robustness and adaptability, and can cope with various challenges in different scenarios. Compared with traditional methods, this application can identify and correct erroneous merging results and automatically split low-confidence trajectories, thereby improving the reliability and robustness of trajectory matching. Under the unified evaluation framework, the geometric relationship between each trajectory segment is clearer, which helps to quantitatively analyze the rationality of the trajectory structure, thereby improving the stability and spatial adaptability of trajectory matching.
[0073] The above describes the basic principles, main features, and advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above-described embodiments. The above-described embodiments and the specification merely illustrate the principles of the present application. Various changes and improvements may be made to the present application without departing from the spirit and scope of the present application. These changes and improvements fall within the scope of the present application for which protection is sought. The scope of protection claimed by the present application is defined by the appended claims and their equivalents.
Claims
1. A cross-camera vehicle tracking and trajectory matching method, characterized in that: The steps include: S100: Obtain vehicle trajectory segments detected by each camera and extract feature information of each trajectory segment, including ReID features, confidence, duration, and spatial position; S200: Calculating the similarity and clustering threshold of any two trajectory segments based on the feature information of the trajectory segments, and clustering the trajectory segments whose similarity is greater than or equal to the clustering threshold in sequence; S300: After each clustering is completed, the number of remaining unmerged trajectory segments is identified; the entire clustering process is divided into three stages: initial, intermediate, and final according to the number of remaining unmerged trajectory segments; the similarity values of the three stages are respectively the maximum similarity, the average similarity, and the minimum similarity; S400: performing time, space and connection relationship constraints on the cameras corresponding to the clustered trajectory segments, and merging the trajectory segments that satisfy all the constraints.
2. The cross-camera vehicle tracking and trajectory matching method according to claim 1, characterized in that: In step S200, for the clustering threshold It is calculated by the confidence and duration of the trajectory segment. The specific calculation formula is as follows: ; ; in, and Represents the given highest and lowest thresholds respectively, Score represents the comprehensive score, norm conf Represents normalized confidence, norm dur represents the normalized duration, α represents the confidence weight, and β represents the duration weight.
3. The cross-camera vehicle tracking and trajectory matching method according to claim 2, characterized in that: Normalization of confidence and duration is suitable for normalizing the parameters of the actual range to the interval [0, 1]; Normalized confidence norm conf and normalized duration norm dur The expression is as follows: ; ; Among them, avg conf Represents the average confidence of two trajectory segments, conf max and conf min Respectively represent the preset maximum and minimum confidence values; duration represents the number of frames of the trajectory segment with fewer frames in the two trajectory segments, dur max and dur min Respectively represent the maximum and minimum duration of the preset track segment.
4. The cross-camera vehicle tracking and trajectory matching method according to any one of claims 1 to 3, characterized in that: Set the lower limit of the clustering threshold to 0.5~0.6; When calculating the clustering threshold of the trajectory segment in step S200 , if the duration of the trajectory segment is less than 10 frames or the average confidence is lower than 0.3, the set lower limit value is used as the calculated value of the clustering threshold and compared with the similarity.
5. The cross-camera vehicle tracking and trajectory matching method according to claim 1, characterized in that: In step S300 , if the number of remaining trajectory segments is greater than or equal to 30% of the total number of trajectory segments, it is defined as the initial stage; If the number of remaining trajectory segments is greater than 5% of the total number of trajectory segments and less than 30% of the total number of trajectory segments, it is defined as the mid-stage; If the number of remaining trajectory segments is less than or equal to 5% of the total number of trajectory segments, it is defined as the closing stage.
6. The cross-camera vehicle tracking and trajectory matching method according to claim 1, characterized in that: When clustering the trajectory segments in step S300, the trajectory segments of different cameras are clustered; wherein the maximum similarity sim single , average similarity sim average And the minimum similarity sim complete The calculation formula is as follows: ; ; ; ; Among them, sim(T i , T j ) represents the trajectory segment T corresponding to any two cameras i and T j The cosine similarity of M i and M j Respectively represent all trajectory segments T i and T j A and B represent the trajectory clusters M i and M j The number of trajectory segments within and Represents the trajectory segment T i and T j ReID features.
7. The cross-camera vehicle tracking and trajectory matching method according to claim 1, characterized in that: When performing step S400, the following four constraints are set for merging the trajectory segments: Set the same camera frame overlap constraint to avoid merging two trajectory segments from the same camera; Set position overlap constraints for pairs of cameras with non-overlapping fields of view to prevent trajectories with similar ReID features but too far apart from each other from being incorrectly merged; Set up adjacent camera constraints to avoid impossible cross-camera merges; Set time window constraints to avoid merging two trajectory segments with too short or too long intervals.
8. The cross-camera vehicle tracking and trajectory matching method according to claim 1, characterized in that: Calculating the confidence of the trajectory segment obtained by merging the multiple trajectory segments in step S400; If the calculated confidence is lower than the set threshold, the corresponding trajectory segment will be split; If the calculated confidence is higher than the set threshold, the trajectory segment is retained.
9. The cross-camera vehicle tracking and trajectory matching method according to claim 8, characterized in that: The confidence C for each trajectory segment i The calculation formula is as follows: ; ; ; Among them, w1, w2 and w3 represent the internal similarity C internal , trajectory quality C quality and spatial consistency C spatial The weight of the trajectory; N represents the number of trajectory pairs in the trajectory segment, quality (T k ) represents the trajectory segment T in the trajectory segment k The quality of K represents the number of all trajectory segments in the trajectory segment, and the spatial consistency C spatial It is calculated by the spatial distribution of each trajectory segment in the world coordinate system.
10. The cross-camera vehicle tracking and trajectory matching method according to claim 9, characterized in that: For the trajectory segment T k Quality (T k ) is calculated as follows: ; ; ; in, Represents the trajectory segment T k The confidence quality of Represents the trajectory segment T k The quality of duration, Represents the trajectory segment T k The mean confidence of all detection frames, Represents the trajectory segment T k The continuous number of frames, conf max and conf min Respectively represent the preset maximum and minimum confidence values, dur max and dur min Respectively represent the maximum and minimum duration of the preset track segment.
Citation Information
Patent Citations
Spectral clustering analysis-based just-in-time learning modeling method
CN107403196A
Social network user recommendation method and system
CN119226612A
Image segmentation method and device
CN119251503A
Deep learning-based camera-crossing vehicle target tracking method, system and device in expressway tunnel, and medium
CN119359769A
Method, device and equipment for tracking multiple vehicles across cameras on expressway
CN120339329A
Cited By
Cross-device multi-target tracking method and system
CN121304723A
Image data retrieval method and system based on monitoring big data
CN121765104A
Image Data Retrieval Method and System Based on Big Data Surveillance
CN121765104B