Vehicle tracking and re-identification system in highway scene
Through the collaborative work of RT-DETR, TransReID and BoT-Sort modules, combined with confidence-Laplacian variance screening, hierarchical matching and adaptive histogram filtering, the problems of mismatching and trajectory breakage in vehicle re-identification in highway scenarios are solved, and efficient and accurate vehicle tracking and re-identification are achieved.
Patent Information
- Application Number
- CN202510916551.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-03
AI Technical Summary
In closed highway monitoring scenarios, existing technologies have problems such as low camera pixels, poor installation stability, high re-identification mismatch rate due to similar vehicle appearance, significant image blur, jitter and noise, poor robustness of cross-view feature matching, and a surge in computational complexity and latency.
The RT-DETR detection module extracts multi-scale feature maps through a lightweight CNN network, performs global attention through the Transformer Encoder, and filters key frames in combination with the confidence-Laplacian variance pre-screening module; the TransReID module extracts global context and local detail features through a pre-trained Transformer model to perform vehicle appearance matching; the BoT-Sort module predicts vehicle position based on Kalman filtering and eliminates unreasonable matches; the system constructs a homography matrix for mapping, uses hierarchical matching and adaptive histogram filtering modules to eliminate color deviations, and combines motion constraints with the Kalman filter module to smooth the trajectory.
It significantly improves the accuracy of vehicle re-identification and the connectivity and smoothness of trajectories, reduces misassociation and trajectory breakage, improves the robustness and efficiency of cross-camera re-identification, and ensures the reliability and accuracy of monitoring.
Smart Images

