A vehicle illegal parking judgment method based on space-time cumulative features
By using a method based on spatiotemporal cumulative features, the actual inter-frame displacement of the vehicle trajectory is calculated and adaptively smoothed, which solves the problems of error and perspective distortion in vehicle illegal parking detection and improves the accuracy and stability of detection.
Patent Information
- Application Number
- CN202511686946.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-11-18
AI Technical Summary
Existing methods for detecting illegally parked vehicles suffer from insufficient stability and high misjudgment rates when faced with errors in the calculation of the detection frame position, perspective distortion, and deficiencies in the adaptability of a unified threshold, making it difficult to meet the needs of intelligent traffic management.
By using a method based on spatiotemporal cumulative features, the actual inter-frame displacement of the vehicle trajectory is calculated, an adaptive inter-frame displacement threshold curve is established, and a smoothing process is performed using an exponentially weighted moving average mechanism to determine whether the vehicle is in an illegally parked state.
It effectively overcomes the effects of detection frame jitter, noise interference, and perspective distortion, improving the accuracy and robustness of vehicle illegal parking detection, and can sensitively respond to changes in vehicle movement status while maintaining judgment stability.
Smart Images

Figure CN121147862B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent transportation technology, specifically a method for determining illegal parking of vehicles based on spatiotemporal cumulative characteristics. Background Technology
[0002] In intelligent traffic management systems, the automatic detection of illegally parked vehicles is crucial. Currently, common methods for detecting illegally parked vehicles mainly rely on analyzing changes in the position of vehicle detection boxes in video sequences to determine whether the vehicle is stationary.
[0003] However, these methods face significant challenges in practical applications. First, due to inherent fluctuations in object detection algorithms, noise interference in video footage, and perspective distortion, the calculation of vehicle detection box positions between adjacent frames—i.e., inter-frame displacement—inevitably suffers from jitter and errors. Second, perspective distortion causes vehicles at different distances from the camera to exhibit significantly different inter-frame displacements in the image, even if they move at the same actual speed, making it difficult to accurately determine their position using a uniform threshold. These issues collectively result in insufficient stability and a high false positive rate in traditional illegal parking detection methods, making them unsuitable for meeting actual management needs.
[0004] Therefore, there is an urgent need for a more reliable technology to determine illegal parking of vehicles in order to meet the management needs of intelligent transportation. Summary of the Invention
[0005] The purpose of this application is to provide a method for determining illegal parking of vehicles based on spatiotemporal cumulative features, so as to solve the technical problems mentioned in the background art.
[0006] To achieve the above objectives, this application discloses the following technical solution: This application discloses a method for determining illegal parking of vehicles based on spatiotemporal cumulative features, comprising the following steps:
[0007] The input video sequence is processed to obtain the detection box of the vehicle in the current frame and the detection boxes in historical frames, and the vehicle trajectory is generated based on the continuous detection boxes.
[0008] The actual inter-frame displacement of the vehicle is calculated based on the coordinates of the center points of the detection boxes in adjacent frames of the vehicle trajectory.
[0009] Based on the correspondence between the center ordinate of the detection box and the actual inter-frame displacement in the historical trajectory data, an adaptive inter-frame displacement threshold curve is established. The adaptive inter-frame displacement threshold curve is used to characterize the statistical average value of the vehicle's inter-frame displacement at different ordinate positions.
[0010] The actual inter-frame displacement is normalized using the adaptive inter-frame displacement threshold curve to obtain the normalized inter-frame displacement.
[0011] Based on the exponentially weighted moving average mechanism, an adaptive smoothing factor is used to smooth the normalized inter-frame displacement, and the adaptive weighted average displacement of the vehicle is calculated.
[0012] The adaptive weighted average displacement is compared with a preset judgment threshold, and the vehicle is determined to be in an illegal parking state based on the comparison result.
[0013] Optionally, the step of obtaining the vehicle's detection bounding box in the current frame and the detection bounding boxes in historical frames, and generating the vehicle trajectory based on the continuous detection bounding boxes, includes:
[0014] The video frames in the video sequence are input to the vehicle detection module, and the vehicle detection module outputs a multi-scale feature map with vehicle location information.
[0015] The multi-scale feature map is input into the appearance feature extraction module, which then fuses the multi-scale features and extracts the vehicle's appearance features.
[0016] The vehicle location information and the appearance features are input into the vehicle tracking module, which performs data association and trajectory prediction to output a continuous vehicle trajectory.
[0017] Optionally, the vehicle detection module is constructed based on the YOLOv8 network structure, and its decoupling head is provided with a re-identification feature output branch, which is used to synchronously output feature vectors for vehicle re-identification from the input video frames.
[0018] Optionally, the appearance feature extraction module is equipped with a dual attention fusion mechanism, which is used to simultaneously perform spatial and channel-dimensional attention weighting processing on the multi-scale feature map to fuse and enhance the feature representation capability.
[0019] Optionally, the vehicle tracking module is equipped with a BotSORT-ReID algorithm framework. The BotSORT-ReID algorithm framework is used to predict the motion state of the detection box through Kalman filtering, and to comprehensively calculate the intersection-union ratio between the predicted box and the detection box and the cosine similarity between the apparent features. The cosine similarity is used as the basis for trajectory association to generate a stable vehicle trajectory.
[0020] Optionally, the process of establishing the adaptive inter-frame displacement threshold curve includes:
[0021] Using polynomial functions The ordinate of the center of the detection box in the historical trajectory dataset With the corresponding actual inter-frame displacement Perform fitting, where, The vertical axis is The corresponding fitted inter-frame displacement value at that time. The degree of the polynomial is preset. The first polynomial function to be determined is the... Term coefficient, Represents the ordinate of the center of the detection frame of Power of;
[0022] Based on the principle of least squares, by minimizing the sum of squared errors Solve the above-mentioned first Term coefficient The initial fitted curve is obtained, where The number of historical trajectory points. and They represent the first The vertical coordinate of the detection box center and the actual inter-frame displacement of each historical trajectory data point. express of Power of;
[0023] Based on the distribution of data points relative to the initial fitted curve, the fitting process is optimized using the weighted least squares method. The formula for the weighted least squares method is as follows: ,in, This indicates the number of data points located above the initial fitted curve. The set of data points that belong to the area above the initial fitted curve. This represents the ordinate of the center of the detection box for the data point located above the initial fitted curve. for of Power of 1 express The corresponding actual inter-frame displacement, This represents the preset weights assigned to the data points above the initial fitted curve. This indicates the number of data points located below the initial fitted curve. The set of data points below the initial fitted curve. The ordinate of the detection box center for the data point located below the initial fitting curve. for of Power of 1 for The corresponding actual inter-frame displacement, This represents the preset weights assigned to the data points below the initial fitted curve;
[0024] The optimized initial fitting curve is then subjected to a final polynomial fitting, outputting a smooth adaptive inter-frame displacement threshold curve.
[0025] Optionally, the formula for calculating the normalized inter-frame offset is:
[0026]
[0027] in, Representing the trajectory In the current frame Normalized inter-frame shift, Representing the trajectory In the current frame The actual inter-frame displacement. This indicates that the adaptive inter-frame displacement threshold curve is in the trajectory In the current frame The center ordinate of the detection frame The threshold corresponding to the location.
[0028] Optionally, the adaptive weighted average displacement is iteratively updated using the following formula:
[0029]
[0030] in, Representing the trajectory In the current frame The adaptive weighted average displacement Representing the trajectory In the previous frame The adaptive weighted average displacement Representing the trajectory In the current frame Normalized inter-frame shift, is the adaptive smoothing factor.
[0031] Optionally, the adaptive smoothing factor is dynamically calculated using the following formula:
[0032]
[0033] in, Representing the trajectory Up to the current frame The number of frames that are continuously in a low-motion state. Representing the trajectory Up to the previous frame The number of frames that are continuously in a low-motion state. This is a preset smoothing constant used to ensure the stability of numerical calculations.
[0034] Optionally, determining whether a vehicle is illegally parked based on the comparison result includes:
[0035] If trajectory In the current frame The calculated adaptive weighted average displacement When the value is less than the preset judgment threshold, the judgment trajectory is determined. The corresponding vehicle is in an illegally parked state; otherwise, the vehicle is determined to be in a normal driving state.
[0036] Beneficial effects: The vehicle illegal parking determination method based on spatiotemporal cumulative features proposed in this application smooths the inter-frame displacement fluctuations through an exponentially weighted moving average mechanism, and normalizes the displacement by combining an adaptive inter-frame displacement threshold curve based on the ordinate of the detection box center. This effectively overcomes the adverse effects of detection box jitter, noise interference, and perspective distortion, thereby enabling sensitive response to changes in the actual motion state of the vehicle. At the same time, it maintains the stability of the determination when the vehicle is stationary for a long time or at low speed, improving the accuracy of vehicle illegal parking detection and the robustness of the system. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A flowchart illustrating the vehicle illegal parking determination method based on spatiotemporal cumulative features provided in this application embodiment. Detailed Implementation
[0039] To facilitate understanding of the technical solutions provided in the embodiments of this application, the background technology involved in the embodiments of this application will be described below.
[0040] In intelligent traffic management systems, the automatic and accurate detection of illegal parking is a key element in improving traffic management efficiency and ensuring road traffic order. Its core requirement is the real-time identification of vehicles that are stationary or moving at low speeds for extended periods without permission, providing a reliable basis for subsequent enforcement actions. Currently, mainstream illegal parking detection methods in the industry generally use video sequences as the analysis object. The core logic is to track the changes in the detection frame position of the vehicle in consecutive video frames, calculate the inter-frame displacement parameters, and then determine whether the vehicle is stationary, thus completing the initial judgment of illegal parking.
[0041] However, these traditional methods based on changes in the detection box position face multiple technical challenges in complex real-world application scenarios, making it difficult for their detection performance to meet the needs of refined management. Specifically, these challenges are reflected in the following aspects:
[0042] I. Inherent Errors and Jitter in Detection Frame Position Calculation
[0043] The acquisition of vehicle detection bounding boxes relies on the object detection algorithm to identify and locate vehicle targets in video frames. However, this process is subject to unavoidable sources of error. On the one hand, performance fluctuations in the object detection algorithm itself directly affect the accuracy of the detection boxes. Even mature detection models may experience slight shifts in the coordinates of the detection box boundaries or center points due to factors such as changes in vehicle posture and occlusion. On the other hand, unavoidable video noise during video acquisition (such as changes in lighting, background interference, and transmission loss) further exacerbates the jitter in the detection box positions. This means that the changes in the center point coordinates of the detection boxes between adjacent frames do not fully reflect the actual movement of the vehicle, but rather contain a large amount of invalid fluctuation signals, leading to distortion in the inter-frame displacement calculation results.
[0044] II. Inter-frame displacement characterization deviation caused by perspective distortion
[0045] In road surveillance scenarios, cameras are typically installed at a fixed angle, resulting in significant perspective distortion in the video footage. This effect directly leads to noticeable differences in the inter-frame displacement of vehicles at different distances from the camera (corresponding to different ordinates of the detection box center in the video frame), even if their actual movement speed is exactly the same. Vehicles at closer distances show larger inter-frame displacement values, while those at greater distances show smaller values. This mismatch between displacement representation and actual motion makes it impossible to measure the true movement of vehicles using a unified standard for image plane displacement, creating a natural obstacle to subsequent stationary vehicle identification.
[0046] III. Adaptability defects of the unified judgment threshold
[0047] Due to the inter-frame displacement distortion and differences caused by detection frame jitter and perspective deformation, the unified judgment threshold strategy used in traditional methods has a fundamental adaptability flaw. If the threshold is set too high, it will result in insufficient sensitivity to vehicles moving slowly or slightly at long distances, failing to identify their stationary state in time, leading to missed detections. If the threshold is set too low, invalid displacement caused by detection frame jitter will be misjudged as vehicle movement, or normal small displacement of vehicles at long distances will be mistakenly judged as stationary, resulting in a significant increase in the false detection rate. This contradiction makes it difficult for traditional methods to find a balance between sensitively responding to changes in actual vehicle movement and maintaining stability in judging stationary states. Ultimately, this leads to insufficient stability and low reliability of the detection results in the entire illegal parking detection system, failing to meet the core needs of accurate enforcement and efficient control in actual traffic management.
[0048] Based on the aforementioned technical shortcomings of traditional illegal parking detection methods, this application provides a vehicle illegal parking determination method based on spatiotemporal cumulative features, aiming to overcome the above defects from the root and improve the accuracy and robustness of illegal parking detection.
[0049] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application. Secondly, in this document, the term "comprising" is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements, but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0050] The vehicle illegal parking determination method based on spatiotemporal cumulative features provided in this embodiment, such as... Figure 1 As shown, it includes the following steps:
[0051] S1 processes the input video sequence to obtain the vehicle's detection box in the current frame and in previous frames, and generates the vehicle trajectory based on the continuous detection boxes. In practice, the video sequence is captured by a high-definition network camera (1080P resolution, 25fps) commonly used in road monitoring scenarios. The detection box is a rectangular box representing the position and range of the vehicle in the video frame, and its center point coordinates are defined with the upper left corner of the video frame as the origin, the horizontal direction to the right as the x-axis, and the vertical direction downward as the y-axis.
[0052] S2 - Calculate the actual inter-frame displacement of the vehicle based on the coordinates of the center points of the detection frames in adjacent frames of the vehicle trajectory. In practice, the actual inter-frame displacement is calculated by using the Euclidean distance between the coordinates of the center points of the detection frames in adjacent frames, as shown in the formula: ,in For trajectory In the current frame The coordinates of the center point of the detection frame, For trajectory In the previous frame The coordinates of the center point of the detection frame.
[0053] S3 - Based on the correspondence between the center ordinate of the detection box and the actual inter-frame displacement in historical trajectory data, an adaptive inter-frame displacement threshold curve is established. This curve represents the statistical average of the vehicle's inter-frame displacement at different ordinate positions. In practice, historical trajectory data is selected from trajectory samples of normally driving vehicles within one month on the target monitoring road segment (sample size not less than 10,000) to ensure that the curve closely matches the actual traffic scenario of that road segment.
[0054] S4 - By using an adaptive inter-frame displacement threshold curve, the actual inter-frame displacement is normalized to obtain the normalized inter-frame displacement, thereby eliminating the displacement scale difference caused by perspective distortion.
[0055] S5 is based on an exponentially weighted moving average mechanism. It uses an adaptive smoothing factor to smooth the normalized inter-frame displacement and calculates the adaptive weighted average displacement of the vehicle.
[0056] S6 compares the adaptive weighted average displacement with a preset judgment threshold and determines whether the vehicle is illegally parked based on the comparison result. In specific implementation, the preset judgment threshold is an industry-standard normalized threshold, such as 0.3 (unitless), used to distinguish between a stationary / low-speed stop and a normal driving state.
[0057] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment achieves accurate illegal parking determination through multi-step collaborative action. First, basic quantitative data of vehicle motion is obtained through actual inter-frame displacement calculation, providing the original basis for subsequent analysis. Second, the adaptive inter-frame displacement threshold curve is constructed based on the statistical regularity of historical trajectory data, which can accurately match the displacement features of different vertical coordinates (corresponding to the distance between the vehicle and the camera), fundamentally offsetting the displacement representation deviation caused by perspective distortion. Then, through normalization processing, the displacements of vehicles at different distances are unified to the same evaluation scale, solving the problem that traditional unified thresholds cannot adapt to perspective distortion. Finally, the exponential weighted moving average mechanism combined with an adaptive smoothing factor effectively smooths the instantaneous displacement fluctuations caused by detection box jitter and video noise, while preserving the spatiotemporal cumulative features of the vehicle's motion state. The entire technical process can sensitively capture the state changes of the vehicle from stationary to starting and from driving to stationary, and can maintain the stability of the determination when the vehicle is stationary for a long time or at low speed, reducing the probability of false judgment and improving the accuracy and robustness of illegal parking detection.
[0058] As an optional implementation of this embodiment, the detection boxes of the vehicle in the current frame and the detection boxes in historical frames are obtained, and the vehicle trajectory is generated based on the continuous detection boxes, including:
[0059] S11 - The video frames in the video sequence are input to the vehicle detection module, which outputs a multi-scale feature map containing vehicle location information. In specific implementation, the video frames are in RGB format, and the multi-scale feature map includes three scales: P3, P4, and P5 (corresponding to receptive fields of 8×8, 16×16, and 32×32 pixels, respectively), each adapted to vehicle targets of different sizes.
[0060] S12 - The multi-scale feature map is input to the appearance feature extraction module, which then fuses the multi-scale features and extracts the vehicle's appearance features. In practice, appearance features are high-dimensional vectors that characterize differences in vehicle appearance, used to distinguish between different individual vehicles.
[0061] S13 - Vehicle location information and appearance features are input to the vehicle tracking module, which performs data association and trajectory prediction, outputting a continuous vehicle trajectory. In specific implementation, data association refers to matching the vehicle detected in the current frame with vehicles in historical trajectories, and trajectory prediction infers the possible position of the current frame based on the vehicle's historical motion state.
[0062] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment constructs a stable vehicle trajectory generation process through a three-level module architecture of detection, feature extraction, and tracking. The multi-scale feature map output by the vehicle detection module can take into account the position detection needs of large vehicles at close range and small vehicles at long distance, ensuring that vehicle targets of different scales can be effectively identified. The appearance feature extraction module enhances the discriminative power of vehicle appearance features through multi-scale feature fusion, providing a key basis for distinguishing different vehicles. The trajectory prediction and data association functions of the vehicle tracking module can maintain the continuity of the trajectory in scenarios where the vehicle is briefly occluded or its posture changes, avoiding trajectory breakage caused by detection interruption. The collaborative work of the three-level modules ensures the accuracy of vehicle detection box acquisition and the stability of trajectory generation, providing high-quality basic data support for inter-frame displacement calculation and illegal parking status determination, and reducing subsequent determination errors caused by trajectory instability.
[0063] Based on the aforementioned three-level module architecture, as a further optional implementation method in this embodiment, the vehicle detection module is constructed based on the YOLOv8 network structure, and its decoupling head is equipped with a re-identification feature output branch. The re-identification feature output branch is used to synchronously output feature vectors for vehicle re-identification from the input video frames. In specific implementation, the backbone network of the YOLOv8 network adopts the C2f module, the neck network is an SPPF structure, and the decoupling head includes a classification branch, a regression branch, and a newly added re-identification feature output branch. The dimension of the re-identification feature vector is set to 256 dimensions (the industry standard for high-dimensional feature dimensions), which can accurately represent vehicle appearance differences.
[0064] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment optimizes the network structure of the vehicle detection module, achieving simultaneous output of multiple tasks including location detection and re-identification feature extraction. The YOLOv8 network itself possesses efficient and accurate target detection capabilities, enabling rapid output of vehicle location information to meet real-time detection requirements. The addition of a re-identification feature output branch in the decoupling head eliminates the need for a separate feature extraction network, reducing system computation and latency and improving overall processing efficiency. The synchronously output re-identification feature vector dimension is adapted to the vehicle re-identification requirements, accurately distinguishing different individual vehicles and providing a core basis for trajectory association in subsequent vehicle tracking modules. This effectively avoids trajectory confusion in multi-vehicle scenarios, further improving the accuracy of trajectory generation.
[0065] Based on the aforementioned three-level module architecture, as another optional implementation method in this embodiment, the appearance feature extraction module is equipped with a dual attention fusion mechanism. This mechanism simultaneously performs spatial and channel-level attention weighting on multi-scale feature maps to fuse and enhance feature representation capabilities, thereby extracting more discriminative vehicle appearance features. In specific implementation, spatial-level attention weighting generates a spatial attention map (weight values ranging from 0 to 1) to highlight the features of the vehicle target region and suppress background interference; channel-level attention weighting adopts a squeeze-excitement (SE) structure, assigning weights of 0.1-1.5 to features in different channels to strengthen effective feature channels and weaken redundant channels.
[0066] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment optimizes the appearance feature extraction process through a dual attention fusion mechanism, filtering and enhancing multi-scale features from both spatial and channel dimensions. Spatial dimension attention weighting accurately focuses on the vehicle target area, filtering out interference from irrelevant information such as road background and other obstacles; channel dimension attention weighting adaptively identifies feature channels more effective in distinguishing vehicles, improving feature specificity. The synergistic effect of both makes the extracted vehicle appearance features more discriminative, effectively addressing feature confusion issues in scenarios such as similar vehicle colors, changes in posture, and partial occlusion. This provides high-quality feature support for accurate data association in the vehicle tracking module, further ensuring the continuity and stability of the trajectory.
[0067] Based on the aforementioned three-level module architecture, as a further optional implementation of this embodiment, the vehicle tracking module includes a BotSORT-ReID algorithm framework. This framework is used to predict the motion state of the detection boxes using Kalman filtering, and comprehensively calculates the intersection-over-union ratio (IoU) between the predicted and detected boxes, as well as the cosine similarity between apparent features. This cosine similarity is used as the basis for trajectory association to generate a stable vehicle trajectory. In specific implementation, the state vector of the Kalman filter includes the x-coordinate, y-coordinate, width, height, and corresponding velocity of the detection box center point. The process noise covariance Q is set as... Let the observation noise covariance R be set as The threshold for calculating the intersection-union ratio (IoU) is set to 0.3, and the threshold for determining cosine similarity is set to 0.5. Both serve as the quantitative basis for trajectory association.
[0068] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment optimizes the vehicle tracking process through the BotSORT-ReID algorithm framework, achieving accurate tracking based on motion state prediction and dual association criteria. Kalman filtering can accurately predict the possible position of the detection box in the current frame based on the vehicle's historical motion state, providing initial guidance for trajectory association. The intersection-over-union ratio reflects the degree of positional overlap between the predicted box and the detection box, while cosine similarity reflects the degree of matching of vehicle appearance features. The combined association method considers both positional continuity and appearance consistency. This dual association mechanism can effectively cope with complex scenarios such as vehicle occlusion, close-range parallelism, and attitude changes, avoiding trajectory breakage and confusion problems caused by single position association or single feature association. The generated vehicle trajectory is more stable and accurate, providing reliable basic data for subsequent inter-frame displacement calculations.
[0069] As an optional implementation of this embodiment, the process of establishing the adaptive inter-frame displacement threshold curve includes:
[0070] S31 - Using Polynomial Functions The ordinate of the center of the detection box in the historical trajectory dataset With the corresponding actual inter-frame displacement Fitting is performed (it should be noted that, in this text, to simplify the expressions in the formulas for minimizing the sum of squared errors and the weighted least squares method described later, the actual inter-frame displacement is represented by the symbol...). To indicate, its relation to the preceding and following " The definition of "" is unless the specific trajectory and video frame are not explicitly stated (e.g.) It expresses the trajectory In the current frame The actual inter-frame displacement is the same outside, and similarly, in the later... , and (This is also true), among which, The vertical axis is The corresponding fitted inter-frame displacement value at that time. The degree of the polynomial is preset. Let the polynomial function to be found be the first... Term coefficient, Indicates the center coordinates of the detection frame of The degree of the polynomial is set to 3 in practice to balance fitting accuracy and computational efficiency.
[0071] S32 - Based on the principle of least squares, by minimizing the sum of squared errors. Solve the first Term coefficient The initial fitted curve is obtained, where The number of historical trajectory points. and They represent the first The vertical coordinate of the detection box center and the actual inter-frame displacement of each historical trajectory data point. express of Power of 1.
[0072] S33 - Based on the distribution of data points relative to the initial fitted curve, the weighted least squares method is used to optimize the fitting process. The formula for the weighted least squares method is: ,in, This indicates the number of data points located above the initial fitted curve. The set of data points that belong to the area above the initial fitted curve. This represents the ordinate of the center of the detection box for the data point located above the initial fitted curve. for of Power of 1 express The corresponding actual inter-frame displacement, This represents the preset weights assigned to the data points above the initial fitted curve. This indicates the number of data points located below the initial fitted curve. The set of data points located below the initial fitted curve. The ordinate of the detection box center for the data point located below the initial fitting curve. for of Power of 1 for The corresponding actual inter-frame displacement, This represents the preset weights assigned to data points below the initial fitted curve. In practice, the preset weights assigned to data points above the initial fitted curve are set to 0.3, and the preset weights assigned to data points below the initial fitted curve are set to 0.7.
[0073] S34 performs a final polynomial fit on the optimized initial fitting curve, outputting a smooth adaptive inter-frame displacement threshold curve.
[0074] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment constructs an adaptive inter-frame displacement threshold curve that accurately adapts to the scene through a four-step process: polynomial fitting, least squares solution, weighted optimization, and final fitting. The preset polynomial degree ensures fitting accuracy while avoiding overfitting; the least squares method minimizes the sum of squared errors to ensure the initial fitted curve closely matches the overall distribution trend of historical data; the weighted least squares method sets differentiated weights to make the fitted curve more closely match data points below the initial curve, ensuring that the trajectory points of most normally driving vehicles are above the curve, enabling the curve to accurately represent the average inter-frame displacement of normal driving at different ordinate positions; the final polynomial fitting further improves the smoothness of the curve, avoiding curve distortion caused by local data fluctuations. The entire curve establishment process fully utilizes the statistical regularities of historical trajectory data, and the generated threshold curve can accurately match the scene's perspective features, providing a reliable basis for subsequent normalization processing and effectively solving the problem of inconsistent displacement evaluation scales caused by perspective distortion.
[0075] As an optional implementation method in this embodiment, the formula for calculating the normalized inter-frame offset is:
[0076]
[0077] in, Representing the trajectory In the current frame Normalized inter-frame shift, Representing the trajectory In the current frame The actual inter-frame displacement. This indicates that the adaptive inter-frame displacement threshold curve is in the trajectory In the current frame The center ordinate of the detection frame The threshold corresponding to the location is obtained by smoothing the adaptive inter-frame displacement threshold curve in the previous output.
[0078] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment achieves a unified scale conversion of inter-frame displacement under different scenarios through a clear normalization calculation formula. The normalization process uses the corresponding value of the adaptive inter-frame displacement threshold curve as a benchmark to convert the actual inter-frame displacement of vehicles at different vertical coordinates (near and far) into a normalized value without scale differences. For vehicles at close range, the threshold curve value is larger, which can normalize their larger actual displacement to a reasonable range; for vehicles at far range, the threshold curve value is smaller, which can accurately map their smaller actual displacement, avoiding the problems of misjudging normal displacement of vehicles at close range and missing jitter of vehicles at far range in traditional methods. The normalized inter-frame displacement can truly reflect the relative motion state of the vehicles, providing a unified and objective quantitative indicator for subsequent smoothing processing and illegal parking determination, and improving the rationality and accuracy of the determination criteria.
[0079] As an optional implementation of this embodiment, the adaptive weighted average displacement is iteratively updated using the following formula:
[0080]
[0081] in, Representing the trajectory In the current frame The adaptive weighted average displacement Representing the trajectory In the previous frame The adaptive weighted average displacement Representing the trajectory In the current frame Normalized inter-frame shift, This is an adaptive smoothing factor. In specific implementation, the initial frame... hour, 。 The adaptive smoothing factor has a value range of 0-1 and is used to dynamically adjust the weights of historical data and current data.
[0082] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment achieves spatiotemporal accumulation and smoothing of normalized inter-frame displacement through an iterative update formula of exponentially weighted moving average. The iterative update mechanism integrates displacement information from the current frame and historical frames, incorporating instantaneous displacement fluctuations into long-term cumulative features, effectively suppressing short-term errors caused by detection box jitter and video noise. The initial frame value setting ensures smooth initiation of iterative calculations, and the dynamic adjustment characteristics of the adaptive smoothing factor allow weight allocation to adapt to different vehicle motion states. The adaptive weighted average displacement calculated by this formula preserves the continuity of vehicle motion states while filtering out invalid fluctuations, stably representing the true motion trend of the vehicle. This provides a reliable core quantitative indicator for illegal parking determination, improving the stability and credibility of the determination results.
[0083] Based on the aforementioned adaptive weighted average displacement calculation, as a further optional implementation method of this embodiment, the adaptive smoothing factor is dynamically calculated using the following formula:
[0084]
[0085] in, Representing the trajectory Up to the current frame The number of frames that are continuously in a low-motion state. Representing the trajectory Up to the previous frame The number of frames that are continuously in a low-motion state. This is a preset smoothing constant used to ensure the stability of numerical calculations. In specific implementation, the criterion for determining low motion states is... Secondly, the initial frame At that time, if but Otherwise, it is 0. Furthermore, the smoothing constant... Set it to 0.01.
[0086] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment achieves adaptive adjustment of the adaptive smoothing factor through a dynamic calculation formula, allowing the exponentially weighted moving average mechanism to accurately adapt to different vehicle motion states. When the vehicle is in a low-motion or stationary state for a long time, the number of consecutive low-motion frames... Continue to increase When the value approaches 1, the adaptive weighted average displacement update relies more on historical data, effectively suppressing instantaneous errors caused by detection box jitter and maintaining the stability of the judgment result; when the vehicle suddenly starts or accelerates, the normalized inter-frame displacement... Significantly increased, The value decreases rapidly, giving the current frame displacement a greater weight in the weighted average, enabling timely responses to changes in vehicle motion and preventing misjudgments of starting vehicles as illegally parked. The smoothing constant effectively prevents calculation anomalies caused by the denominator approaching zero, ensuring the numerical stability of the formula. The entire dynamic adjustment process of the smoothing factor achieves a balance between stable error suppression and sensitive response to changes, further improving the accuracy and robustness of illegal parking determination.
[0087] As an optional implementation of this embodiment, determining whether a vehicle is illegally parked based on the comparison result includes:
[0088] If trajectory Current frame The calculated adaptive weighted average displacement When the value is less than a preset judgment threshold (which can be set to 0.3 as mentioned above), the judgment trajectory is determined. The corresponding vehicle is determined to be illegally parked; otherwise, it is determined to be in a normal driving state. In specific implementation, to avoid instantaneous fluctuations affecting the judgment result, a three-frame continuous judgment mechanism is adopted, that is, when three consecutive frames... When all values are less than the judgment threshold, the final illegal parking judgment result is output.
[0089] Based on the above, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment clarifies the distinction between illegal parking and normal driving through a single-frame comparison + continuous verification judgment logic. The preset judgment threshold is adapted to the normalized displacement scale, ensuring the rationality of the judgment boundary. This judgment method uses the normalized and smoothed adaptive weighted average displacement as its core basis, fully integrating the spatiotemporal cumulative features of vehicle movement. It can accurately identify illegal parking behavior that has been stationary for a long time, while sensitively distinguishing between normal driving, temporary stops, and other non-illegal parking states. Furthermore, the verification mechanism of three consecutive frames can filter out false low displacement signals caused by temporary braking of the vehicle or instantaneous jitter of the detection frame, avoiding misjudgments caused by fluctuations between single frames. Ultimately, this achieves the accuracy and reliability of illegal parking detection, meeting the application needs of actual traffic management.
[0090] In summary, the vehicle illegal parking determination method based on spatiotemporal cumulative features in this embodiment smooths inter-frame displacement fluctuations through an exponentially weighted moving average mechanism and normalizes the displacement by combining an adaptive inter-frame displacement threshold curve based on the ordinate of the detection box center. This effectively overcomes the adverse effects of detection box jitter, noise interference, and perspective distortion, thereby enabling sensitive response to changes in the actual motion state of the vehicle. At the same time, it maintains the stability of the determination when the vehicle is stationary for a long time or at low speed, improving the accuracy of vehicle illegal parking detection and the robustness of the system.
[0091] In the embodiments provided in this application, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code, or any suitable combination thereof. For hardware implementation, the processor may be implemented in one or more of the following: application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, other electronic units designed to implement the functions described herein, or combinations thereof. For software implementation, some or all of the processes of the embodiments may be performed by a computer program instructing the associated hardware. During implementation, the program may be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media may be any available medium accessible to a computer. Computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible to a computer.
[0092] Finally, it should be noted that the above description is only a preferred embodiment of this application and is not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining illegally parked vehicles based on spatiotemporal cumulative features, characterized in that, Includes the following steps: The input video sequence is processed to obtain the detection box of the vehicle in the current frame and the detection boxes in historical frames, and the vehicle trajectory is generated based on the continuous detection boxes. The actual inter-frame displacement of the vehicle is calculated based on the coordinates of the center points of the detection boxes in adjacent frames of the vehicle trajectory. Based on the correspondence between the center ordinate of the detection box and the actual inter-frame displacement in the historical trajectory data, an adaptive inter-frame displacement threshold curve is established. The adaptive inter-frame displacement threshold curve is used to characterize the statistical average value of the vehicle's inter-frame displacement at different ordinate positions. The actual inter-frame displacement is normalized using the adaptive inter-frame displacement threshold curve to obtain the normalized inter-frame displacement. Based on the exponentially weighted moving average mechanism, an adaptive smoothing factor is used to smooth the normalized inter-frame displacement, and the adaptive weighted average displacement of the vehicle is calculated. The adaptive weighted average displacement is compared with a preset judgment threshold, and the vehicle is determined to be in an illegal parking state based on the comparison result. The process of establishing the adaptive inter-frame displacement threshold curve includes: Using polynomial functions The ordinate of the center of the detection box in the historical trajectory dataset With the corresponding actual inter-frame displacement Perform fitting, where, The vertical axis is The corresponding fitted inter-frame displacement value at that time. The degree of the polynomial is preset. The first polynomial function to be determined is the... Term coefficient, Represents the ordinate of the center of the detection frame of Power of; Based on the principle of least squares, by minimizing the sum of squared errors Solve the above-mentioned first Term coefficient The initial fitted curve is obtained, where The number of historical trajectory points. and They represent the first The vertical coordinate of the detection box center and the actual inter-frame displacement of each historical trajectory data point. express of Power of; Based on the distribution of data points relative to the initial fitted curve, the fitting process is optimized using the weighted least squares method. The formula for the weighted least squares method is as follows: ,in, This indicates the number of data points located above the initial fitted curve. The set of data points that belong to the area above the initial fitted curve. This represents the ordinate of the center of the detection box for the data point located above the initial fitted curve. for of Power of 1 express The corresponding actual inter-frame displacement, This represents the preset weights assigned to the data points above the initial fitted curve. This indicates the number of data points located below the initial fitted curve. The set of data points below the initial fitted curve. The ordinate of the detection box center for the data point located below the initial fitting curve. for of Power of 1 for The corresponding actual inter-frame displacement, This represents the preset weights assigned to the data points below the initial fitted curve; The optimized initial fitting curve is then subjected to a final polynomial fitting, outputting a smooth adaptive inter-frame displacement threshold curve.
2. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 1, characterized in that, The step of obtaining the vehicle's detection bounding box in the current frame and the detection bounding boxes in historical frames, and generating the vehicle trajectory based on the continuous detection bounding boxes, includes: The video frames in the video sequence are input to the vehicle detection module, and the vehicle detection module outputs a multi-scale feature map with vehicle location information. The multi-scale feature map is input into the appearance feature extraction module, which then fuses the multi-scale features and extracts the vehicle's appearance features. The vehicle location information and the appearance features are input into the vehicle tracking module, which performs data association and trajectory prediction to output a continuous vehicle trajectory.
3. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 2, characterized in that, The vehicle detection module is built based on the YOLOv8 network structure, and its decoupling head is equipped with a re-identification feature output branch. The re-identification feature output branch is used to synchronously output feature vectors for vehicle re-identification from the input video frames.
4. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 2, characterized in that, The appearance feature extraction module is equipped with a dual attention fusion mechanism, which is used to simultaneously perform attention weighting processing on the multi-scale feature map in both spatial and channel dimensions, so as to fuse and enhance the feature representation capability.
5. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 2, characterized in that, The vehicle tracking module is equipped with a BotSORT-ReID algorithm framework. The BotSORT-ReID algorithm framework is used to predict the motion state of the detection box through Kalman filtering, and to comprehensively calculate the intersection-union ratio between the predicted box and the detection box and the cosine similarity between the apparent features. The cosine similarity is used as the basis for trajectory association to generate a stable vehicle trajectory.
6. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 1, characterized in that, The formula for calculating the normalized inter-frame offset is: in, Representing the trajectory In the current frame Normalized inter-frame shift, Representing the trajectory In the current frame The actual inter-frame displacement. This indicates that the adaptive inter-frame displacement threshold curve is in the trajectory In the current frame The center ordinate of the detection frame The threshold corresponding to the location.
7. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 1, characterized in that, The adaptive weighted average displacement is iteratively updated using the following formula: in, Representing the trajectory In the current frame The adaptive weighted average displacement Representing the trajectory In the previous frame The adaptive weighted average displacement Representing the trajectory In the current frame Normalized inter-frame shift, is the adaptive smoothing factor.
8. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 7, characterized in that, The adaptive smoothing factor is dynamically calculated using the following formula: in, Representing the trajectory Up to the current frame The number of frames that are continuously in a low-motion state. Representing the trajectory Up to the previous frame The number of frames that are continuously in a low-motion state. This is a preset smoothing constant used to ensure the stability of numerical calculations.
9. The method for determining illegal parking of vehicles based on spatiotemporal cumulative features according to claim 1 or 7, characterized in that, The process of determining whether a vehicle is illegally parked based on the comparison results includes: If trajectory Current frame The calculated adaptive weighted average displacement When the value is less than the preset judgment threshold, the judgment trajectory is determined. The corresponding vehicle is in an illegally parked state; otherwise, the vehicle is determined to be in a normal driving state.
Citation Information
Patent Citations
Video-based illegal parking detection method
CN112183350A
Vehicle illegal parking detection method and system based on dynamic edge calculation
CN119516489A