Trailer hinging angle real-time estimation method and system based on feature point tracking
By combining feature point tracking and Kalman filtering, the problems of high data acquisition cost, large computational resource consumption, and insufficient environmental adaptability in trailer articulation angle estimation are solved, achieving high-precision and high-real-time articulation angle estimation, and improving the stability and applicability of the system.
Patent Information
- Application Number
- CN202610099554.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies for real-time estimation of trailer articulation angles suffer from problems such as high data acquisition costs, high computational resource consumption, insufficient environmental adaptability, severe inter-frame jitter, and estimation failures when obstructed, resulting in inaccurate articulation angle estimation and difficulty in ensuring real-time performance.
A feature point tracking-based method is adopted, which combines optical flow tracking and feature point template rematching. The Kalman filter is used for real-time updating to achieve high-precision and high-real-time estimation of the hinge angle.
It improves the accuracy and real-time performance of trailer articulation angle estimation, reduces computing resource requirements, enhances the system's environmental adaptability and stability, and lowers development costs.
Smart Images

Figure CN121999046A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent driving assistance technology, and in particular to a method and system for real-time estimation of trailer articulation angle based on feature point tracking. Background Technology
[0002] In special operational scenarios, the trailer and tractor are connected by an articulation point, forming a complex multibody dynamics system. The articulation angle directly determines the instantaneous steering center and trajectory of the vehicle assembly. During turns, lane changes, or emergency maneuvers, if the articulation angle is too large, a dangerous "folding" phenomenon can easily occur, where the trailer swings towards the tractor side, leading to loss of control. Furthermore, at high speeds, drastic or frequent changes in the angle can also induce lateral swaying of the trailer, ultimately resulting in a rollover. Therefore, real-time and accurate control of the articulation angle is a prerequisite for predicting vehicle stability and triggering active safety systems (such as the trailer version of Electronic Stability Control, ESC) to intervene. Without accurate real-time angle data, these safety systems or intelligent driving assistance systems cannot determine whether the vehicle is in a dangerous state.
[0003] In existing technologies, keypoint detection based on deep learning has become the mainstream solution. Although this method can achieve a certain level of accuracy under specific conditions, its inherent limitations are becoming increasingly apparent in large-scale applications: First, deep learning methods heavily rely on large-scale, high-quality keypoint annotation datasets to cover diverse weather, lighting, trailer types, and angle scenarios, resulting in extremely high data acquisition and manual annotation costs and a long development cycle. Second, the complex forward inference computation of deep neural networks is computationally heavy, consuming significant hardware resources under high frame rate real-time processing requirements, making it difficult to guarantee real-time performance. Third, existing solutions typically process video streams frame by frame independently, ignoring the temporal continuity of angle changes between adjacent frames, leading to unnecessary inter-frame jitter in the output angle and poor stability. Furthermore, existing real-time trailer articulation angle estimation methods lack environmental adaptability; the performance of the angle estimation model is severely limited by the environmental conditions of the training data. Accuracy drops significantly in scenarios that differ greatly from the training set, such as at night or in rain / fog. To ensure robustness, models often need to be trained separately for different environments, increasing system complexity and maintenance costs. Meanwhile, when the articulated area of the trailer is obscured by cargo or the vehicle body, key points are prone to being missed or misdetected, leading to angle calculation failures or a sharp increase in errors. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a method and system for real-time estimation of trailer articulation angles based on feature point tracking, thereby improving the accuracy and real-time performance of trailer articulation angle estimation.
[0005] In a first aspect, embodiments of this application provide a real-time estimation method for trailer articulation angles based on feature point tracking, including: Acquire the first image frame of the target trailer at the current moment and the second image frame at the previous moment; The first feature point list of the first image frame is determined based on the second feature point list in the second image frame; The visual estimated angle and confidence level are calculated based on the first feature point list and the preset feature point template. The first Kalman filter at the current moment is updated based on the visual estimated angle and the confidence level to obtain the updated second Kalman filter, and the hinge angle estimate at the current moment is output based on the second Kalman filter. Within a preset time period following the current moment, the hinge angle is estimated several times in real time using the second Kalman filter based on the motion data of the target trailer, and then the estimated hinge angle values at each moment within the preset time period are output.
[0006] This application provides a real-time estimation method for trailer articulation angles based on feature point tracking. By combining feature point tracking with real-time Kalman filter updates, high-precision and high-real-time estimation of the articulation angle is achieved. First, at each image sampling moment, this embodiment performs continuous feature point tracking based on image frames from the preceding and following moments, and updates the feature point list for the current moment. Then, based on the updated feature point list and a pre-calibrated feature point template, the visually estimated angle and confidence level for the current moment are calculated. Finally, considering that while the visually estimated angle has high accuracy, its output frequency is low, making it difficult to meet the requirements of high real-time performance, this embodiment also introduces a Kalman filter to perform real-time estimation based on the target trailer's motion data. Each time an image frame is acquired, the corresponding visually estimated angle is generated and the Kalman filter's filtering parameters are corrected. During a preset time period when no image frames are acquired, the corrected Kalman filter is used to perform high-frequency real-time estimation of the articulation angle, improving the accuracy and real-time performance of the trailer articulation angle estimation.
[0007] In one possible implementation, determining the first feature point list of the first image frame based on the second feature point list in the second image frame includes: If the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted by a preset optical flow algorithm, thereby generating the first feature point list of the first image frame; If the current time is a rematching time, then the first image frame is rematched according to the feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame. The feature point template is obtained by constructing the historical image frame sequence of the target trailer in the straight line alignment state by feature point calibration. The time interval between two adjacent rematching moments is greater than the time interval between two adjacent optical flow tracking moments.
[0008] This application provides a hybrid strategy for generating feature point lists. During optical flow tracking, the optical flow algorithm rapidly predicts feature point positions across consecutive frames, enabling low-latency angle estimation at high frame rates and meeting real-time requirements. During re-matching, feature point templates are used for precise matching, effectively correcting accumulated errors that may occur during optical flow tracking and ensuring long-term tracking stability. This hybrid strategy achieves accurate and rapid feature point tracking, providing a reliable data foundation for subsequent visual estimation and improving the accuracy and real-time performance of trailer articulation angle estimation. Furthermore, by setting the re-matching interval to be longer than the optical flow tracking interval, an optimized balance between computational efficiency and estimation accuracy is achieved. The key advantage of this design is that it can correct accumulated errors that may occur during optical flow tracking through periodic re-matching while ensuring real-time performance. This embodiment meets the real-time requirements at high frame rates through frequent optical flow tracking, reducing the time overhead of single-frame processing. Simultaneously, the introduction of a periodic re-matching mechanism effectively recovers feature points lost due to occlusion or environmental changes, improving long-term tracking stability and significantly enhancing the overall performance and applicability of the system.
[0009] Furthermore, if the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted using a preset optical flow algorithm, thereby generating a first feature point list for the first image frame, including: Based on the second image frame and the preset target detection area, the optical flow algorithm is used to predict the corresponding position of each second feature point in the second feature point list in the first image frame, and then each corresponding initial first feature point is determined in the first image frame, including the pixel position, ID and descriptor of each initial first feature point. Based on the preset detection rules and the pixel positions of each second feature point, feature points are filtered for each initial first feature point to obtain each first feature point; A list of the first feature points is constructed based on the ID, pixel position, and descriptor of each first feature point.
[0010] This embodiment further refines the specific steps of optical flow tracking, achieving efficient prediction and filtering of feature points through a preset target detection region and optical flow algorithm. This process significantly improves the real-time performance and computational efficiency of feature point tracking. First, the optical flow algorithm can quickly estimate the motion trajectory of feature points between consecutive frames, avoiding complex feature extraction and matching calculations, thereby greatly reducing the time overhead of single-frame processing and making it suitable for high frame rate real-time video stream processing. Then, the initial feature points are filtered through preset detection rules, effectively eliminating abnormal points caused by image noise or motion blur, improving the data reliability of the first feature point list. In addition, this embodiment ensures the continuity of feature points between different frames by maintaining the ID, pixel position, and descriptor information of feature points, providing stable input for subsequent angle calculations. In practical applications, this optical flow tracking mechanism not only reduces the demand for hardware computing resources but also maintains a high tracking success rate in dynamic environments, thereby improving the accuracy and stability of articulated angle estimation.
[0011] Furthermore, if the current time is a rematching time, then the first image frame is rematched according to a preset feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame, including: The first image frame and the preset target detection region are input into the preset feature point detection network, so that the feature point detection network determines a number of candidate first feature points in the first image frame, including the pixel position and descriptor of each candidate first feature point. Based on each of the candidate first feature points, the matching feature points corresponding to each third feature point in the feature point template are determined respectively. For any third feature point, the corresponding matching feature point is determined from each of the candidate first feature points by finding the nearest neighbor according to the descriptor of the third feature point, and the ID of the matching feature point is determined according to the correspondence. Geometric verification is performed on each of the matching feature points, and several rematching feature points are obtained by filtering. The second feature point list is updated based on each of the rematched feature points to obtain the first feature point list.
[0012] This application describes in detail the specific process of feature point re-matching. Through a feature point detection network and geometric verification, high-precision matching and updating of feature points are achieved. This enables the embodiment to effectively address the problem of feature point loss or accumulated error that may occur in optical flow tracking, thereby improving the long-term stability and accuracy of angle estimation. First, the feature point detection network can extract rich candidate feature points from the current image frame, covering feature regions that may be added due to occlusion or environmental changes, avoiding feature degradation during the tracking process. Second, through nearest neighbor matching and geometric verification, feature points that are highly consistent with the feature point template can be selected, ensuring the reliability of the matching results. This embodiment updates the feature point list through a re-matching mechanism, dynamically adapting to the deformation and viewpoint changes of the trailer during movement, enhancing the system's environmental adaptability, and thus maintaining effective tracking of feature points in complex scenes (such as partial occlusion and sudden changes in illumination), significantly improving the robustness and accuracy of articulated angle estimation.
[0013] Furthermore, for any third feature point, determining a corresponding matching feature point from each of the candidate first feature points by finding the nearest neighbor based on the descriptor of the third feature point, and determining the ID of the matching feature point according to the correspondence, includes: Calculate the feature distance between the descriptor of the third feature point and the descriptors of each candidate first feature point; Based on the magnitude of each of the feature distances, determine the nearest neighbor and the second nearest neighbor of the third feature point from each of the candidate first feature points; Based on the feature distances corresponding to the nearest neighbor and the second nearest neighbor, perform absolute distance threshold tests and ratio tests on the nearest neighbor and the second nearest neighbor; If the absolute distance threshold test and the ratio test pass, the nearest neighbor point is taken as the matching feature point corresponding to the third feature point, and the ID of the third feature point is taken as the ID of the matching feature point.
[0014] This embodiment further refines the specific process of feature point matching. By calculating feature distance, filtering nearest and second nearest neighbors, and performing absolute distance threshold and ratio tests, it achieves high-precision filtering of matching feature points, effectively distinguishing between correct and incorrect matching points, thereby significantly improving the accuracy and reliability of feature point matching. Specifically, this embodiment quantifies the similarity between feature points by calculating feature distances (such as Euclidean distance or Hamming distance), providing an objective basis for matching. Then, the ratio test of nearest and second nearest neighbors is used to filter out mismatches caused by image noise or similar textures, improving the confidence of the matching results; while the absolute distance threshold test further ensures the spatial consistency between matching points, avoiding matching errors caused by local deformation or occlusion. Through the above feature point matching process, this embodiment can significantly reduce the sources of error in angle calculation and improve the overall accuracy and stability of articulated angle estimation.
[0015] In one possible implementation, the feature point template is constructed by calibrating feature points in a sequence of historical image frames of the target trailer in a straight-line aligned state, including: Obtain the historical image frame sequence of the target trailer in a straight-line aligned state; Each historical image frame in the historical image frame sequence is sequentially input into a preset feature point detection network, so that the feature point detection network sequentially extracts a list of historical feature points for each historical image frame. The list of historical feature points includes the historical pixel position, historical ID, and historical descriptor of each historical feature point. Based on the historical image frame sequence, the optical flow algorithm is used to continuously track each historical feature point, and the number of frames in which each historical feature point is successfully tracked is counted. Based on the number of consecutive successful tracking frames for each historical feature point and a preset frame threshold, several stable feature points are selected from each historical feature point. Geometric verification and motion consistency verification are performed on each of the stable feature points, and several third feature points are obtained by screening. The feature point template is constructed based on the historical pixel position, historical ID, and historical descriptor of each of the third feature points.
[0016] This application provides a method for constructing a feature point template. By calibrating feature points in a historical image frame sequence of a target trailer in a straight-line aligned state, stable feature points are selected to construct a feature point template, providing a high-quality reference benchmark for subsequent feature point tracking and matching, thereby significantly improving the accuracy and robustness of angle estimation. Specifically, this embodiment uses continuous optical flow tracking and frame count statistics to select feature points that perform stably in the historical sequence, avoiding feature point failure due to temporary occlusion or noise. Furthermore, geometric verification and motion consistency verification further ensure the spatiotemporal consistency of the feature point template, enhancing its applicability in complex environments. The feature point template construction method provided in this embodiment significantly reduces the reliance on manually labeled data in existing technologies, lowers system development costs, provides reliable prior information for subsequent real-time estimation of the articulation angle, and improves the accuracy and real-time performance of trailer articulation angle estimation.
[0017] In one possible implementation, the step of calculating the visual estimated angle and confidence level based on the first feature point list and the feature point template includes: Calculate the first relative angle between each first feature point in the first feature point list and the first reference point, where the first reference point is the hinge point in the first image frame. Based on the ID of each of the first feature points, each corresponding fourth feature point is determined from the feature point template, and the second relative angle between each of the fourth feature points and the second reference point is calculated respectively. The second reference point is the hinge point in any historical image frame in the historical image frame sequence. Calculate the angle difference between each of the first relative angles and the corresponding second relative angles to obtain the individual rotation angle of each of the first feature points; Based on the rotation angle of each individual, the median angle and standard deviation of the corresponding angle are calculated, and the median angle is used as the visually estimated angle, and the standard deviation of the angle is used as the confidence level.
[0018] This application provides a method for calculating the visual estimated angle and confidence level. By introducing a reference point and comparing the differences in relative angles between the current feature point and the feature point template, the spatial distribution information of each feature point is effectively utilized to achieve accurate estimation of the articulation angle. Specifically, this embodiment calculates the relative angle between each feature point and the reference point, and then further calculates the individual rotation angle of each feature point based on the feature point template. This effectively captures the local deformation information of the trailer in the image, providing rich input for angle estimation. Finally, by statistically analyzing the median and standard deviation of these individual rotation angles, the influence of outliers on the estimation results is effectively suppressed, improving the stability of the angle estimation. This provides important prior information for subsequent updates to the Kalman filter, enabling the filtering process to be dynamically adjusted according to the visual angle estimation results. This allows the real-time estimation of the trailer articulation angle to maintain high accuracy and real-time performance in complex environments.
[0019] In one possible implementation, updating the first Kalman filter at the current moment based on the visually estimated angle and the confidence level, obtaining the updated second Kalman filter, and outputting the hinge angle estimate at the current moment based on the second Kalman filter includes: Obtain the prior state estimation vector and the corresponding prior covariance matrix of the first Kalman filter at the current time. The observation noise at the current moment is determined based on the confidence level. The first Kalman gain of the first Kalman filter at the current time is calculated based on the observation noise, the prior covariance matrix, and the preset observation matrix. The state estimation vector of the target trailer at the current moment is calculated based on the first Kalman gain, the prior state estimation vector, the observation matrix, and the visual estimation angle. The covariance matrix of the state estimation vector is calculated based on the first Kalman gain, the observation matrix, and the prior covariance matrix. The first Kalman filter is updated based on the state estimation vector and the covariance matrix to obtain the second Kalman filter; The hinge angle estimate for the current moment is output based on the state estimation vector in the second Kalman filter.
[0020] This embodiment details the Kalman filter update process. By combining the visually estimated angle with confidence level, real-time update and optimization of the Kalman filter are achieved, ensuring the accuracy of subsequent real-time angle estimation. Simultaneously, the Kalman filter effectively suppresses inter-frame jitter caused by image noise or occlusion, outputting a reliable angle estimation result for the current moment. Specifically, this embodiment first determines the observation noise through confidence level, enabling the filtering process to dynamically adjust weights based on the reliability of the visual estimation, improving the filter's adaptability. Second, the calculation of the Kalman gain optimizes the state estimation update process, ensuring the accuracy and stability of angle estimation. Finally, this embodiment designs an update mechanism for the filter's state estimation vector and covariance matrix, enabling the system to continuously track the changing trend of the articulation angle in a dynamic environment, improving the accuracy and real-time performance of trailer articulation angle estimation.
[0021] Furthermore, obtaining the prior state estimation vector and corresponding prior covariance matrix of the first Kalman filter at the current time includes: Obtain the real-time motion data of the target trailer at the current moment and the previous state estimation vector at the previous moment; Based on the real-time motion data and the previous state estimation vector, the prior state estimation vector of the target trailer at the current moment is calculated through the state transition equation in the first Kalman filter. The prior covariance matrix of the prior state estimation vector is calculated based on the control noise, process noise, real-time motion data, and partial derivatives of the state transition equation in the first Kalman filter.
[0022] This embodiment further refines the calculation process of the prior state estimation vector and covariance matrix in the Kalman filter. By combining real-time motion data and the state transition equation, it fully utilizes the trailer's motion information to improve the timeliness and accuracy of angle estimation. First, this embodiment can predict the change in the trailer's articulation angle at the current moment using the state transition equation, real-time motion data, and the previous state estimation vector, providing reliable prior information for the filtering process. Second, the calculation of the covariance matrix considers the influence of control noise and process noise, enabling the filter to effectively cope with the uncertainty of motion data. This mechanism allows the system to maintain the continuity of angle estimation through motion data even when visual information is missing or unreliable. This embodiment improves the accuracy and real-time performance of real-time trailer articulation angle estimation by combining high-precision visual estimation with high-frequency Kalman filter estimation.
[0023] Secondly, embodiments of this application provide a real-time estimation system for trailer articulation angle based on feature point tracking, including an acquisition module, a feature point determination module, a first estimation module, an update module, and a second estimation module; The acquisition module is used to acquire the first image frame of the target trailer at the current moment and the second image frame at the previous moment; The feature point determination module is used to determine the first feature point list of the first image frame based on the second feature point list in the second image frame; The first estimation module is used to calculate and obtain the visual estimation angle and confidence level based on the first feature point list and the preset feature point template; The update module is used to update the first Kalman filter at the current moment according to the visual estimated angle and the confidence level, obtain the updated second Kalman filter, and output the hinge angle estimate at the current moment based on the second Kalman filter; The second estimation module is used to perform several real-time estimations of the articulation angle based on the motion data of the target trailer through the second Kalman filter within a preset time period after the current time, and then output the articulation angle estimation values at each time within the preset time period. Attached Figure Description
[0024] Figure 1 A flowchart illustrating a real-time estimation method for trailer articulation angle based on feature point tracking, provided in an embodiment of this application; Figure 2 A system architecture diagram for applying the real-time estimation method for trailer articulation angle provided in the embodiments of this application; Figure 3 A schematic diagram illustrating the feature point tracking process in a real-time estimation method for trailer articulation angle based on feature point tracking, provided in an embodiment of this application. Figure 4 A schematic diagram illustrating the process of generating a feature point template in a real-time estimation method for trailer articulation angle based on feature point tracking, provided in an embodiment of this application. Figure 5 This is a schematic diagram of a real-time estimation system for trailer articulation angle based on feature point tracking, provided in an embodiment of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0026] It should be noted that the step numbers in this document are only for the convenience of explaining the specific embodiments and are not intended to limit the order in which the steps are performed. In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0027] Example 1: like Figure 1 As shown, Embodiment 1 provides a real-time estimation method for trailer articulation angle based on feature point tracking, including steps S1-S5: Step S1: Obtain the first image frame of the target trailer at the current moment and the second image frame at the previous moment; Step S2: Determine the first feature point list of the first image frame based on the second feature point list in the second image frame; Step S3: Calculate the visual estimated angle and confidence level based on the first feature point list and the preset feature point template; Step S4: Update the first Kalman filter at the current moment according to the visual estimated angle and the confidence level, obtain the updated second Kalman filter, and output the estimated hinge angle at the current moment based on the second Kalman filter; Step S5: Within a preset time period after the current moment, based on the motion data of the target trailer, perform several real-time estimations of the articulation angle using the second Kalman filter, and then output the articulation angle estimation values at each moment within the preset time period.
[0028] This application provides a real-time estimation method for trailer articulation angles based on feature point tracking. By combining feature point tracking with real-time Kalman filter updates, high-precision and high-real-time estimation of the articulation angle is achieved. First, at each image sampling moment, this embodiment performs continuous feature point tracking based on image frames from the preceding and following moments, and updates the feature point list for the current moment. Then, based on the updated feature point list and a pre-calibrated feature point template, the visually estimated angle and confidence level for the current moment are calculated. Finally, considering that while the visually estimated angle has high accuracy, its output frequency is low, making it difficult to meet the requirements of high real-time performance, this embodiment also introduces a Kalman filter to perform real-time estimation based on the target trailer's motion data. Each time an image frame is acquired, the corresponding visually estimated angle is generated and the Kalman filter's filtering parameters are corrected. During a preset time period when no image frames are acquired, the corrected Kalman filter is used to perform high-frequency real-time estimation of the articulation angle, improving the accuracy and real-time performance of the trailer articulation angle estimation.
[0029] In one possible implementation, step S2, determining the first feature point list of the first image frame based on the second feature point list in the second image frame, includes: If the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted by a preset optical flow algorithm, thereby generating the first feature point list of the first image frame; If the current time is a rematching time, then the first image frame is rematched according to the feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame. The feature point template is obtained by constructing the historical image frame sequence of the target trailer in the straight line alignment state by feature point calibration. The time interval between two adjacent rematching moments is greater than the time interval between two adjacent optical flow tracking moments.
[0030] This application provides a hybrid strategy for generating feature point lists. During optical flow tracking, the optical flow algorithm rapidly predicts feature point positions across consecutive frames, enabling low-latency angle estimation at high frame rates and meeting real-time requirements. During re-matching, feature point templates are used for precise matching, effectively correcting accumulated errors that may occur during optical flow tracking and ensuring long-term tracking stability. This hybrid strategy achieves accurate and rapid feature point tracking, providing a reliable data foundation for subsequent visual estimation and improving the accuracy and real-time performance of trailer articulation angle estimation. Furthermore, by setting the re-matching interval to be longer than the optical flow tracking interval, an optimized balance between computational efficiency and estimation accuracy is achieved. The key advantage of this design is that it can correct accumulated errors that may occur during optical flow tracking through periodic re-matching while ensuring real-time performance. This embodiment meets the real-time requirements at high frame rates through frequent optical flow tracking, reducing the time overhead of single-frame processing. Simultaneously, the introduction of a periodic re-matching mechanism effectively recovers feature points lost due to occlusion or environmental changes, improving long-term tracking stability and significantly enhancing the overall performance and applicability of the system.
[0031] In a preferred embodiment, such as Figure 2 As shown, the following modules are used to execute each step of the real-time estimation method for trailer articulation angle provided in this embodiment, specifically: Image acquisition module: Acquires video streams from the vehicle-mounted overhead camera.
[0032] ROI selection module: Interactively or automatically delineate the region of interest, i.e., the target detection region, which includes the articulated area.
[0033] Feature point extraction module: Extracts image feature points and their descriptors based on the SuperPoint network.
[0034] Calibration module: At the zero-degree position, feature point extraction, optical flow stability screening and geometric verification are performed to generate feature point templates.
[0035] Hybrid tracking module: During the tracking phase, feature point rematching (periodic) and Lucas-Kanade optical flow tracking (inter-frame) are used alternately to maintain the feature point trajectory.
[0036] Geometric verification module: Based on the principle of invariance of distance between rigid body points, it verifies the geometric consistency of tracking or matching results and eliminates mismatches and background points.
[0037] Angle calculation module: Calculates and merges the hinge angle based on the changes in the position of the tracking point.
[0038] Output module: Encapsulates information such as angle, confidence level, and system status for downstream systems to access.
[0039] Vehicle Status Interface Module: Obtains tractor motion data from the odometer, including linear velocity v_h and angular velocity ω_h.
[0040] Kalman filter fusion module: fuses visually estimated angles and vehicle motion data, and performs optimal state estimation based on a kinematic model.
[0041] Furthermore, if the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted using a preset optical flow algorithm, thereby generating a first feature point list for the first image frame, including: Based on the second image frame and the preset target detection area, the optical flow algorithm is used to predict the corresponding position of each second feature point in the second feature point list in the first image frame, and then each corresponding initial first feature point is determined in the first image frame, including the pixel position, ID and descriptor of each initial first feature point. Based on the preset detection rules and the pixel positions of each second feature point, feature points are filtered for each initial first feature point to obtain each first feature point; A list of the first feature points is constructed based on the ID, pixel position, and descriptor of each first feature point.
[0042] This embodiment further refines the specific steps of optical flow tracking, achieving efficient prediction and filtering of feature points through a preset target detection region and optical flow algorithm. This process significantly improves the real-time performance and computational efficiency of feature point tracking. First, the optical flow algorithm can quickly estimate the motion trajectory of feature points between consecutive frames, avoiding complex feature extraction and matching calculations, thereby greatly reducing the time overhead of single-frame processing and making it suitable for high frame rate real-time video stream processing. Then, the initial feature points are filtered through preset detection rules, effectively eliminating abnormal points caused by image noise or motion blur, improving the data reliability of the first feature point list. In addition, this embodiment ensures the continuity of feature points between different frames by maintaining the ID, pixel position, and descriptor information of feature points, providing stable input for subsequent angle calculations. In practical applications, this optical flow tracking mechanism not only reduces the demand for hardware computing resources but also maintains a high tracking success rate in dynamic environments, thereby improving the accuracy and stability of articulated angle estimation.
[0043] Furthermore, if the current time is a rematching time, then the first image frame is rematched according to a preset feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame, including: The first image frame and the preset target detection region are input into the preset feature point detection network, so that the feature point detection network determines a number of candidate first feature points in the first image frame, including the pixel position and descriptor of each candidate first feature point. Based on each of the candidate first feature points, the matching feature points corresponding to each third feature point in the feature point template are determined respectively. For any third feature point, the corresponding matching feature point is determined from each of the candidate first feature points by finding the nearest neighbor according to the descriptor of the third feature point, and the ID of the matching feature point is determined according to the correspondence. Geometric verification is performed on each of the matching feature points, and several rematching feature points are obtained by filtering. The second feature point list is updated based on each of the rematched feature points to obtain the first feature point list.
[0044] This application describes in detail the specific process of feature point re-matching. Through a feature point detection network and geometric verification, high-precision matching and updating of feature points are achieved. This enables the embodiment to effectively address the problem of feature point loss or accumulated error that may occur in optical flow tracking, thereby improving the long-term stability and accuracy of angle estimation. First, the feature point detection network can extract rich candidate feature points from the current image frame, covering feature regions that may be added due to occlusion or environmental changes, avoiding feature degradation during the tracking process. Second, through nearest neighbor matching and geometric verification, feature points that are highly consistent with the feature point template can be selected, ensuring the reliability of the matching results. This embodiment updates the feature point list through a re-matching mechanism, dynamically adapting to the deformation and viewpoint changes of the trailer during movement, enhancing the system's environmental adaptability, and thus maintaining effective tracking of feature points in complex scenes (such as partial occlusion and sudden changes in illumination), significantly improving the robustness and accuracy of articulated angle estimation.
[0045] Furthermore, for any third feature point, determining a corresponding matching feature point from each of the candidate first feature points by finding the nearest neighbor based on the descriptor of the third feature point, and determining the ID of the matching feature point according to the correspondence, includes: Calculate the feature distance between the descriptor of the third feature point and the descriptors of each candidate first feature point; Based on the magnitude of each of the feature distances, determine the nearest neighbor and the second nearest neighbor of the third feature point from each of the candidate first feature points; Based on the feature distances corresponding to the nearest neighbor and the second nearest neighbor, perform absolute distance threshold tests and ratio tests on the nearest neighbor and the second nearest neighbor; If the absolute distance threshold test and the ratio test pass, the nearest neighbor point is taken as the matching feature point corresponding to the third feature point, and the ID of the third feature point is taken as the ID of the matching feature point.
[0046] This embodiment further refines the specific process of feature point matching. By calculating feature distance, filtering nearest and second nearest neighbors, and performing absolute distance threshold and ratio tests, it achieves high-precision filtering of matching feature points, effectively distinguishing between correct and incorrect matching points, thereby significantly improving the accuracy and reliability of feature point matching. Specifically, this embodiment quantifies the similarity between feature points by calculating feature distances (such as Euclidean distance or Hamming distance), providing an objective basis for matching. Then, the ratio test of nearest and second nearest neighbors is used to filter out mismatches caused by image noise or similar textures, improving the confidence of the matching results; while the absolute distance threshold test further ensures the spatial consistency between matching points, avoiding matching errors caused by local deformation or occlusion. Through the above feature point matching process, this embodiment can significantly reduce the sources of error in angle calculation and improve the overall accuracy and stability of articulated angle estimation.
[0047] In a preferred embodiment, such as Figure 3 As shown, before performing optical flow tracing or rematching, the calibration template generated during the calibration phase, i.e., the feature point template, needs to be loaded in advance, and the tracking list and parameters, such as the rematching interval and matching threshold, need to be initialized. The tracking list is used to maintain the set of feature points currently being tracked, and can be represented as a dictionary TrackedSet={id→(current position p_i^k, descriptor d_i, number of consecutive tracking frames age_i, etc.)}. It is generated from the zero-degree calibration feature point template during initialization (each template point has a zero-degree position p_i^0 and a descriptor d_i). During runtime, regardless of whether a rematching strategy or an optical flow tracing strategy is used, the current position p_i^k of each point in the tracking list will be updated, thereby obtaining the feature point list corresponding to the current frame image. The updated feature point list is then used for angle calculation and filtering fusion. The tracking list can also be considered as the feature point list in the previous frame image data.
[0048] Then, the video stream from the vehicle-mounted overhead camera is continuously acquired through the image acquisition module and converted into grayscale image frames at various times, serving as the object data for optical flow tracing or rematching. The optical flow tracing or rematching strategy is then determined for the current image frame based on a preset interval. The "preset interval" refers to the rematching interval N (often denoted as sp_match_interval in engineering), meaning that "template descriptor rematching" is triggered once every N frames, while inter-frame optical flow tracing is only performed on the remaining frames. N is configurable: a smaller N results in less drift but higher computational overhead; a larger N results in lower computational overhead but higher risk of optical flow drift. The rematching strategy (k mod N=0, or triggered by quality degradation, such as when the number of effective points is too small / the geometric in-point rate is too low) is used to correct optical flow drift and recover lost points; the optical flow tracing strategy (for non-rematched frames) is used to predict points at high frequencies to ensure real-time output. Optionally, an abnormal reset / reinitialization strategy can also be added to restore stability when there are insufficient common points or continuous failures.
[0049] If it is determined that an optical flow tracing strategy is to be adopted for the current image frame, then for all points in the second feature point list in the second image frame, the Lucas-Kanade optical flow algorithm is used to predict their positions in the current first image frame from their positions in the second image frame, thus obtaining each corresponding initial first feature point. The Lucas-Kanade optical flow algorithm is a sparse optical flow algorithm based on the assumptions of constant brightness and small motion, which has high computational efficiency and is suitable for fast inter-frame tracking. Then, feature point filtering is performed on each of the initial first feature points according to the following rules to obtain each first feature point (any point that does not meet the rules is judged as a failure point and removed from the tracking list), including: (a) The LK optical flow status of the initial first feature point is successful; (b) Forward and backward consistency: ||p_i^{k-1}-back(p_i^k)|| is less than the threshold, where p_i^{k-1} represents the pixel coordinates of the i-th feature point in the (k-1)-th frame (i.e., the second image frame), p_i^k represents the pixel coordinates of the feature point in the k-th frame (i.e., the first image frame) obtained by forward optical flow prediction, and back(p_i^k) represents the position obtained by backward optical flow calculation of the p_i^k position. Specifically, it is to calculate the corresponding position of the p_i^k point from the k-th frame to the (k-1)-th frame, starting from the k-th frame and ending at the k-th frame. (c) The single-frame displacement of the initial first feature point does not exceed the threshold (anti-jump point); (d) The initial first feature point is within the ROI (region of interest); (e) The cumulative drift of the initial first feature point relative to the corresponding third feature point in the feature point template does not exceed the threshold; (f) Optional: Perform geometric verification on the optical flow tracking results periodically (e.g., every 100 frames) to remove outliers that may be drifting.
[0050] If it is determined that a rematching strategy should be used for the current image frame, the specific rematching process is as follows: (1) Run the SuperPoint network to extract the set of feature point coordinates Q and descriptor D_Q of the current frame within the ROI. The SuperPoint network is a self-supervised fully convolutional neural network that can output the feature point positions and descriptors simultaneously and has strong invariance to changes in viewpoint and illumination.
[0051] (2) Obtain each third feature point and its corresponding template descriptor from the feature point template. For each template descriptor, find the nearest and second nearest neighbors in D_Q to determine the nearest and second nearest neighbors of each third feature point in the current image frame. The L2 distance is used for the learned descriptor and the Hamming distance is used for the traditional binary descriptor.
[0052] (3) Perform a double threshold test on the nearest and second nearest neighbors of each third feature point: absolute distance threshold test and ratio test (the ratio of nearest neighbor to second nearest neighbor is less than the threshold).
[0053] (4) For each matching feature point that passes the double threshold test, form a feature point pair with each of the corresponding third feature points. Then perform RANSAC geometric verification (affine / similar transformation, etc.) on each feature point pair in the original image space to remove background points or outliers with inconsistent motion, and obtain a set of geometric interior points, i.e., several rematched feature points.
[0054] (5) Update the second feature point list of the previous frame image with several rematched feature points. Specifically: if the ID of the rematched feature point already exists in the second feature point list, then update its position in the first feature point list; if the ID of the rematched feature point does not exist in the second feature point list, then add it as a new point to the first feature point list; for points that are not matched in the second feature point list, retain their positions and add them directly to the first feature point list, and then continue to track them by optical flow.
[0055] In one possible implementation, the feature point template is constructed by calibrating feature points in a sequence of historical image frames of the target trailer in a straight-line aligned state, including: Obtain the historical image frame sequence of the target trailer in a straight-line aligned state; Each historical image frame in the historical image frame sequence is sequentially input into a preset feature point detection network, so that the feature point detection network sequentially extracts a list of historical feature points for each historical image frame. The list of historical feature points includes the historical pixel position, historical ID, and historical descriptor of each historical feature point. Based on the historical image frame sequence, the optical flow algorithm is used to continuously track each historical feature point, and the number of frames in which each historical feature point is successfully tracked is counted. Based on the number of consecutive successful tracking frames for each historical feature point and a preset frame threshold, several stable feature points are selected from each historical feature point. Geometric verification and motion consistency verification are performed on each of the stable feature points, and several third feature points are obtained by screening. The feature point template is constructed based on the historical pixel position, historical ID, and historical descriptor of each of the third feature points.
[0056] This application provides a method for constructing a feature point template. By calibrating feature points in a historical image frame sequence of a target trailer in a straight-line aligned state, stable feature points are selected to construct a feature point template, providing a high-quality reference benchmark for subsequent feature point tracking and matching, thereby significantly improving the accuracy and robustness of angle estimation. Specifically, this embodiment uses continuous optical flow tracking and frame count statistics to select feature points that perform stably in the historical sequence, avoiding feature point failure due to temporary occlusion or noise. Furthermore, geometric verification and motion consistency verification further ensure the spatiotemporal consistency of the feature point template, enhancing its applicability in complex environments. The feature point template construction method provided in this embodiment significantly reduces the reliance on manually labeled data in existing technologies, lowers system development costs, provides reliable prior information for subsequent real-time estimation of the articulation angle, and improves the accuracy and real-time performance of trailer articulation angle estimation.
[0057] In a preferred embodiment, such as Figure 4As shown, when the trailer and vehicle are aligned in a straight line (zero-degree position), a video sequence (e.g., 500 frames) from the vehicle-mounted overhead camera is acquired via the image acquisition module, forming a historical image frame sequence. In the first frame, a polygonal region of interest (ROI) is automatically defined by the user or the system, ensuring that feature points are extracted only within this region. The historical image frame sequence is then fed frame by frame into a pre-trained SuperPoint network to extract the coordinates, confidence scores, and 256-dimensional descriptors of the feature points within the ROI. The Lucas-Kanade optical flow algorithm is used to track the extracted feature points in the sequence. The number of consecutive successful tracking frames for each feature point is counted, and stable feature points exceeding a preset threshold (e.g., 100 frames) are selected. For each stable feature point, based on the constraint that the distance between points remains constant under rigid body motion, the distance matrix between the stable feature point set at the zero-degree position and the end of the tracking period is calculated. Simultaneously, points with abnormal distance changes (non-rigid body points or background points) are removed from each stable feature point to obtain a clean feature point template. Finally, the ROI coordinates and the verified feature point templates (including ID, zero-degree coordinates, and descriptors) are serialized and stored.
[0058] In one possible implementation, step S3, calculating the visual estimated angle and confidence level based on the first feature point list and the feature point template, includes: Calculate the first relative angle between each first feature point in the first feature point list and the first reference point, where the first reference point is the hinge point in the first image frame. Based on the ID of each of the first feature points, each corresponding fourth feature point is determined from the feature point template, and the second relative angle between each of the fourth feature points and the second reference point is calculated respectively. The second reference point is the hinge point in any historical image frame in the historical image frame sequence. Calculate the angle difference between each of the first relative angles and the corresponding second relative angles to obtain the individual rotation angle of each of the first feature points; Based on the rotation angle of each individual, the median angle and standard deviation of the corresponding angle are calculated, and the median angle is used as the visually estimated angle, and the standard deviation of the angle is used as the confidence level.
[0059] This application provides a method for calculating the visual estimated angle and confidence level. By introducing a reference point and comparing the differences in relative angles between the current feature point and the feature point template, the spatial distribution information of each feature point is effectively utilized to achieve accurate estimation of the articulation angle. Specifically, this embodiment calculates the relative angle between each feature point and the reference point, and then further calculates the individual rotation angle of each feature point based on the feature point template. This effectively captures the local deformation information of the trailer in the image, providing rich input for angle estimation. Finally, by statistically analyzing the median and standard deviation of these individual rotation angles, the influence of outliers on the estimation results is effectively suppressed, improving the stability of the angle estimation. This provides important prior information for subsequent updates to the Kalman filter, enabling the filtering process to be dynamically adjusted according to the visual angle estimation results. This allows the real-time estimation of the trailer articulation angle to maintain high accuracy and real-time performance in complex environments.
[0060] In a preferred embodiment, regardless of whether it is a rematch strategy or an optical flow strategy, after updating the tracking list, an angle calculation will be performed and the current frame angle will be output. When the number of valid points is insufficient or the quality is poor, it can be downgraded to maintaining the output of the previous frame / triggering early rematch / reinitializing the incremental accumulation with the absolute angle to ensure that each frame of the image has a corresponding visually estimated angle.
[0061] During the generation of the visually estimated angle for the current frame, for each first feature point in the tracking list (i.e., the first feature point list), the angle of its current position relative to the first reference point and the angle of its zero-degree position relative to the second reference point are calculated, and the difference is obtained to obtain the individual rotation angle corresponding to that first feature point. The reference point is preferably the pixel coordinates of the hinge point (spherical hinge) on the image, hinge_point=(u_h,v_h), which can be directly given by the calibration file (such as the hinge_point field) or determined by the fixed installation position; when the hinge point is unavailable, it can degenerate into the geometric center of the ROI or the centroid of the template point (accuracy will decrease). The reference point is not the feature point itself in the template, but is used to define the origin of polar coordinates to map changes in point position to changes in angle.
[0062] Each feature point i maintains two types of positions: its position p_i^0 in the feature point template (the template pixel coordinates recorded during line alignment in the calibration phase) and its current position p_i^k (obtained from rematching or optical flow in the k-th frame during the runtime phase). Taking reference points h^0 and h^k as the origin, the second relative angle θ_i^0 = atan2(p_i^0.y - h^0.y, p_i^0.x - h^0.x), the first relative angle θ_i^k = atan2(p_i^ky - h^ky, p_i^kx - h^kx), and the individual rotation angle Δ_i^k = wrap_to_pi(θ_i^k - θ_i^0).
[0063] Where p_i^0.y is the y-axis coordinate of feature point i in the feature point template, p_i^0.x is the x-axis coordinate of feature point i in the feature point template, h^0.y is the y-axis coordinate of reference point h^0, h^0.x is the x-axis coordinate of reference point h^0, p_i^ky is the y-axis coordinate of feature point i in the current image frame, p_i^kx is the x-axis coordinate of feature point i in the current image frame, h^ky is the y-axis coordinate of reference point h^k, and h^kx is the x-axis coordinate of reference point h^k.
[0064] Finally, anomaly removal (e.g., RANSAC / threshold) is performed on Δ_i^k of all valid points, and then the median or weighted median is taken as the visual angle observation z_k for this frame. The angle standard deviation is calculated and converted into confidence. The angle, confidence, number of tracking points, and system status are encapsulated in a specific format (Protobuf) and published through the vehicle communication middleware (DDS).
[0065] In one possible implementation, in step S4, updating the first Kalman filter at the current moment based on the visually estimated angle and the confidence level to obtain the updated second Kalman filter, and outputting the hinge angle estimate at the current moment based on the second Kalman filter, includes: Obtain the prior state estimation vector and the corresponding prior covariance matrix of the first Kalman filter at the current time. The observation noise at the current moment is determined based on the confidence level. The first Kalman gain of the first Kalman filter at the current time is calculated based on the observation noise, the prior covariance matrix, and the preset observation matrix. The state estimation vector of the target trailer at the current moment is calculated based on the first Kalman gain, the prior state estimation vector, the observation matrix, and the visual estimation angle. The covariance matrix of the state estimation vector is calculated based on the first Kalman gain, the observation matrix, and the prior covariance matrix. The first Kalman filter is updated based on the state estimation vector and the covariance matrix to obtain the second Kalman filter; The hinge angle estimate for the current moment is output based on the state estimation vector in the second Kalman filter.
[0066] This embodiment details the Kalman filter update process. By combining the visually estimated angle with confidence level, real-time update and optimization of the Kalman filter are achieved, ensuring the accuracy of subsequent real-time angle estimation. Simultaneously, the Kalman filter effectively suppresses inter-frame jitter caused by image noise or occlusion, outputting a reliable angle estimation result for the current moment. Specifically, this embodiment first determines the observation noise through confidence level, enabling the filtering process to dynamically adjust weights based on the reliability of the visual estimation, improving the filter's adaptability. Second, the calculation of the Kalman gain optimizes the state estimation update process, ensuring the accuracy and stability of angle estimation. Finally, this embodiment designs an update mechanism for the filter's state estimation vector and covariance matrix, enabling the system to continuously track the changing trend of the articulation angle in a dynamic environment, improving the accuracy and real-time performance of trailer articulation angle estimation.
[0067] Furthermore, obtaining the prior state estimation vector and corresponding prior covariance matrix of the first Kalman filter at the current time includes: Obtain the real-time motion data of the target trailer at the current moment and the previous state estimation vector at the previous moment; Based on the real-time motion data and the previous state estimation vector, the prior state estimation vector of the target trailer at the current moment is calculated through the state transition equation in the first Kalman filter. The prior covariance matrix of the prior state estimation vector is calculated based on the control noise, process noise, real-time motion data, and partial derivatives of the state transition equation in the first Kalman filter.
[0068] This embodiment further refines the calculation process of the prior state estimation vector and covariance matrix in the Kalman filter. By combining real-time motion data and the state transition equation, it fully utilizes the trailer's motion information to improve the timeliness and accuracy of angle estimation. First, this embodiment can predict the change in the trailer's articulation angle at the current moment using the state transition equation, real-time motion data, and the previous state estimation vector, providing reliable prior information for the filtering process. Second, the calculation of the covariance matrix considers the influence of control noise and process noise, enabling the filter to effectively cope with the uncertainty of motion data. This mechanism allows the system to maintain the continuity of angle estimation through motion data even when visual information is missing or unreliable. This embodiment improves the accuracy and real-time performance of real-time trailer articulation angle estimation by combining high-precision visual estimation with high-frequency Kalman filter estimation.
[0069] In a preferred embodiment, the process of real-time estimation of the articulation angle using a Kalman filter actually includes a continuous state prediction phase and a periodic observation update phase. Since the output frequency of the angle calculation module does not meet the real-time requirements of the planning model and may also have abnormal fluctuations, this embodiment introduces a Kalman filter to achieve high-frequency real-time output. Simultaneously, it uses relatively low-frequency visually estimated angles to periodically update the Kalman filter, improving the accuracy and real-time performance of the trailer articulation angle estimation.
[0070] In the state prediction stage, i.e., step S5, the extended Kalman filter represents the state to be estimated using the mean and covariance. In this embodiment, the state space is set as follows: ,in The angle between the axles of the trailer and the tractor. This is the longitudinal distance from the rear axle of the trailer to the ball joint. Let be the longitudinal distance from the tractor to the ball joint. Set the initial covariance of the state space to . .
[0071] During the state prediction process, the angular velocity of the tractor's rear axle is received from the tractor's odometer module. and linear velocity The state prediction equation is as follows: Also known as the state transition equation, where This refers to the state quantity from the previous moment. This represents the angular velocity and linear velocity of the tractor unit at the current moment, also known as control variables. This represents the prior state predicted by the control variable at the current moment. Then, the prior state at the current moment... for ; in The angle between the axle of the trailer and the tractor at the current moment is estimated using a motion model. This represents the longitudinal distance from the trailer's rear axle to the ball joint at the current moment. This represents the longitudinal distance from the tractor to the ball joint at the current moment. Since the motion model only calculates angles, Equal to the previous moment, Let ω be the angular velocity of the trailer. This represents the angular velocity of the tractor unit.
[0072] Since the speed of the trailer and the tractor are equal at the ball joint, assume that their velocity vector in the trailer's coordinate system is... The trailer coordinate system has the forward direction of the trailer as the x-axis, the left side as the y-axis, and the origin at the midpoint of the trailer's rear axle. ; Among them, the trailer angular velocity Prior covariance .in This represents process noise, a manually set value. To control noise, it is also the covariance of the speed of the vehicle in front. The state transition equation is given by the previous state. The partial derivative, For the partial derivatives of the state transition equation with respect to the control quantity: ; ; Since the output frequency of the tractor odometer module is higher than that of the angle calculation module, the frequency of state prediction is relatively high. That is, after each time the Kalman filter is updated using visual angle estimation, the system uses the state prediction of the Kalman filter to estimate the trailer articulation angle in real time for a period of time before receiving the next visual angle estimation. The angle output from the state prediction step is also sent downstream.
[0073] After receiving the visually estimated angle from the angle calculation module, the observation update phase begins, where the filter is updated using the following formula: ; in This represents the corrected state variable. To correct the state variables estimated by the previous motion model, The angle observation output by the angle recognition module. For the observation matrix, Let Kalman gain be denoted as . The observation equation is defined as: ; The formula for calculating Kalman gain is: ; in To observe the noise, The covariance of the states calculated for the motion model. The calculation formula is given above. Then the updated state variables... The covariance is ,in It is an identity matrix. The state variables are updated and corrected, so that when the next odometer data arrives, it will be based on the updated state. and Perform the next round of state prediction. Repeat this process to achieve high-frequency angle output.
[0074] Example 2: like Figure 5As shown, Embodiment 2 provides a real-time estimation system for trailer articulation angle based on feature point tracking, including an acquisition module 10, a feature point determination module 20, a first estimation module 30, an update module 40, and a second estimation module 50. The acquisition module 10 is used to acquire the first image frame of the target trailer at the current moment and the second image frame at the previous moment; The feature point determination module 20 is used to determine the first feature point list of the first image frame based on the second feature point list in the second image frame; The first estimation module 30 is used to calculate and obtain the visual estimation angle and confidence level based on the first feature point list and the preset feature point template; The update module 40 is used to update the first Kalman filter at the current moment according to the visual estimated angle and the confidence level, obtain the updated second Kalman filter, and output the hinge angle estimate at the current moment based on the second Kalman filter; The second estimation module 50 is used to perform several real-time estimations of the articulation angle based on the motion data of the target trailer through the second Kalman filter within a preset time period after the current time, and then output the articulation angle estimation values at each time within the preset time period.
[0075] In one possible implementation, the feature point determination module 20 determines the first feature point list of the first image frame based on the second feature point list in the second image frame, including: If the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted by a preset optical flow algorithm, thereby generating the first feature point list of the first image frame; If the current time is a rematching time, then the first image frame is rematched according to the feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame. The feature point template is obtained by constructing the historical image frame sequence of the target trailer in the straight line alignment state by feature point calibration. The time interval between two adjacent rematching moments is greater than the time interval between two adjacent optical flow tracking moments.
[0076] Furthermore, if the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted using a preset optical flow algorithm, thereby generating a first feature point list for the first image frame, including: Based on the second image frame and the preset target detection area, the optical flow algorithm is used to predict the corresponding position of each second feature point in the second feature point list in the first image frame, and then each corresponding initial first feature point is determined in the first image frame, including the pixel position, ID and descriptor of each initial first feature point. Based on the preset detection rules and the pixel positions of each second feature point, feature points are filtered for each initial first feature point to obtain each first feature point; A list of the first feature points is constructed based on the ID, pixel position, and descriptor of each first feature point.
[0077] Furthermore, if the current time is a rematching time, then the first image frame is rematched according to a preset feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame, including: The first image frame and the preset target detection region are input into the preset feature point detection network, so that the feature point detection network determines a number of candidate first feature points in the first image frame, including the pixel position and descriptor of each candidate first feature point. Based on each of the candidate first feature points, the matching feature points corresponding to each third feature point in the feature point template are determined respectively. For any third feature point, the corresponding matching feature point is determined from each of the candidate first feature points by finding the nearest neighbor according to the descriptor of the third feature point, and the ID of the matching feature point is determined according to the correspondence. Geometric verification is performed on each of the matching feature points, and several rematching feature points are obtained by filtering. The second feature point list is updated based on each of the rematched feature points to obtain the first feature point list.
[0078] Furthermore, for any third feature point, determining a corresponding matching feature point from each of the candidate first feature points by finding the nearest neighbor based on the descriptor of the third feature point, and determining the ID of the matching feature point according to the correspondence, includes: Calculate the feature distance between the descriptor of the third feature point and the descriptors of each candidate first feature point; Based on the magnitude of each of the feature distances, determine the nearest neighbor and the second nearest neighbor of the third feature point from each of the candidate first feature points; Based on the feature distances corresponding to the nearest neighbor and the second nearest neighbor, perform absolute distance threshold tests and ratio tests on the nearest neighbor and the second nearest neighbor; If the absolute distance threshold test and the ratio test pass, the nearest neighbor point is taken as the matching feature point corresponding to the third feature point, and the ID of the third feature point is taken as the ID of the matching feature point.
[0079] In one possible implementation, the feature point template is constructed by calibrating feature points in a sequence of historical image frames of the target trailer in a straight-line aligned state, including: Obtain the historical image frame sequence of the target trailer in a straight-line aligned state; Each historical image frame in the historical image frame sequence is sequentially input into a preset feature point detection network, so that the feature point detection network sequentially extracts a list of historical feature points for each historical image frame. The list of historical feature points includes the historical pixel position, historical ID, and historical descriptor of each historical feature point. Based on the historical image frame sequence, the optical flow algorithm is used to continuously track each historical feature point, and the number of frames in which each historical feature point is successfully tracked is counted. Based on the number of consecutive successful tracking frames for each historical feature point and a preset frame threshold, several stable feature points are selected from each historical feature point. Geometric verification and motion consistency verification are performed on each of the stable feature points, and several third feature points are obtained by screening. The feature point template is constructed based on the historical pixel position, historical ID, and historical descriptor of each of the third feature points.
[0080] In one possible implementation, the first estimation module 30 calculates the visual estimated angle and confidence level based on the first feature point list and the feature point template, including: Calculate the first relative angle between each first feature point in the first feature point list and the first reference point, where the first reference point is the hinge point in the first image frame. Based on the ID of each of the first feature points, each corresponding fourth feature point is determined from the feature point template, and the second relative angle between each of the fourth feature points and the second reference point is calculated respectively. The second reference point is the hinge point in any historical image frame in the historical image frame sequence. Calculate the angle difference between each of the first relative angles and the corresponding second relative angles to obtain the individual rotation angle of each of the first feature points; Based on the rotation angle of each individual, the median angle and standard deviation of the corresponding angle are calculated, and the median angle is used as the visually estimated angle, and the standard deviation of the angle is used as the confidence level.
[0081] In one possible implementation, the update module 40 updates the first Kalman filter at the current moment based on the visually estimated angle and the confidence level, obtains the updated second Kalman filter, and outputs the hinge angle estimate at the current moment based on the second Kalman filter, including: Obtain the prior state estimation vector and the corresponding prior covariance matrix of the first Kalman filter at the current time. The observation noise at the current moment is determined based on the confidence level. The first Kalman gain of the first Kalman filter at the current time is calculated based on the observation noise, the prior covariance matrix, and the preset observation matrix. The state estimation vector of the target trailer at the current moment is calculated based on the first Kalman gain, the prior state estimation vector, the observation matrix, and the visual estimation angle. The covariance matrix of the state estimation vector is calculated based on the first Kalman gain, the observation matrix, and the prior covariance matrix. The first Kalman filter is updated based on the state estimation vector and the covariance matrix to obtain the second Kalman filter; The hinge angle estimate for the current moment is output based on the state estimation vector in the second Kalman filter.
[0082] Furthermore, obtaining the prior state estimation vector and corresponding prior covariance matrix of the first Kalman filter at the current time includes: Obtain the real-time motion data of the target trailer at the current moment and the previous state estimation vector at the previous moment; Based on the real-time motion data and the previous state estimation vector, the prior state estimation vector of the target trailer at the current moment is calculated through the state transition equation in the first Kalman filter. The prior covariance matrix of the prior state estimation vector is calculated based on the control noise, process noise, real-time motion data, and partial derivatives of the state transition equation in the first Kalman filter.
[0083] This application provides a real-time estimation system for trailer articulation angles based on feature point tracking. By combining feature point tracking with real-time Kalman filter updates, it achieves high-precision and high-real-time estimation of the articulation angle. First, at each image sampling moment, this embodiment performs continuous feature point tracking based on image frames from the preceding and following moments, and updates the feature point list for the current moment. Then, based on the updated feature point list and pre-calibrated feature point templates, the visually estimated angle and confidence level for the current moment are calculated. Finally, considering that while the visually estimated angle has high accuracy, its output frequency is low, making it difficult to meet the requirements of high real-time performance, this embodiment also introduces a Kalman filter to perform real-time estimation based on the motion data of the target trailer. Each time an image frame is acquired, the corresponding visually estimated angle is generated and the filtering parameters of the Kalman filter are corrected. During a preset time period when no image frames are acquired, the corrected Kalman filter is used to perform high-frequency real-time estimation of the articulation angle, improving the accuracy and real-time performance of the trailer articulation angle estimation.
[0084] For a more detailed explanation of the working principle and procedures of this embodiment, please refer to the relevant description in Embodiment 1.
[0085] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.
Claims
1. A real-time estimation method for trailer articulation angle based on feature point tracking, characterized in that, include: Acquire the first image frame of the target trailer at the current moment and the second image frame at the previous moment; The first feature point list of the first image frame is determined based on the second feature point list in the second image frame; The visual estimated angle and confidence level are calculated based on the first feature point list and the preset feature point template. The first Kalman filter at the current moment is updated based on the visual estimated angle and the confidence level to obtain the updated second Kalman filter, and the hinge angle estimate at the current moment is output based on the second Kalman filter. Within a preset time period following the current moment, the hinge angle is estimated several times in real time using the second Kalman filter based on the motion data of the target trailer, and then the estimated hinge angle values at each moment within the preset time period are output.
2. The method for real-time estimation of trailer articulation angle based on feature point tracking as described in claim 1, characterized in that, Determining the first feature point list of the first image frame based on the second feature point list in the second image frame includes: If the current time is the optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted by a preset optical flow algorithm, thereby generating the first feature point list of the first image frame; If the current time is a rematching time, then the first image frame is rematched according to the feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame. The feature point template is obtained by constructing the historical image frame sequence of the target trailer in the straight line alignment state by feature point calibration. The time interval between two adjacent rematching moments is greater than the time interval between two adjacent optical flow tracking moments.
3. The method for real-time estimation of trailer articulation angle based on feature point tracking as described in claim 2, characterized in that, If the current time is an optical flow tracking time, then based on the second feature point list in the second image frame, a number of first feature points in the first image frame are predicted using a preset optical flow algorithm, thereby generating a first feature point list for the first image frame, including: Based on the second image frame and the preset target detection area, the optical flow algorithm is used to predict the corresponding position of each second feature point in the second feature point list in the first image frame, and then each corresponding initial first feature point is determined in the first image frame, including the pixel position, ID and descriptor of each initial first feature point. Based on the preset detection rules and the pixel positions of each second feature point, feature points are filtered for each initial first feature point to obtain each first feature point; A list of the first feature points is constructed based on the ID, pixel position, and descriptor of each first feature point.
4. The method for real-time estimation of trailer articulation angle based on feature point tracking as described in claim 2, characterized in that, If the current time is a rematching time, then the first image frame is rematched according to a preset feature point template, and the second feature point list is updated according to the rematching result to obtain the first feature point list of the first image frame, including: The first image frame and the preset target detection region are input into the preset feature point detection network, so that the feature point detection network determines a number of candidate first feature points in the first image frame, including the pixel position and descriptor of each candidate first feature point. Based on each of the candidate first feature points, the matching feature points corresponding to each third feature point in the feature point template are determined respectively. For any third feature point, the corresponding matching feature point is determined from each of the candidate first feature points by finding the nearest neighbor according to the descriptor of the third feature point, and the ID of the matching feature point is determined according to the correspondence. Geometric verification is performed on each of the matching feature points, and several rematching feature points are obtained by filtering. The second feature point list is updated based on each of the rematched feature points to obtain the first feature point list.
5. The method for real-time estimation of trailer articulation angle based on feature point tracking as described in claim 4, characterized in that, For any of the third feature points, determining the corresponding matching feature point from each of the candidate first feature points by finding the nearest neighbor based on the descriptor of the third feature point, and determining the ID of the matching feature point according to the correspondence, includes: Calculate the feature distance between the descriptor of the third feature point and the descriptors of each candidate first feature point; Based on the magnitude of each of the feature distances, determine the nearest neighbor and the second nearest neighbor of the third feature point from each of the candidate first feature points; Based on the feature distances corresponding to the nearest neighbor and the second nearest neighbor, perform absolute distance threshold tests and ratio tests on the nearest neighbor and the second nearest neighbor; If the absolute distance threshold test and the ratio test pass, the nearest neighbor point is taken as the matching feature point corresponding to the third feature point, and the ID of the third feature point is taken as the ID of the matching feature point.
6. A real-time estimation method for trailer articulation angle based on feature point tracking as described in any one of claims 1-5, characterized in that, The feature point template is constructed by calibrating feature points in a sequence of historical image frames of the target trailer in a straight-line aligned state, including: Obtain the historical image frame sequence of the target trailer in a straight-line aligned state; Each historical image frame in the historical image frame sequence is sequentially input into a preset feature point detection network, so that the feature point detection network sequentially extracts a list of historical feature points for each historical image frame. The list of historical feature points includes the historical pixel position, historical ID, and historical descriptor of each historical feature point. Based on the historical image frame sequence, the optical flow algorithm is used to continuously track each historical feature point, and the number of frames in which each historical feature point is successfully tracked is counted. Based on the number of consecutive successful tracking frames for each historical feature point and a preset frame threshold, several stable feature points are selected from each historical feature point. Geometric verification and motion consistency verification are performed on each of the stable feature points, and several third feature points are obtained by screening. The feature point template is constructed based on the historical pixel position, historical ID, and historical descriptor of each of the third feature points.
7. A real-time estimation method for trailer articulation angle based on feature point tracking as described in any one of claims 1-5, characterized in that, The step of calculating the visual estimated angle and confidence level based on the first feature point list and the feature point template includes: Calculate the first relative angle between each first feature point in the first feature point list and the first reference point, where the first reference point is the hinge point in the first image frame. Based on the ID of each of the first feature points, each corresponding fourth feature point is determined from the feature point template, and the second relative angle between each of the fourth feature points and the second reference point is calculated respectively. The second reference point is the hinge point in any historical image frame in the historical image frame sequence. Calculate the angle difference between each of the first relative angles and the corresponding second relative angles to obtain the individual rotation angle of each of the first feature points; Based on the rotation angle of each individual, the median angle and standard deviation of the corresponding angle are calculated, and the median angle is used as the visually estimated angle, and the standard deviation of the angle is used as the confidence level.
8. A real-time estimation method for trailer articulation angle based on feature point tracking as described in any one of claims 1-5, characterized in that, The step of updating the first Kalman filter at the current moment based on the visually estimated angle and the confidence level, obtaining the updated second Kalman filter, and outputting the articulation angle estimate at the current moment based on the second Kalman filter includes: Obtain the prior state estimation vector and the corresponding prior covariance matrix of the first Kalman filter at the current time. The observation noise at the current moment is determined based on the confidence level. The first Kalman gain of the first Kalman filter at the current time is calculated based on the observation noise, the prior covariance matrix, and the preset observation matrix. The state estimation vector of the target trailer at the current moment is calculated based on the first Kalman gain, the prior state estimation vector, the observation matrix, and the visual estimation angle. The covariance matrix of the state estimation vector is calculated based on the first Kalman gain, the observation matrix, and the prior covariance matrix. The first Kalman filter is updated based on the state estimation vector and the covariance matrix to obtain the second Kalman filter; The hinge angle estimate for the current moment is output based on the state estimation vector in the second Kalman filter.
9. The method for real-time estimation of trailer articulation angle based on feature point tracking as described in claim 8, characterized in that, The step of obtaining the prior state estimation vector and the corresponding prior covariance matrix of the first Kalman filter at the current time includes: Obtain the real-time motion data of the target trailer at the current moment and the previous state estimation vector at the previous moment; Based on the real-time motion data and the previous state estimation vector, the prior state estimation vector of the target trailer at the current moment is calculated through the state transition equation in the first Kalman filter. The prior covariance matrix of the prior state estimation vector is calculated based on the control noise, process noise, real-time motion data, and partial derivatives of the state transition equation in the first Kalman filter.
10. A real-time estimation system for trailer articulation angle based on feature point tracking, characterized in that, It includes an acquisition module, a feature point determination module, a first estimation module, an update module, and a second estimation module; The acquisition module is used to acquire the first image frame of the target trailer at the current moment and the second image frame at the previous moment; The feature point determination module is used to determine the first feature point list of the first image frame based on the second feature point list in the second image frame; The first estimation module is used to calculate and obtain the visual estimation angle and confidence level based on the first feature point list and the preset feature point template; The update module is used to update the first Kalman filter at the current moment according to the visual estimated angle and the confidence level, obtain the updated second Kalman filter, and output the hinge angle estimate at the current moment based on the second Kalman filter; The second estimation module is used to perform several real-time estimations of the articulation angle based on the motion data of the target trailer through the second Kalman filter within a preset time period after the current time, and then output the articulation angle estimation values at each time within the preset time period.