Figure CN120747167A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of computer vision and video image processing, and in particular to a vehicle tracking and re-identification system in a highway scenario. Background Art
[0002] With the widespread adoption of intelligent transportation systems, collaborative multi-camera monitoring on highways has become a key approach for vehicle trajectory tracking. However, existing technologies in closed highway scenarios face challenges such as low base pixel count and poor installation stability. High-speed vehicle motion leads to image blur and significant jitter noise. Complex scenes, high numbers of vehicles with similar appearances (especially cars of the same model) and near-constant unidirectional motion lead to a surge in false positive re-identification (false match) rates. Furthermore, differences in lighting conditions, lens aging, and white balance strategies between cameras cause color distortion, limiting the robustness of cross-view feature matching.
[0003] The current mainstream solution relies on general-purpose detectors for frame-by-frame detection. Relying solely on general-purpose detectors to extract in-frame features and blindly match them in global space can not only lead to a large number of false associations between similar vehicles, but also increase computational complexity and latency. Furthermore, cameras cannot be absolutely stable in their installation position. Even slight jitter can introduce noise in the position and size of the detection frame, making it difficult to maintain a smooth and coherent trajectory based on "frame-to-frame" stitching. Summary of the Invention
[0004] To address the above-mentioned shortcomings, the present invention proposes a vehicle tracking and re-identification system for highway scenarios. It systematically optimizes the special challenges of closed highway monitoring scenarios, significantly improves the accuracy of vehicle re-identification, and the connectivity and smoothness of trajectories, providing reliable technical support for intelligent traffic monitoring.
[0005] To achieve the above-mentioned object, the present invention provides the following technical solutions: a vehicle tracking and re-identification system in a highway scenario, comprising: RT-DETR detection module: This module extracts multi-scale feature maps using a lightweight CNN network and flattens them into positional encoding vectors using the TransformerEncoder to perform global attention. Learnable ObjectQueries are introduced to interact with the Encoder output, outputting detection results that include category, confidence, and bounding box coordinates. Based on the detection results, the confidence-Laplacian variance pre-screening module is used to filter targets, selecting frames with clear features by extracting frames. TransReID re-identification module: This module receives the detection targets output by RT-DETR, scales them to a standard size, extracts global context and local detail features through a pre-trained Transformer model, generates vehicle appearance vectors, and performs matching based on the cosine similarity of appearance features. For "car" class targets, hierarchical matching and adaptive histogram filtering are implemented using the adaptive histogram filtering module. BoT-Sort tracking module: predicts the next frame position of the tracked target based on Kalman filtering, uses a uniform motion model, and eliminates unreasonable matches through the IOU threshold; Among them, RT-DETR, TransReID, BoT-Sort and MKF modules constitute an end-to-end processing pipeline, which jointly solve the problems of misassociation of highly similar vehicles, trajectory breakage caused by camera jitter, and cross-camera re-identification.
[0006] As an improvement, after the system constructs the homography matrix to establish the mapping between the spatial coordinates of each camera and the real space coordinates, the confidence-Laplacian variance pre-screening module combines the confidence threshold of the detection frame output by RT-DETR With Laplace variance threshold Filter key frames to improve video image stability, video feature extraction quality and matching accuracy in highway scenarios.
[0007] As an improvement, the confidence-Laplacian variance pre-screening module pre-screening specifically includes the following steps: In the DETR network, the decoder outputs a feature vector for each query object , represents the query’s encoding representation of the current image content, and then adds a fully connected layer to each query feature to predict the category to which it belongs. : in, , is the number of target categories, " corresponds to the background no-object category, where , the first Quantity That is the Query pair The original score of the class; On this basis, in order to obtain the normalized category probability, Perform Softmax transformation and get in, , Corresponding to the background class probability, is the predicted probability of the true target category, and satisfies The vehicle image is then grayscaled and the discrete Laplace kernel is used Calculate the convolution and get the Laplace response in: For the response map in pixels The value at is the relative position of the convolution kernel The weight of The Laplace response Treat it as a random variable and calculate its variance as a measure of clarity: in: < For grayscale images in pixels The gray value of is the image height, is the image width, is the Laplace kernel in relative position The weight of The Laplace response graph is The value of is the mean of the response graph, which can be approximated to 0. is the variance of the Laplace response, as a measure of clarity, is the variance threshold. If the value is smaller than this, the frame is considered blurry and the blurred frame is discarded. After the confidence-Laplacian variance pre-screening module, the recognition system will extract high-precision and clear key frames from all video frames where the vehicle appears in a frame-by-frame manner to ensure the robustness of the multi-extraction stage.
[0008] As an improvement, when the camera pixel is 3-5 million pixels, the variance threshold The value range of is 0.35-0.45. When the camera pixel is 5-8 million pixels, the variance threshold The value range of is 0.55-0.65. The confidence threshold needs to be dynamically set according to the complexity of the adopted model and road traffic, and the minimum value is selected in the range of 0.5 to 0.8 to ensure that no false detection occurs in the project.
[0009] As an improvement, the Transformer model is trained based on the key points and vehicle orientation annotations of the VeRi-776 dataset. The detailed process of its position encoding integrates the spatial distribution information of vehicle key points is as follows: the VeRi-776 dataset, which has been annotated with several key points and 8 types of orientations, is introduced for vehicle ReID training. Then all vehicle images are uniformly scaled, and enhancement strategies including but not limited to random horizontal flipping, padding, random cropping and random erasing are adopted. At the same time, each training image is loaded with the corresponding several key point coordinates and one-dimensional orientation labels.
[0010] As an improvement, the hierarchical matching and adaptive histogram filtering module includes a hierarchical matching stage that identifies vehicle types and classifies identified targets into "truck", "bus" or "car" categories. For targets identified as "car", a stricter matching process is enabled, namely, by dynamically raising the baseline cosine similarity threshold by 10%. The stage also calculates the reference grayscale level of the road area based on the gray world assumption and eliminates the color cast of different cameras. The cosine similarity threshold ranges from 0.7 to 0.85.
[0011] As an improvement, the hierarchical matching stage specifically includes the following steps: Receive the detection target output by RT-DETR and input image , the feature map is obtained through the CNN backbone: Multiple layer outputs are fed into the neck and unified into a fixed dimension Then, send it to transformer: Transformer Decoder outputs the feature vector of each query, the output is: in, Representing the feature representation of a candidate target; Each After a classification head MLP, the output logits: in, is the actual number of categories, The class means "no target" or no-object; Classification probability: Use softmax to get the probability of each category: And select the category with the largest probability value as the final classification judgment of the image.
[0012] As an improvement, the adaptive histogram filtering stage specifically includes the following steps: In a natural image containing multiple objects, the average color of all surface reflections is gray, that is, the average of each channel is equal. When the camera is initialized, the road area is selected to establish the homography matrix. Calculate its gray level and use it as the reference gray level : in, It is the time index, i.e. the frame number, which defaults to 0. is the color channel index, For the The x,y coordinate set of the homography matrix in the camera, and when it is the initial camera Take 0, For the The camera is in the In the frame image, pixels Place The original grayscale of the channel, 、 、 are the three-channel average grayscale values calculated by the initial camera in the initialization frame, is the “average gray level” of the initial camera; After obtaining the reference gray level After that, the road area of the subsequent cameras is calculated , and according to Calculate the gain coefficient of each channel in the initial frame : in, For the The camera is in the When the frame is white balanced, the corresponding channel The gain coefficient, The default value is 0. To prevent the denominator from being zero or an extremely small positive number; by is the gain coefficient for the subsequent -1 camera performs white balancing to eliminate subsequent color cast issues to ensure camera consistency; At the same time, in order to compensate for the lack of features of the "car" category, the budget is based on this by setting an adaptive histogram similarity threshold : Since the targets of the "truck" or "bus" category returned by the detector have more features, set the similarity threshold after starting the matching is 0, and then the similarity average of the "truck" or "bus" categories that are successfully matched within the sliding time window is calculated. The threshold is scaled by 13-17% and the mean of the “car” class is used. This is to add a color constraint to improve the robustness of the matching when the feature vector of the “car” class is insufficient: in: is the grayscale histogram vector of the two targets, namely the matched and matched images, each vector contains bins, The corresponding histogram The normalized frequency of bins satisfies , To measure the overlap of two distributions, the range , the closer to 1, the more similar, For all “correct matches” within the sliding time window The mean of .
[0013] As an improvement, based on the "vehicle motion continuity" feature, that is, the vehicle motion trajectory on the highway is smooth and uniform in a very short time Δt, the motion constraint and Kalman filter modules are used. The motion constraint module limits the speed change to a reasonable range to reduce the mismatch of sudden trajectory. At the same time, it is assumed that the vehicle is in continuous motion. During matching, only vectors within a specific time window are matched. The Kalman filter module uses a linear dynamic model and observation updates to effectively filter out camera jitter and noise, achieving the most accurate estimation of vehicle position and trajectory smoothing. The following steps are included: First, define the state vector of the motion : in, is the center position of the vehicle in the homography coordinate system, in meters, is the corresponding velocity component in / second, which is used as the hidden state estimate; Observed variables That is the real value provided by the camera: ; Afterwards in, The predicted value is calculated based on the current state after the last calibration. is the state transfer matrix, and the last ” is mapped to “the predicted value of this frame”, is the frame interval; Then, based on this, the covariance matrix is used in the prediction stage. "Amplifying" uncertainty in, is the covariance at the last moment when filtering is completed, which reflects the confidence level of the position and velocity at that time. is the state transfer matrix, which is used to reflect the “uniform motion” assumption. for The transpose of is the process noise covariance; When receiving the location given by the camera Post-calculation Kalman gain : in: , mapping the 4-dimensional state to the 2-dimensional observation, is the measurement noise covariance, is the Kalman gain, which measures the weight of the predicted value and the measured value; Correction status: in, is the residual, which represents the difference between the observed value and the predicted value; Finally, the corrected covariance: Compared with the prior art, the advantages of the present invention are: The three core tasks of D (detection) - T (tracking) - ReID (re-identification) work closely together and share information under a unified framework. The RT-DETR detection module cooperates with the "confidence With Laplace variance threshold The dual threshold mechanism provides high-quality, context-aware detection results, laying the foundation for tracking and ReID. With Laplace variance threshold The value range is taken and the calculated result is compared with the value range, which effectively filters out the blur caused by camera shaking and low pixels, and only retains clear and high-confidence key frames for subsequent processing, significantly improving the robustness of detection and ReID feature extraction, avoiding the negative impact of noise and afterimages introduced by blurred images on matching accuracy, and the TransReID re-identification module collaborates with the hierarchical matching and adaptive histogram filtering modules to generate appearance feature vectors with strong discriminability and adaptability to cross-camera scenes, supporting accurate identity association, and applying the hierarchical matching strategy to the "car" type targets with the most scarce features and the highest risk of mismatching. A stricter similarity threshold is added to reduce the false association of vehicles with similar appearances. At the same time, the adaptive histogram filtering module realizes adaptive color correction. It uses the "gray world hypothesis" and takes the road area of the initialization frame as a reference to dynamically calculate and apply the gain coefficient of each channel to effectively eliminate the color cast differences between different cameras, ensure the consistency of color features, and achieve scene-based white balance. It uses the matching quality of large vehicles (trucks / buses) with richer features in the sliding window to adaptively calculate and set the histogram similarity threshold for "sedans". Through dynamic histogram constraints, it adds additional features for matching cars with insufficient features. The reliable color similarity constraint greatly improves the robustness of cross-camera matching. The BoT-Sort tracking module combines motion prediction (Kalman) and appearance matching (ReID) to achieve stable and efficient online tracking. The MKF trajectory processing module is matched with the motion constraint and Kalman filter module. It uses the characteristics of vehicle motion in highway scenes that are approximately uniform and unidirectional to limit the matching search to a reasonable time and space window, thereby realizing motion continuity constraint, avoiding blind global matching, greatly reducing unnecessary feature comparison calculations, reducing latency, significantly improving efficiency, and avoiding errors caused by long distances or unreasonable motion. Matching ensures the physical rationality of the trajectory and effectively improves the accuracy. At the same time, based on the linear dynamic model, the detection observation value and motion prediction are integrated to make the Kalman filter noise reduction smooth and suppress the jitter noise, thereby effectively filtering out the detection frame position and size fluctuations caused by slight camera jitter. Finally, the output is a continuous, stable motion trajectory that conforms to the actual motion law of the vehicle, which improves the trajectory readability and the reliability of subsequent analysis. It effectively addresses the intertwined problems of similar vehicle appearance, large number, fast movement, low-quality image jitter in high-speed scenarios, and realizes the full-link optimization from trajectory generation within a single camera to cross-camera vehicle re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments: Figure 1 The flowchart of a vehicle tracking and re-identification system in a highway scenario. DETAILED DESCRIPTION
[0015] like Figure 1As shown in the figure, a vehicle tracking and re-identification system in a highway scenario includes an RT-DETR detection module, a TransReID re-identification module, a BoT-Sort tracking module, and an MKF trajectory processing module. The RT-DETR detection module extracts multi-scale feature maps through a lightweight CNN network, and then flattens the feature maps into position encoding vectors through the Transformer Encoder to perform global attention and introduce a learnable Object Queries interact with the Encoder output and output detection results including categories, confidences, and bounding box coordinates. Based on the detection results, the confidence-Laplacian variance pre-screening module is used to screen targets, and frames with clear features are selected by extracting frames. The TransReID re-identification module receives the detection targets output by RT-DETR, scales them to a standard size, and extracts global context and local detail features through the pre-trained Transformer model to generate vehicle appearance vectors. Matching is performed based on the cosine similarity of the appearance features. Adaptive histogram filtering is implemented for "car" class targets using hierarchical matching and adaptive histogram filtering modules. The BoT-Sort tracking module predicts the next frame position of the tracked target based on the Kalman filter, uses a uniform motion model, and eliminates unreasonable matches through the IOU threshold. The MKF trajectory processing module smoothes and stitches the trajectory output by BoT-Sort across cameras through motion constraints and the Kalman filter module. Among them, RT-DETR, TransReID, BoT-Sort and MKF modules constitute an end-to-end processing pipeline, which jointly solve the problems of misassociation of highly similar vehicles, trajectory breakage caused by camera jitter, and cross-camera re-identification.
[0016] A vehicle tracking and re-identification system in a highway scenario specifically includes the following steps: After the system constructs the homography matrix to establish the mapping between the spatial coordinates of each camera and the real space coordinates, it extracts multi-scale feature maps through the lightweight CNN network, and flattens the feature maps into position encoding vectors through the Transformer Encoder to perform global attention. At the same time, it introduces learnable Object Queries to interact with the Encoder output and outputs the detection results including category, confidence and bounding box coordinates. The detection results are then pre-screened by the confidence-Laplacian variance module and the confidence threshold is combined. With Laplace variance threshold Keyframes are filtered to improve video image stability, the quality of video feature extraction, and matching in highway scenarios. The confidence-Laplacian variance pre-screening module pre-screening specifically includes the following steps: In the DETR network, the decoder outputs a feature vector for each query object , represents the query’s encoding representation of the current image content, and then adds a fully connected layer to each query feature to predict the category to which it belongs. : in, , is the number of target categories, " corresponds to the background no-object category, where , the first Quantity That is the Query pair The original score of the class; On this basis, in order to obtain the normalized category probability, Perform Softmax transformation and get in, , Corresponding to the background class probability, is the predicted probability of the true target category, and satisfies The vehicle image is then grayscaled and the discrete Laplace kernel is used Calculate the convolution and get the Laplace response in: For the response map in pixels The value at is the relative position of the convolution kernel The weight of The Laplace response Treat it as a random variable and calculate its variance as a measure of clarity: in: < For grayscale images in pixels The gray value of is the image height, is the image width, is the Laplace kernel in relative position The weight of The Laplace response graph is The value of is the mean of the response graph, which can be approximated to 0. is the variance of the Laplace response, as a measure of clarity, is the variance threshold. If the value is smaller than this, the frame is considered blurry and the blurred frame is discarded. After the confidence-Laplace variance pre-screening module, the recognition system will extract high-precision and clear key frames from all video frames where the vehicle appears in order to ensure the robustness of the multi-extraction stage. When the camera pixel is 3-5 million pixels, the variance threshold The value range of is 0.35-0.45. When the camera pixel is 5-8 million pixels, the variance threshold The value range of is 0.55-0.65. The confidence threshold needs to be dynamically set according to the complexity of the adopted model and road traffic. The minimum value that ensures no false detection occurs in the project is selected within the range of 0.5 to 0.8. The TransReID re-identification module receives the detection targets output by RT-DETR, scales them to a standard size, preferably 336×336, and extracts global context and local details through a Transformer model trained on the Key Point and Vehicle Orientation Annotation for VeRi-776 dataset with positional encoding. Specifically, the VeRi-776 dataset, which is annotated with 20 key points and 8 types of orientations, is introduced for vehicle ReID training. All vehicle images are then uniformly scaled, and enhancement strategies including but not limited to random horizontal flipping, padding, random cropping, and random erasing are adopted. At the same time, each training image is loaded with the corresponding 20 key point coordinates and one-dimensional orientation label, and its feature vector is output. The matching objects are processed in the same way. The image is cropped for each detected vehicle and a high-discriminative appearance vector is generated to support BoT-Sort appearance association and ReID identity confirmation. Then, the hierarchical matching and adaptive histogram filtering modules are used to introduce adaptive histogram filtering constraints for targets of type "car" to improve the robustness of matching: Identify vehicle types and classify targets as "truck," "bus," or "car." For targets identified as "car," a stricter matching process is implemented by dynamically increasing the baseline cosine similarity threshold by 10%. The cosine similarity threshold is set to 0.8. The hierarchical matching stage specifically includes the following steps: Receive the detection target output by RT-DETR and input image , the feature map is obtained through the CNN backbone: Multiple layer outputs are fed into the neck and unified into a fixed dimension Then, send it to transformer: Transformer Decoder outputs the feature vector of each query, the output is: in, Representing the feature representation of a candidate target; Each After a classification head MLP, the output logits: in, is the actual number of categories, The class means "no target" or no-object; Classification probability: Use softmax to get the probability of each category: And select the category with the largest probability value as the final classification judgment of the image; The adaptive histogram filtering stage specifically includes the following steps: In a natural image containing multiple objects, the average color of all surface reflections is gray, that is, the average of each channel is equal. When the camera is initialized, the road area is selected to establish the homography matrix. Calculate its gray level and use it as the reference gray level : in, It is the time index, i.e. the frame number, which defaults to 0. is the color channel index, For the The x,y coordinate set of the homography matrix in the camera, and when it is the initial camera Take 0, For the The camera is in the In the frame image, pixels Place The original grayscale of the channel, 、 、 are the three-channel average grayscale values calculated by the initial camera in the initialization frame, is the “average gray level” of the initial camera; After obtaining the reference gray level After that, the road area of the subsequent cameras is calculated , and according to Calculate the gain coefficient of each channel in the initial frame : in, For the The camera is in the When the frame is white balanced, the corresponding channel The gain coefficient, The default value is 0. To prevent the denominator from being zero or a very small positive number, take ; by is the gain coefficient for the subsequent -1 camera performs white balancing to eliminate subsequent color cast issues to ensure camera consistency; At the same time, in order to compensate for the lack of features of the "car" category, the budget is based on this by setting an adaptive histogram similarity threshold : Since the targets of the "truck" or "bus" category returned by the detector have more features, set the similarity threshold after starting the matching is 0, and then the similarity average of the "truck" or "bus" categories that are successfully matched within the sliding time window is calculated. The mean of the values is scaled by 13-17%, preferably by 15%, as the threshold. This is to add a color constraint to improve the robustness of the matching when the feature vector of the "car" class is insufficient: in: is the grayscale histogram vector of the two targets, namely the matched and matched images, each vector contains bins, The corresponding histogram The normalized frequency of bins satisfies , To measure the overlap of two distributions, the range , the closer to 1, the more similar, For all “correct matches” within the sliding time window The mean of Use Kalman prediction to predict the approximate position of each target being tracked in the next frame based on the uniform velocity model, eliminate new detections that are too far away from it, and use the IOU threshold to eliminate unreasonable matches, and output trajectory information based on the current tracking result; They are stably connected into trajectories online and then smoothed and spliced using the MKF trajectory processing module through motion constraints and the Kalman filter module. This allows the same vehicle to be re-identified in cross-camera scenarios, enabling intelligent highway monitoring across all time and space links. Based on the "vehicle motion continuity" feature, that is, the vehicle motion trajectory on the highway is smooth and uniform in a very short time Δt, a motion constraint and Kalman filter module is used. The motion constraint module limits the speed change to a reasonable range to reduce the incorrect matching of sudden trajectory. At the same time, it is assumed that the vehicle is in continuous motion. During matching, only vectors within a specific time window are matched. The Kalman filter module uses a linear dynamic model and observation update to effectively filter out camera jitter and noise, achieving the most accurate estimation of vehicle position and trajectory smoothing, including the following steps: First, define the state vector of the motion : in, is the center position of the vehicle in the homography coordinate system, in meters, is the corresponding velocity component in / second, which is used as the hidden state estimate; Observed variables That is the real value provided by the camera: ; Afterwards in, The predicted value is calculated based on the current state after the last calibration. is the state transfer matrix, and the last ” is mapped to “the predicted value of this frame”, is the frame interval; Then, based on this, the covariance matrix is used in the prediction stage. "Amplifying" uncertainty in, is the covariance at the last moment when filtering is completed, which reflects the confidence level of the position and velocity at that time. is the state transfer matrix, which is used to reflect the “uniform motion” assumption. for The transpose of is the process noise covariance; When receiving the location given by the camera Post-calculation Kalman gain : in: , mapping the 4-dimensional state to the 2-dimensional observation, is the measurement noise covariance, is the Kalman gain, which measures the weight of the predicted value and the measured value; Correction status: in, is the residual, which represents the difference between the observed value and the predicted value; Finally, the corrected covariance: In this way, we avoid the efficiency and accuracy bottlenecks brought by global matching, while recovering continuous and reliable vehicle motion trajectories in noisy detection inputs.
[0017] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0018] The units described in some embodiments of the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor, and the functions described above may be at least partially performed by one or more hardware logic components.
[0019] The above description is merely a description of the preferred embodiment of the present invention and is not to be construed as limiting the scope of the claims. The present invention is not limited to the above embodiment, and variations in the specific structure are permitted. Any variations within the scope of the independent claims of the present invention are also within the scope of protection of the present invention.
Claims
1. A vehicle tracking and re-identification system in a highway scenario, characterized by: include; RT-DETR detection module: This module extracts multi-scale feature maps using a lightweight CNN network and flattens them into positional encoding vectors using the TransformerEncoder to perform global attention. Learnable ObjectQueries are introduced to interact with the Encoder output, outputting detection results that include category, confidence, and bounding box coordinates. Based on the detection results, the confidence-Laplacian variance pre-screening module is used to filter targets, selecting frames with clear features by extracting frames. TransReID re-identification module: This module receives the detection targets output by RT-DETR, scales them to a standard size, extracts global context and local detail features using a pre-trained Transformer model, generates vehicle appearance vectors, and performs matching based on the cosine similarity of the appearance features. For "car" class targets, hierarchical matching and adaptive histogram filtering are implemented using the adaptive histogram filtering module. BoT-Sort tracking module: predicts the next frame position of the tracked target based on Kalman filtering, uses a uniform motion model, and eliminates unreasonable matches through the IOU threshold; MKF trajectory processing module: smoothes and stitches the trajectory output by BoT-Sort across cameras through motion constraints and Kalman filter modules; Among them, the RT-DETR, TransReID, BoT-Sort and MKF modules constitute an end-to-end processing pipeline, which jointly solves the problems of misassociation of highly similar vehicles, trajectory breakage caused by camera jitter, and cross-camera re-identification.
2. The vehicle tracking and re-identification system for highway scenarios according to claim 1, characterized in that: After the system constructs the homography matrix to establish the mapping between the spatial coordinates of each camera and the real space coordinates, the confidence-Laplacian variance pre-screening module combines the confidence threshold with the detection frame output by RT-DETR. With Laplace variance threshold Filter key frames to improve video image stability, video feature extraction quality and matching accuracy in highway scenarios.
3. The vehicle tracking and re-identification system for highway scenarios according to claim 2, characterized in that: The confidence-Laplace variance pre-screening module pre-screening specifically includes the following steps: In the DETR network, the decoder outputs a feature vector for each query object , represents the query’s encoding representation of the current image content, and then adds a fully connected layer to each query feature to predict the category to which it belongs. : in, , is the number of target categories, ” corresponds to the background no-object category, where , the first Quantity That is the Query pair The original score of the class; On this basis, in order to obtain the normalized category probability, Perform Softmax transformation and get in, , Corresponding to the background class probability, is the predicted probability of the true target category, and satisfies The vehicle image is then grayscaled and the discrete Laplace kernel is used Calculate the convolution and get the Laplace response in: For the response map in pixels The value at is the relative position of the convolution kernel The weight of The Laplace response Treat it as a random variable and calculate its variance as a measure of clarity: in: < For grayscale images in pixels The gray value of is the image height, is the image width, is the Laplace kernel in relative position The weight of For the Laplace response graph, The value of is the mean of the response graph, which can be approximated to 0. is the variance of the Laplace response, as a measure of clarity, is the variance threshold. If the value is smaller than this, the frame is considered blurry and the blurred frame is discarded. After the confidence-Laplacian variance pre-screening module, the recognition system will extract high-precision and clear key frames from all video frames where the vehicle appears in a frame-by-frame manner to ensure the robustness of the multi-extraction stage.
4. The vehicle tracking and re-identification system for highway scenarios according to claim 3, characterized in that: When the camera pixel is 3-5 million pixels, the variance threshold The value range of is 0.35-0.
45. When the camera pixel is 5-8 million pixels, the variance threshold The value range of is 0.55-0.
65. The confidence threshold needs to be dynamically set according to the complexity of the adopted model and road traffic, and the minimum value is selected in the range of 0.5 to 0.8 to ensure that no false detection occurs in the project.
5. The vehicle tracking and re-identification system for highway scenarios according to claim 1, characterized in that: The Transformer model is trained based on the key point and vehicle orientation annotations of the VeRi-776 dataset. The detailed process of its position encoding and fusion of the spatial distribution information of vehicle key points is as follows: the VeRi-776 dataset, which has been annotated with several key points and eight types of orientations, is introduced for vehicle ReID training. Subsequently, all vehicle images are uniformly scaled, and enhancement strategies including but not limited to random horizontal flipping, padding, random cropping and random erasing are adopted. At the same time, each training image is loaded with the corresponding several key point coordinates and one-dimensional orientation labels.
6. The vehicle tracking and re-identification system for highway scenarios according to claim 1, characterized in that: The hierarchical matching and adaptive histogram filtering module includes identifying vehicle types and classifying identified targets into "truck," "bus," or "car" categories. For targets identified as "car," a more rigorous matching process is implemented, namely a hierarchical matching stage that dynamically increases the baseline cosine similarity threshold by 10%, and an adaptive histogram filtering stage that calculates the reference grayscale level of the road area based on the gray world assumption and eliminates color casts between different cameras. The cosine similarity threshold ranges from 0.7 to 0.
85.
7. The vehicle tracking and re-identification system for highway scenarios according to claim 6, characterized in that: The hierarchical matching stage specifically includes the following steps: Receive the detection target output by RT-DETR and input image , the feature map is obtained through the CNN backbone: Multiple layer outputs are fed into the neck and unified into a fixed dimension Then, send it to transformer: Transformer Decoder outputs the feature vector of each query, the output is: in, Representing the feature representation of a candidate target; Each After a classification head MLP, the output logits: in, is the actual number of categories, The class means "no target" or no-object; Classification probability: Use softmax to get the probability of each category: And select the category with the largest probability value as the final classification judgment of the image.
8. The vehicle tracking and re-identification system for highway scenarios according to claim 6, characterized in that: The adaptive histogram filtering stage specifically includes the following steps: In a natural image containing multiple objects, the average color of all surface reflections is gray, that is, the average of each channel is equal. When the camera is initialized, the road area is selected to establish the homography matrix. Calculate its gray level and use it as the reference gray level : in, It is the time index, i.e. the frame number, which defaults to 0. is the color channel index, For the The x,y coordinate set of the homography matrix in the camera, and when it is the initial camera Take 0, For the The camera is in the In the frame image, pixels Place The original grayscale of the channel, 、 、 are the three-channel average grayscale values calculated by the initial camera in the initialization frame, is the "average gray level" of the initial camera; After obtaining the reference gray level After that, the road area of the subsequent cameras is calculated , and according to Calculate the gain coefficient of each channel in the initial frame : in, For the The camera is in the When the frame is white balanced, the corresponding channel The gain coefficient, The default value is 0. To prevent the denominator from being zero or an extremely small positive number; by is the gain coefficient for the subsequent -1 camera performs white balancing to eliminate subsequent color cast issues to ensure camera consistency; At the same time, in order to compensate for the lack of features of the "car" category, the budget is based on this by setting an adaptive histogram similarity threshold : Since the targets of the "truck" or "bus" category returned by the detector have more features, set the similarity threshold after starting the matching is 0, and then the similarity average of the "truck" or "bus" category that is successfully matched within the sliding time window is calculated. The threshold is scaled by 13-17% and the mean of the "car" class is used. This is to add a color constraint to improve the robustness of the matching when the feature vector of the "car" class is insufficient: in: is the grayscale histogram vector of the two targets, namely the matched and matched images, each vector contains bins, The corresponding histogram The normalized frequency of bins satisfies , To measure the overlap of two distributions, the range , the closer to 1, the more similar, For all "correct matches" in the sliding time window The mean of .
9. The vehicle tracking and re-identification system for highway scenarios according to claim 1, characterized in that: Based on the characteristic of "vehicle motion continuity" that the vehicle trajectory on the highway is smooth and uniform over a very short time Δt, a motion constraint and Kalman filter module are used. The motion constraint module limits speed changes to a reasonable range to reduce incorrect matching of sudden trajectory changes. At the same time, it assumes that the vehicle is in continuous motion and only matches vectors within a specific time window during matching. The Kalman filter module uses a linear dynamic model and observation updates to effectively filter out camera jitter and noise, achieving the most accurate estimation of vehicle position and trajectory smoothing, including the following steps: First, define the state vector of the motion : in, is the center position of the vehicle in the homography coordinate system, in meters, is the corresponding velocity component in / second, which is used as the hidden state estimate; Observed variables That is the real value provided by the camera: ; Afterwards in, The predicted value is calculated based on the current state after the last calibration. is the state transfer matrix, and the last "Mapped to the predicted value of this frame", is the frame interval; Then, based on this, the covariance matrix is used in the prediction stage. "Amplifying" uncertainty: in, is the covariance at the last moment when filtering is completed, reflecting the confidence level of the position and velocity at that time. is the state transfer matrix, which is used to reflect the "uniform motion" assumption. for The transpose of is the process noise covariance; When receiving the location given by the camera Post-calculation Kalman gain : in: , mapping the 4-dimensional state to the 2-dimensional observation, is the measurement noise covariance, is the Kalman gain, which measures the weight of the predicted value and the measured value; Correction status: in, is the residual, which represents the difference between the observed value and the predicted value; Finally, the corrected covariance: 。
Citation Information
Cited By
Multi-feature trajectory prediction and cross-defense early warning method for edge and coast defense control objects
CN121011112A
