Two-way road parking behavior multi-stage detection method based on unmanned aerial vehicle video

By constructing a directed pixel velocity sequence and a multi-stage fusion judgment method, the problem of distinguishing between slow-moving vehicles and illegally parked vehicles in drone aerial photography scenarios was solved, achieving accurate illegal parking detection and traceable evidence generation in complex environments.

CN123181815APending Publication Date: 2026-11-27SHANDONG JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611467385.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In drone aerial photography scenarios, existing technologies struggle to accurately distinguish between slow-moving vehicles and illegally parked vehicles in complex environments, leading to inaccurate illegal parking judgments. Furthermore, when relying on external reference targets, they are easily affected by obstructions, resulting in missed detections.

Method used

By extracting vehicle trajectories from drone video streams, a directed pixel velocity sequence is constructed. Multi-stage fusion judgment is performed by combining velocity stability and detection box aspect ratio, including sliding window averaging, velocity curve stability judgment, and subsequent cumulative occurrence confirmation, to generate traceable illegal parking event records.

Benefits of technology

It improves the accuracy and stability of identifying illegally parked vehicles in complex aerial photography scenarios, reduces the false alarm rate, adapts to two-way lanes and complex traffic conditions, and forms a traceable chain of evidence for illegal parking, facilitating law enforcement review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181815A_ABST
    Figure CN123181815A_ABST
Patent Text Reader

Abstract

The application discloses a two-way road parking behavior multi-stage detection method based on unmanned aerial vehicle video. The method is as follows: acquiring a road scene video stream and detecting a target vehicle; demarcating an effective detection area and screening an effective vehicle; obtaining a vehicle tracking set by cross-frame trajectory correlation of the effective vehicle; constructing a directed pixel speed sequence according to displacement and time difference of adjacent two effective observations, and obtaining a smooth speed sequence by sliding window averaging; determining a suspected illegal parking candidate speed interval according to the smooth speed sequence distribution; performing multi-stage fusion determination on a vehicle trajectory falling into the interval, including speed curve stability discrimination, subsequent cumulative occurrence number confirmation and target posture aspect ratio verification; adding the vehicle meeting the determination condition to a final illegal parking set, generating an illegal parking record and reporting. The application can stably distinguish real illegal parking from low-speed passing vehicles under the conditions of unmanned aerial vehicle perspective change, two-way lane motion complexity, vehicle slow running and detection box jitter, and reduces false positives and missed detections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of road target detection and recognition technology, and specifically relates to a multi-stage detection method for parking behavior on two-way roads based on UAV video. Background Technology

[0002] Illegal parking on roads obstructs traffic lanes, emergency lanes, ramps, road entrances and exits, or temporary control areas, easily leading to decreased traffic efficiency, increased risk of rear-end collisions and minor accidents, and obstruction of emergency rescue channels. Traditional methods of detecting illegal parking mainly rely on manual patrols, fixed camera captures, or background video verification, which have problems such as limited inspection range, obvious blind spots of fixed camera positions, high cost of manual verification, and insufficient evidence collection efficiency. With the development of drone inspection technology, using drones equipped with camera equipment to conduct dynamic inspections of road areas can improve the mobility and coverage of road supervision.

[0003] However, drone aerial video has characteristics such as changing perspective, image shaking, target scale changes, and the vehicle's driving direction not being completely consistent with the image direction, making it difficult to reliably distinguish between slow-moving vehicles, temporarily queuing vehicles, and truly illegally parked vehicles by single-frame detection or simple position judgment. Existing drone-based parking recognition and detection schemes usually focus on system architecture, patrol evidence collection, license plate recognition, parking space determination, or management backend linkage, which can improve the efficiency of traditional manual patrols. However, some schemes focus more on the composition of the drone system, road network information input, license plate recognition, or evidence collection planning, without fully explaining how to use the trajectory of the same vehicle, directional pixel velocity sequence, continuous occurrence frequency, and detection box shape in a continuous video stream to perform progressive illegal parking confirmation. Specifically, existing technologies mainly have the following two types of problems: (1) Using the absolute driving speed of the target vehicle as the basis for illegal parking judgment, the vehicle speed is estimated by calculating the video frame displacement and drone motion compensation, and then the vehicle is judged to be in a parked state based on whether the vehicle speed is lower than the threshold or close to zero. However, in drone aerial photography scenarios, due to factors such as drone flight speed, shooting angle, and target size changes, using only video to measure vehicle speed is prone to problems such as unstable speed estimation, large speed measurement error, and difficulty in distinguishing between slow-moving vehicles and real illegally parked vehicles, thus leading to inaccurate judgment of illegal parking. (2) Judging by the relative position change between the vehicle and stationary target is to extract multi-element targets in the image and analyze the relative positional relationship between them and road structures or fixed reference objects to identify parking behavior. This type of method usually relies on external reference targets such as structures, lane lines, and parking signs. The model needs to identify many types of targets, and the label system is huge. Affected by training samples, computing resources, and complex road environments, the recognition accuracy is easily reduced. In addition, when there are no effective structure targets or fixed reference targets are occluded in the road area within the drone's view, parking detection is prone to failure, leading to missed detection of illegal parking events.

[0004] Therefore, based on existing drone parking detection and tracking technologies, it is necessary to further address the difficulty in distinguishing between real parked vehicles, slow-moving vehicles, and normally driving vehicles in complex aerial photography scenarios, and improve the stability and accuracy of vehicle parking status recognition. Summary of the Invention

[0005] To address the aforementioned technical challenges, this invention proposes a multi-stage detection method for parking behavior on two-way roads based on UAV video. By extracting valid vehicles from the UAV video stream, constructing a directed pixel velocity sequence, and combining velocity stability, cumulative occurrence count, and detection box aspect ratio in a multi-stage fusion judgment, stable and accurate identification of illegally parked vehicles is achieved in complex aerial photography scenarios on two-way roads.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, this invention proposes a multi-stage detection method for bidirectional road parking behavior based on UAV video, comprising the following steps: The system acquires a video stream of a road scene, detects target vehicles from the video frame images of the video stream, delineates an effective detection area from the video frame images, and filters target vehicles based on the effective detection area, retaining valid vehicles that enter the effective detection area. Cross-frame trajectory association is performed on the effective vehicles to obtain a vehicle tracking set with trajectory numbers; for each vehicle trajectory in the vehicle tracking set, the pixel velocity in the image plane is calculated based on the displacement and time difference of the center point of the target detection box of the effective vehicle between two adjacent effective observations, and the velocity sign is determined according to the vertical motion direction of the image to construct a directed pixel velocity sequence; the directed pixel velocity sequence is subjected to sliding window averaging to obtain a smooth velocity sequence. Based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene, a candidate speed range for suspected illegal parking is determined; vehicle trajectories whose smooth speed falls within the candidate speed range for suspected illegal parking are added to the candidate set for suspected illegal parking, and the vehicle trajectories in the candidate set for suspected illegal parking are subjected to multi-stage fusion judgment, and vehicles that meet the judgment conditions are added to the final illegal parking set; when a vehicle trajectory enters the final illegal parking set for the first time, an illegal parking event record is generated.

[0007] Furthermore, the effective detection region is delineated from the video frame image, specifically as follows: Based on the UAV's flight altitude, camera pitch angle, and attitude stability, an effective detection region is defined in the video frame image; the effective detection region is the area in the image from the vertical starting position to the bottom of the image; wherein, the vertical starting position is adaptively determined based on the camera pitch angle and the UAV's flight altitude; Furthermore, by establishing a fusion relationship between pitch angle and flight altitude factors in advance, the longitudinal starting position is automatically calibrated when the preset stability conditions are met, so that the effective detection area can be adjusted with changes in camera pitch angle and UAV flight altitude.

[0008] Furthermore, the longitudinal starting position is adaptively determined based on the camera pitch angle and the UAV flight altitude, specifically as follows: When the camera pitch angle transitions from horizontal to vertical shooting, the proportion of the longitudinal starting position in the image height direction increases. As the drone's flight altitude increases, the proportion of the longitudinal starting position in the image height direction decreases.

[0009] Furthermore, cross-frame trajectory association is performed on the effective vehicles to obtain a vehicle tracking set with trajectory numbers, specifically as follows: The effective vehicles within the effective detection area are input into the multi-target tracking model, and the effective vehicles across frames are associated to obtain a vehicle tracking set with trajectory numbers: ; in, For vehicle tracking sets; For the first The first frame One vehicle tracking target; For the first The x-coordinate of the first corner point of each valid vehicle detection frame; For the first The ordinate of the first corner point of each valid vehicle detection frame; For the first The x-coordinate of the second corner point of each valid vehicle detection frame; For the first The ordinate of the second corner point of each valid vehicle detection frame; For the first The trajectory number of each valid vehicle.

[0010] Furthermore, the process of constructing the directed pixel velocity sequence is as follows: For each vehicle trajectory in the vehicle tracking set, take the center point of the valid vehicle target detection box in the current frame and the center point of the valid vehicle target detection box in the previous frame, and calculate the lateral and longitudinal displacements: ; in, For the first The first frame The x-coordinate of the center point of each valid vehicle target detection box; For the first The first frame The ordinate of the center point of each valid vehicle target detection box; The first in the previous valid frame The x-coordinate of the center point of each valid vehicle target detection box; The first in the previous valid frame The ordinate of the center point of each valid vehicle target detection box; This is a lateral displacement; This is the longitudinal displacement; Let the time difference between two valid observations be . Then the pixel velocity of the effective vehicle in the image plane is: ; when When a valid vehicle is moving downwards in the frame, it is recorded as [time]. ;when When a valid vehicle is moving upwards in the frame, it is recorded as [time]. ;when When the time is right, it indicates that the valid vehicle has no longitudinal displacement in the image, and is recorded as follows: ; Therefore, the directed pixel velocity sequence for each vehicle trajectory is constructed as follows: ; in, For the first A directed pixel velocity sequence for each valid vehicle; For the first valid vehicles in Directed pixel velocity during the first effective observation.

[0011] Furthermore, the directed pixel velocity sequence is subjected to sliding window averaging to obtain a smooth velocity sequence; With a sliding window length of At that time, the average directed pixel velocity within the window is calculated as a smooth velocity point: ; in, For the first valid vehicles in Smooth velocity point during the first effective observation; For the first valid vehicles in Directed pixel velocity at the first effective observation; For the first The sliding window length for the first effective observation is The set of all directed pixel velocity values ​​within the sliding speed window; Smooth velocity sequence Represented as: ; in, This represents the number of smooth speed points generated by the vehicle during the observation period.

[0012] Furthermore, based on the smoothed speed sequence distribution of all vehicle trajectories in the current video scene, the candidate speed ranges for suspected illegal parking are determined, specifically as follows: Based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene, vehicle trajectories belonging to normal driving in the same direction and normal driving in the opposite direction are removed, and vehicle trajectories located in the low-speed negative concentrated distribution area are retained to form a reference sample set. For each vehicle trajectory in the reference sample set, calculate its representative speed during the observation period. The representative speed is the average of all smoothed speed points of the vehicle trajectory during the observation period. Robust statistical fusion is performed on the representative speeds of all vehicles in the reference sample set to obtain the directed pixel reference values ​​of illegally parked vehicles in the current video scene, wherein the robust statistical fusion adopts the truncated mean, median or weighted mean. The speed range between the directional pixel reference value of the illegally parked vehicle and the zero speed line is determined as the candidate speed range for suspected illegal parking in the current video scene.

[0013] Furthermore, the multi-stage fusion judgment includes a primary discrimination based on velocity curve stability, a secondary discrimination based on continuous features, and a tertiary verification based on target attitude, specifically: First-order discrimination: For the trajectory of a vehicle that has been added to the suspected illegal parking candidate set, determine whether the vehicle meets the speed stability condition for parking behavior based on the fluctuation amplitude and / or second-order change of its smooth speed sequence; if it does, retain it in the suspected illegal parking candidate set. Secondary discrimination: For vehicles that have been added to the suspected illegal parking candidate set but have not yet completed multi-frame confirmation, a counting interval threshold and a cumulative occurrence threshold are set; after a vehicle triggers a suspected illegal parking candidate, its occurrence in subsequent frames is observed. When the frame interval between two adjacent confirmations reaches the counting interval threshold, the confirmation count of the vehicle is incremented by one; when the cumulative occurrence reaches the cumulative occurrence threshold, the vehicle is added to the initial speed-based illegal parking set. Three-stage verification: For vehicles already added to the initial speed-based illegal parking set, calculate the aspect ratio of their detection boxes. When the height of the detection box is greater than the product of the aspect ratio judgment threshold and the width of the detection box, the current frame is determined to meet the vehicle shape constraints. Establish a shape confirmation window for each vehicle initially judged to be illegally parked. When multiple consecutive frames meet the above shape constraints, add the vehicle to the final illegal parking set.

[0014] Furthermore, the aforementioned illegal parking incident records Represented as: ; in, For the first Vehicle trajectory numbers of all valid vehicles; For trigger frame; For trigger time, To trigger average velocity, For the final confirmation frame or confirmation time, This is the cumulative number of occurrences. To confirm the aspect ratio of the detection frame, To continuously satisfy the aspect ratio condition for the number of frames, This is the screenshot path or remote image address for the illegal parking violation. This provides the latitude and longitude information of the equipment.

[0015] Secondly, the present invention also proposes a multi-stage detection device for two-way road parking behavior based on UAV video, including at least one processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the at least one processor, implements the multi-stage detection method for two-way road parking behavior based on UAV video.

[0016] The effects described in the invention are merely those of the embodiments, and not all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects: (1) Multi-stage progressive judgment reduces false alarm rate This invention employs a multi-stage progressive judgment process, including vehicle detection, effective region filtering, cross-frame trajectory association, initial directional pixel velocity judgment, velocity curve stability assessment, subsequent cumulative occurrence confirmation, and continuous verification of the detection box's aspect ratio. This avoids the limitations of relying solely on single-frame recognition or a single speed threshold for illegal parking judgment. Each stage further filters the candidate results from the previous stage; only vehicles that sequentially meet all judgment conditions are added to the final illegal parking set. This significantly reduces false alarms caused by short pauses, detection box jitter, trajectory drift, or low-speed targets in a single frame.

[0017] (2) Improve the adaptability of aerial photography scenarios based on directed pixel velocity sequences. This invention does not rely on the absolute speed of the vehicle, nor on external reference targets such as road structures, lane lines, or stop signs. Instead, it starts from the vehicle's own motion behavior in the image and constructs a pixel velocity sequence containing directional features. A smooth velocity sequence is obtained through sliding window averaging, and the candidate velocity range for suspected illegal parking is adaptively determined based on the smooth velocity sequence distribution of all vehicle trajectories in the current video scene. This allows the judgment criteria to be automatically adjusted according to changes in the drone's flight speed, shooting angle, and road direction, maintaining stable detection performance even under complex aerial photography conditions such as changes in drone perspective, image shake, and changes in target scale.

[0018] (3) Adapt to two-way lanes and complex traffic conditions to reduce missed detections and misjudgments. This invention addresses two-way road scenarios, moving beyond solely relying on the sign of directional pixel speeds for illegal parking judgments. Instead, it comprehensively considers the candidate speed range for suspected illegal parking, speed curve stability, and subsequent cumulative confirmation results. This effectively distinguishes between vehicles traveling in the same direction, vehicles traveling in the opposite direction, slow-moving vehicles, and genuinely illegally parked vehicles. Furthermore, by introducing speed threshold ranges corresponding to different traffic conditions, it applies different judgment criteria to slow-moving vehicles in free-flowing and congested states, improving adaptability to complex traffic environments and reducing misjudgments caused by traffic congestion and slow-moving vehicles.

[0019] (4) Suppress short-term stops and detect jitter to improve judgment stability This invention employs a cumulative occurrence confirmation mechanism, requiring vehicles to be continuously observed and accumulate a set number of occurrences after triggering a suspected illegal parking candidate, rather than requiring the target to appear consecutively. This effectively suppresses false alarms caused by short-term stops, image jitter, or occasional low speeds. Furthermore, a continuous frame confirmation mechanism based on the aspect ratio of the detection box performs a secondary verification of the initial speed judgment, eliminating interference from tracking drift, occlusion, and abnormal detection box shapes, thus enhancing the reliability of the finally confirmed illegally parked vehicles.

[0020] (5) Form a traceable chain of evidence for illegal parking incidents to facilitate law enforcement review and platform reporting. This invention automatically generates a parking violation event record when a vehicle first enters the final illegal parking set. The record includes fields such as vehicle trajectory number, trigger frame, trigger time, average trigger speed, final confirmation frame or confirmation time, cumulative occurrences, aspect ratio of the detection frame at confirmation, number of frames continuously meeting the aspect ratio condition, illegal parking screenshot path or remote image address, and device latitude and longitude information. The illegal parking screenshot is then saved, written to a database, or uploaded to a remote server. This forms a traceable and verifiable chain of evidence for illegal parking events, facilitating subsequent law enforcement review and platform reporting, and solving the problem of insufficient efficiency in traditional manual patrols and fixed camera capture evidence collection.

[0021] (6) Supports automatic operation and abnormal recovery of video streams from multiple devices. This invention can access real-time video streams in RTSP, RTMP, or HTTP formats, supports automatic operation and abnormal recovery of video streams from multiple devices, and is suitable for deployment in existing video streams or temporary inspection scenarios. It does not rely on pre-recorded road network locations or road parking attribute information, making it flexible in deployment and highly applicable. Attached Figure Description

[0022] Figure 1 This is a flowchart of the multi-stage detection method for bidirectional road parking behavior based on UAV video proposed in Embodiment 1 of the present invention; Figure 2 This is a framework diagram of the implementation of the multi-stage detection method for bidirectional road parking behavior based on UAV video proposed in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of a multi-stage detection device for bidirectional road parking behavior based on UAV video, as proposed in Embodiment 3 of the present invention. Detailed Implementation

[0023] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.

[0024] Example 1 Embodiment 1 of this invention proposes a multi-stage detection method for parking behavior on two-way roads based on UAV video. The technical problem it solves is: how to stably and accurately distinguish between illegally parked vehicles and slow-moving vehicles from a continuous video stream under conditions such as changes in the UAV's aerial viewpoint, complex vehicle movement in two-way lanes, road congestion, slow-moving vehicles, target occlusion, and detection frame jitter, thereby improving the accuracy and reliability of parking behavior detection.

[0025] Figure 1 This is a flowchart of the multi-stage detection method for bidirectional road parking behavior based on UAV video proposed in Embodiment 1 of the present invention; In step S1, a video stream of the road scene is acquired; In step S2, the target vehicle is detected from the video frame images of the video stream; the effective detection area is delineated from the video frame images; In step S3, target vehicles are screened based on the effective detection area, and valid vehicles that have entered the effective detection area are retained; In step S4, cross-frame trajectory association is performed on the effective vehicles to obtain a vehicle tracking set with trajectory numbers; for each vehicle trajectory in the vehicle tracking set, the pixel velocity in the image plane is calculated based on the displacement and time difference of the center point of the target detection box of the effective vehicle between two adjacent effective observations, and the velocity sign is determined according to the vertical motion direction of the image to construct a directed pixel velocity sequence; the directed pixel velocity sequence is subjected to sliding window averaging to obtain a smooth velocity sequence. In step S5, the candidate speed range for suspected illegal parking is determined based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene; In step S6, the trajectories of vehicles whose smooth speed falls within the suspected illegal parking candidate speed range are added to the suspected illegal parking candidate set; In step S7, a multi-stage fusion determination is performed on the vehicle trajectories in the suspected illegal parking candidate set; In step S8, vehicles that meet the judgment conditions are added to the final illegal parking set; when the vehicle trajectory enters the final illegal parking set for the first time, an illegal parking event record is generated.

[0026] Figure 2 The following is a framework diagram of the multi-stage detection method for bidirectional road parking behavior based on UAV video proposed in Embodiment 1 of the present invention; including: 1. UAV video acquisition; 2. ROI region construction and screening; 3. Vehicle target extraction and DeepSort tracking; 4. Directed pixel velocity and smooth sequence construction; 5. Construction of suspected illegal parking candidate intervals; 6. Velocity curve stability judgment, subsequent cumulative occurrence confirmation and target attitude aspect ratio verification; 7. Multi-stage fusion judgment; 8. Illegal parking event generation and reporting.

[0027] The following is combined Figure 1 and Figure 2 The present invention provides a detailed description of the multi-stage detection method for bidirectional road parking behavior based on UAV video proposed in Embodiment 1 of the present invention.

[0028] Drone video capture The drone cruises along a two-way road, carrying cameras to capture aerial images of the road area, recording continuous video frames of the ground scene including roads, vehicles, and lane markings. The video stream can be in RTSP, RTMP, or HTTP format. The captured video stream serves as the data source for subsequent vehicle detection, trajectory tracking, and illegal parking determination.

[0029] 2. ROI Region Construction and Screening The effective detection region is delineated from the video frame image. Specifically, the effective detection region is delineated in the video frame image based on the UAV's flight altitude, camera pitch angle, and attitude stability. The effective detection region is the area in the image from the vertical starting position to the bottom of the image. The vertical starting position is adaptively determined based on the camera pitch angle and the UAV's flight altitude. Furthermore, through a pre-established fusion relationship between pitch angle and flight altitude factors, the vertical starting position is automatically calibrated when preset stability conditions are met, so that the effective detection region can be adjusted with changes in camera pitch angle and UAV flight altitude.

[0030] Specifically, to avoid misjudgments caused by targets in the far end of the image, the sky area, off-road areas, or uncontrolled areas entering the parking area, this invention delineates the effective detection region (ROI) of the video images captured by the drone based on the drone's flight altitude, camera pitch angle, and attitude stability. Let the height of the video frame be... The effective detection area starts at the longitudinal position of Then ROI is defined as any region in the image that satisfies The area. According to the camera's tilt angle and drone flight altitude Adaptive determination: ; in, This is the initial scaling function for the Region of Interest (ROI), used to describe the initial position of the effective detection region in the image height direction. It utilizes the drone's flight altitude and attitude to... Perform automatic calibration.

[0031] The calibration method is as follows: when the camera pitch angle transitions from horizontal to vertical shooting, the proportion of the longitudinal starting position in the image height direction increases; when the drone's flight altitude increases, the proportion of the longitudinal starting position in the image height direction decreases.

[0032] The value varies with the pitch angle The size increases as the camera transitions from horizontal to vertical shooting, and also with flight altitude. The value decreases as the pitch angle increases. Based on the above relationship, a two-dimensional linear calibration model can be constructed using the pitch angle and flight altitude to determine the initial ROI ratio corresponding to the video frame: ; in, The flight altitude h and camera pitch angle are used to determine the altitude and camera pitch angle. The jointly determined initial ROI ratio; and These are the minimum and maximum initial proportions of the ROI determined by the pitch angle factor, respectively; and These represent the minimum and maximum initial ROI proportions determined by the flight altitude factor, respectively. and These are the minimum and maximum values ​​for the camera's pitch angle calibration, respectively; and These are the calibrated minimum and maximum values ​​for the drone's flight altitude, respectively. This is the weighting coefficient for the fusion of pitch angle and flight altitude factors. This model allows the initial ROI scale to be adjusted as the camera pitch angle and UAV flight altitude change.

[0033] For vehicle boundary box Take the ordinate of its upper edge. As a regional determination point, a target is considered a valid vehicle target when the following formula is satisfied: ; If the vehicle's bounding box does not enter the valid area, it will not participate in subsequent tracking and illegal parking determination. Using the upper edge of the bounding box as the determination point ensures that the vehicle target fully enters the monitoring area before being included in the analysis, avoiding premature triggering by edge targets and thus reducing false alarms caused by edge targets and distant targets.

[0034] 3. Vehicle target extraction and DeepSort tracking The drone cruises along the road, collecting real-time video streams in RTSP, RTMP, or HTTP formats. Vehicle target feature sets are extracted. ; in, For the first The set of bounding boxes for the vehicle target in the frame. , For the first The first frame The x-coordinate of the center point of the bounding box of each vehicle target; For the first The first frame The ordinate of the center point of the bounding box of each vehicle target; For the first The first frame The width of the bounding box of each vehicle target; For the first The first frame The height of the bounding box of each vehicle target; Let be the set of confidence scores corresponding to the vehicle target; where . For the first The first frame Detection confidence level of individual vehicle targets; This is a set of vehicle target category numbers. In this invention, the category number... For vehicle targets, only those with category number 0 and confidence level not less than the threshold are retained. The goal, These are configurable parameters.

[0035] The vehicle targets within the ROI are input into the DeepSort multi-object tracking model, and cross-frame vehicle targets are associated to obtain a set of vehicle tracks with trajectory numbers: ; in, For vehicle tracking sets; For the first The first frame One vehicle tracking target; For the first The x-coordinate of the first corner point of each valid vehicle detection frame; For the first The ordinate of the first corner point of a valid vehicle detection frame; For the first The x-coordinate of the second corner point of each valid vehicle detection frame; For the first The ordinate of the second corner point of each valid vehicle detection frame; For the first The trajectory number of each valid vehicle.

[0036] If the vehicle bounding box output by the tracking model drifts outside the ROI region again, then the vehicle bounding box will not be included in the decision in the current frame.

[0037] 4. Directed pixel velocity and smooth sequence construction For each vehicle trajectory in the vehicle tracking set Take the center point of the valid vehicle target detection box in the current frame. And the center point of the valid vehicle target detection box in the previous valid frame Calculate the lateral and longitudinal displacements: ; in, For the first The first frame The x-coordinate of the center point of each valid vehicle target detection box; For the first The first frame The ordinate of the center point of each valid vehicle target detection box; The first in the previous valid frame The x-coordinate of the center point of each valid vehicle target detection box; The first in the previous valid frame The ordinate of the center point of each valid vehicle target detection box; This is a lateral displacement; This represents longitudinal displacement; Let the time difference between two valid observations be . Then the pixel velocity of the effective vehicle in the image plane is: ; Determine the velocity sign based on the longitudinal direction of motion in the image: when When a valid vehicle is moving downwards in the frame, it is recorded as [time]. ; when When a valid vehicle is moving upwards in the frame, it is recorded as [time]. ; when When the time is right, it indicates that the valid vehicle has no longitudinal displacement in the image, and is recorded as follows: ; Therefore, the directed pixel velocity sequence for each vehicle trajectory is constructed as follows: ; in, For the first A directed pixel velocity sequence of 10 effective vehicles; For the first valid vehicles in Directed pixel velocity during the first effective observation.

[0038] To avoid misjudgment caused by single-frame speed jitter, this invention analyzes vehicle trajectory. The recent Construct a sliding speed window using effective speed values. ,in Configuration parameters. When the window length reaches... Calculate the average pixel velocity: ; in, For the first valid vehicles in Smooth velocity point during the first effective observation; For the first valid vehicles in Directed pixel velocity at the first effective observation; For the first The sliding window length for the first effective observation is The set of all directed pixel velocity values ​​within the sliding speed window; As vehicle trajectories are continuously monitored, the system repeats the above process at multiple points in time. Window averaging is used to obtain a series of smooth velocity sequence points, which constitute the first... Smooth speed sequence of vehicles Represented as: ; in, This represents the number of smooth speed points generated by the vehicle during the observation period.

[0039] Subsequent speed threshold judgment, curve fluctuation analysis, second-order change analysis, and direction consistency analysis are all based on Instead of directly based on the raw velocity value of a single frame, it is performed.

[0040] 5. Construction of candidate zones for suspected illegal parking The candidate speed range for suspected illegal parking is determined by the oriented pixel reference value of the illegally parked vehicle in the current scene. Construction. Specifically, obtaining smooth speed sequences for each vehicle. Then, based on the distribution of all vehicle speed sequences, vehicle trajectories that clearly belong to normal travel in the same direction or normal travel in the opposite direction are removed, and vehicle trajectories located in the low-speed negative concentrated distribution area are retained to form a reference sample set. .

[0041] The This is used to estimate the directed pixel velocity reference level mapped onto the image under the conditions of current drone speed, shooting angle, and road direction, and is not directly used as the final result of illegal parking determination. For the set For any vehicle trajectory, further calculate its representative speed within the observation period. : ; in, For the first The representative speed of the vehicle during the observation period; For the first The vehicle obtained at the l-th observation time Window average directional pixel velocity, This represents the number of smooth speed points generated by the vehicle during the observation period. It is used to characterize the overall directional pixel velocity level of the vehicle over the observation period, rather than the instantaneous velocity of a single frame.

[0042] right After robust statistical fusion of representative speeds of vehicles in the current scene, directed pixel reference values ​​of illegally parked vehicles are obtained. .

[0043] ; in, The truncated mean, median, or weighted mean can be used to reduce the impact of individual abnormal vehicle speeds on the results.

[0044] get Afterwards, The speed range between the zero speed line and the zero speed line is determined as the candidate speed range for suspected illegal parking in the current video scene. .

[0045] ; This invention is applicable to two-way lane scenarios. For vehicles traveling in the same direction and vehicles traveling in opposite directions, the system does not judge illegal parking solely based on the sign of the directional pixel speed, but rather combines the candidate speed range of suspected illegal parking, the stability of the speed curve, and subsequent cumulative confirmation results for a comprehensive judgment.

[0046] like Then the vehicle trajectory Add to suspected illegal parking candidate set It also records the trigger frame, trigger time, average trigger speed, traffic status, and speed threshold range.

[0047] 6. Determine the stability of the velocity curve, confirm the cumulative occurrence count, and verify the target attitude aspect ratio. The multi-stage fusion judgment includes a primary discrimination based on velocity curve stability, a secondary discrimination based on continuous features, and a tertiary verification based on target attitude, specifically: First-order discrimination: For the trajectory of a vehicle that has been added to the suspected illegal parking candidate set, determine whether the vehicle meets the speed stability condition for parking behavior based on the fluctuation amplitude and / or second-order change of its smooth speed sequence; if it does, retain it in the suspected illegal parking candidate set. The primary discrimination method is based on the stability of the speed curve: this method is used to identify parking behaviors that have entered the candidate speed range for suspected illegal parking. Curve stability analysis was performed on the vehicles to further distinguish between genuine illegally parked vehicles and slow-moving vehicles that fell into the suspected illegally parked area.

[0048] Assume the vehicle's actual speed is The equivalent speed of the drone along the road direction is The directional pixel velocity sign of the vehicle in the image is related to the relative velocity between the two. Related can be represented as: ; when When the vehicle is moving backward relative to the drone, its directional pixel velocity can be expressed as a negative value; when At that time, the vehicle was traveling at a speed lower than the normal high speed. However, relative to the forward movement of the drone, its directional pixel velocity can exhibit a relatively small positive value. Therefore, the positive or negative value of the directional pixel velocity cannot be used alone as a basis for judging illegal parking.

[0049] Determine the potential speed range of illegal parking in the current video scene. Next, the stability of the speed curve for vehicles falling within this speed range is further assessed. This step is primarily used to avoid misjudging slow-moving vehicles as illegally parked based solely on the speed range. (Definition of the first...) The speed fluctuation range of the vehicle is: ; in, For the first The amplitude of fluctuations in a smoothed speed sequence of a vehicle is used to describe the speed curve around its representative speed. The degree of dispersion. The smaller the value, the more stable the vehicle's speed curve. This feature can be used to characterize the significant difference in driving behavior between illegally parked vehicles and slow-moving vehicles: illegally parked vehicles have a more stable speed curve overall. Smaller; although slow-moving vehicles are traveling at low speeds, they may accelerate, decelerate, or change their following distance, so The value is often larger.

[0050] To further describe the degree of change in the velocity curve, the first... The second-order change of the vehicle is: ; in, For the first The second-order variation of the smooth speed sequence of a vehicle is used to describe the curvature, undulation, and degree of acceleration / deceleration of the speed curve. For the first The number of smoothed velocity points formed by a valid vehicle within the observation period; The variable to be summed represents the index of the smoothed velocity point; For the first The number of valid vehicles in the first Smooth velocity point during the first effective observation; For the first The number of valid vehicles in the first Smooth velocity point during the first effective observation; For the first The number of valid vehicles in the first The smoothed speed point during the second effective observation. The speed curves of illegally parked vehicles are usually generally flat, thus exhibiting smaller second-order variations; slow-moving vehicles, due to their continued movement, are more prone to speed curves showing acceleration, deceleration, fluctuations, or trend shifts. The value will be relatively large.

[0051] Secondary discrimination: For vehicles that have been added to the suspected illegal parking candidate set but have not yet completed multi-frame confirmation, a counting interval threshold and a cumulative occurrence threshold are set; after a vehicle triggers a suspected illegal parking candidate, its occurrence in subsequent frames is observed. When the frame interval between two adjacent confirmations reaches the counting interval threshold, the confirmation count of the vehicle is incremented by one; when the cumulative occurrence reaches the cumulative occurrence threshold, the vehicle is added to the initial speed-based illegal parking set. Specifically, for those already added to the suspected illegal parking candidate set For vehicles that have not yet completed multi-frame confirmation, this invention continues to observe their appearance in subsequent frames. Let the frame number when the vehicle triggers the candidate be... The most recent counting frame is The current frame is The counting interval threshold is , This is a configurable parameter. Then, when the following conditions are met... and The vehicle's confirmed count Add 1 and update .when Reaching the cumulative occurrence threshold At that time, the vehicle trajectory Add speed initial judgment illegal parking collection , These are configurable parameters. This method does not require the target to appear continuously, but rather requires it to be continuously observed after triggering a candidate and accumulate to a set number of times, thereby suppressing false alarms caused by short-term stops, jitter detection, and occasional low speeds.

[0052] Three-stage verification: For vehicles already added to the initial speed-based illegal parking set, calculate the aspect ratio of their detection boxes. When the height of the detection box is greater than the product of the aspect ratio judgment threshold and the width of the detection box, the current frame is determined to meet the vehicle shape constraints. Establish a shape confirmation window for each vehicle initially judged to be illegally parked. When multiple consecutive frames meet the above shape constraints, add the vehicle to the final illegal parking set.

[0053] To effectively address interference from vehicles on other roads intersecting the target road, this invention employs a three-stage verification of parking behavior based on the target's posture. This is applied to a set of vehicles already included in the initial speed-based illegal parking assessment. For vehicles, the system further calculates the aspect ratio of the vehicle detection frame: ; When the detection frame height The current frame is deemed to satisfy the vehicle shape constraint if the following formula is met: ; in, The aspect ratio is used as the threshold for judgment. This invention establishes a length of [missing information] for each speed initial vehicle determination. Shape confirmation window When continuous If all frames satisfy the above morphological constraints, the vehicle is added to the final set of illegally parked vehicles. By characterizing the target vehicle's driving posture through the state of the detection box, abnormal and interfering targets can be effectively eliminated, reducing false alarms.

[0054] 7. Multi-stage fusion judgment The results of the speed curve stability judgment, subsequent cumulative occurrence count confirmation, and target attitude aspect ratio verification are combined: only vehicles that sequentially meet the speed curve stability condition, cumulative occurrence count condition, and continuous detection frame aspect ratio verification condition are added to the final illegal parking set. .

[0055] This multi-stage progressive judgment process avoids directly judging short pauses, detection box jitter, trajectory drift, or low-speed targets in a single frame as illegal stops, thus improving the stability and verifiability of the detection results.

[0056] 8. Generation and reporting of illegal parking incidents When vehicle trajectory First entry into the final illegal parking collection At that time, a record of illegal parking events is generated. , represented as: ; in, For the first Vehicle trajectory numbers of all valid vehicles; For trigger frame; For trigger time, To trigger average speed, For the final confirmation frame or confirmation time, This is the cumulative number of occurrences. To confirm the aspect ratio of the detection frame, To ensure the number of frames that continuously meet the aspect ratio requirement, This is the screenshot path or remote image address for the illegal parking violation. This provides the latitude and longitude information of the equipment.

[0057] Save a screenshot of the first confirmed illegal parking and write the device number, illegal parking time, vehicle number, illegal parking status, longitude, latitude, and image path to the database. If the remote upload function is enabled, upload the screenshot to a remote server and update the database record with the remote access address.

[0058] In summary, the multi-stage detection method for parking behavior on two-way roads based on UAV video proposed in Embodiment 1 of this invention achieves progressive detection of parking behavior on two-way roads through UAV video acquisition, ROI region construction and screening, vehicle target extraction and DeepSort tracking, directional pixel velocity and smooth sequence construction, suspected illegal parking candidate interval construction, velocity curve stability discrimination, subsequent cumulative occurrence confirmation, target attitude aspect ratio verification, and multi-stage fusion judgment. Compared with traditional methods that rely solely on vehicle absolute speed or fixed structure references, this embodiment can effectively distinguish between real illegally parked vehicles, slow-moving vehicles, and vehicles with short-term stops under conditions such as changes in UAV perspective, complex vehicle movement in two-way lanes, road congestion, slow-moving vehicles, target occlusion, and detection box jitter. This improves the stability and accuracy of parking behavior detection and generates a record of illegal parking events containing vehicle trajectory, confirmation time, device information, and screenshot evidence, facilitating subsequent law enforcement review and platform reporting.

[0059] Example 2 To verify the effectiveness of the multi-stage detection method for parking behavior on two-way roads based on UAV video proposed in Embodiment 1 of this invention, Embodiment 2 of this invention selects UAV aerial video of highways to conduct an experiment on detecting illegally parked vehicles, and provides a detailed description of the experimental parameter settings, experimental process, experimental results and result analysis.

[0060] I. Experimental Data and Environment In Embodiment 2 of this invention, aerial video of a highway captured by a drone is used as experimental data. The video is collected by the drone while cruising along the highway and includes various traffic scenes such as two-way lanes, normally traveling vehicles, slow-moving vehicles, and illegally parked vehicles. The video stream format is one of RTSP, RTMP, or HTTP.

[0061] The experiment used a drone equipped with a camera to capture aerial images of the road area. The video frames included ground scenes such as roads, vehicles, and lane lines. Because drone aerial videos are characterized by changes in perspective, image shake, changes in target scale, and the vehicle's direction of travel not perfectly aligning with the image direction, this embodiment effectively demonstrates the detection performance of the method of this invention in complex aerial photography scenarios.

[0062] II. Experimental Parameter Settings Vehicle detection confidence threshold Set the value to 0.5, and set the speed sliding window length accordingly. Take 30, suspected illegal parking subsequent counting interval Set the threshold to 5 for the cumulative number of occurrences. The value is set to 8, the aspect ratio threshold λ is set to 1.3, and the aspect ratio is continuously confirmed in the frame. Take 5.

[0063] Among them, the vehicle detection confidence threshold Used to filter vehicle detection results, retaining only vehicle targets with a confidence level of not less than 0.5; speed sliding window length This is used to average the velocity values ​​of the most recent 30 valid directed pixels to obtain a smooth velocity point; the subsequent counting interval for suspected illegal parking. Used to determine whether the frame interval between two consecutive confirmations after a vehicle triggers a suspected illegal parking candidate reaches 5 frames; cumulative occurrence threshold. Used to determine if the cumulative number of vehicle confirmations has reached 8; the aspect ratio threshold λ is used to determine if the height of the detection frame is greater than 1.3 times its width; the number of consecutive confirmation frames based on aspect ratio. Used to determine whether a vehicle satisfies morphological constraints for 5 consecutive frames.

[0064] The speed threshold range is [-49, 0] in free-flow conditions and [-49, -15] in congested conditions. This allows for different judgment criteria for low-speed vehicles in free-flow and congested conditions, improving adaptability in complex traffic environments.

[0065] III. Experimental Procedure The experimental procedure in this embodiment is performed according to the method described in Embodiment 1, and specifically includes the following steps: (1) Unmanned aerial vehicle (UAV) video acquisition The drone cruised along the highway, collecting continuous video frames including two-way lanes, vehicles traveling normally, vehicles moving slowly, and vehicles that were illegally parked.

[0066] (2) ROI region construction and screening Based on the drone's flight altitude, camera pitch angle, and attitude stability, a valid detection region (ROI) is defined in the video frame image. For the vehicle bounding box, the ordinate of its upper edge is taken as the region determination point. When the ordinate of the upper edge is not less than the longitudinal starting position of the valid detection region, the vehicle target is considered a valid vehicle; if the vehicle bounding box does not enter the valid detection region, it will not participate in subsequent tracking and illegal parking determination.

[0067] (3) Vehicle target extraction and DeepSort tracking Target vehicles are detected from video frame images, and a vehicle target feature set is extracted. Only targets with the category number "vehicle" and a confidence level not less than a threshold are retained. The target is to input valid vehicles within the effective detection area into the DeepSort multi-object tracking model, associate valid vehicle targets across frames, and obtain a vehicle tracking set with trajectory numbers. If the vehicle bounding box output by the tracking model drifts outside the effective detection area again, then that vehicle bounding box will not participate in the determination in the current frame.

[0068] (4) Construction of directed pixel velocity and smooth sequence For each vehicle trajectory in the vehicle tracking set, the center point of the valid vehicle target detection box in the current frame and the center point of the valid vehicle target detection box in the previous valid frame are taken. The lateral and longitudinal displacements are calculated, and the pixel velocity magnitude in the image plane is calculated based on the time difference between the two valid observations. The velocity sign is determined according to the longitudinal motion direction of the image, and a directed pixel velocity sequence is constructed. The directed pixel velocity sequence is then subjected to sliding window averaging to obtain a smooth velocity sequence.

[0069] (5) Construction of candidate intervals for suspected illegal parking Based on the smoothed speed sequence distribution of all vehicle trajectories in the current video scene, vehicle trajectories belonging to normal travel in the same direction and normal travel in the opposite direction are removed, and vehicle trajectories located in the low-speed negative concentrated distribution area are retained to form a reference sample set. The representative speed of each vehicle trajectory in the reference sample set is calculated, and robust statistical fusion is performed on the representative speeds of all vehicles to obtain the directed pixel reference values ​​of illegally parked vehicles in the current video scene. The speed range between the directed pixel reference values ​​of illegally parked vehicles and the zero speed line is determined as the candidate speed interval for suspected illegal parking in the current video scene.

[0070] (6) Multi-stage fusion determination The trajectory of vehicles falling into the candidate speed range for suspected illegal parking is subject to multi-stage fusion judgment, including speed curve stability judgment, confirmation of subsequent cumulative occurrence count, and target attitude aspect ratio verification. Only vehicles that successively meet the speed curve stability condition, cumulative occurrence count condition, and detection box aspect ratio continuous verification condition are added to the final illegal parking set.

[0071] (7) Generation and reporting of illegal parking incidents When a vehicle's trajectory first enters the final set of illegal parking events, an illegal parking event record is generated, and a screenshot of the illegal parking is saved, written to the database, or uploaded to a remote server.

[0072] Experimental results The final confirmation result will be written into the illegal parking vehicle result table.

[0073] Table 1: Results of Illegally Parked Vehicle Detection

[0074] As shown in Table 1, this experiment ultimately confirmed 5 illegally parked vehicles, namely vehicle IDs 34, 43, 44, 49, and 78. All vehicles were in free-flow state, with a speed range of [-49, 0]. The average trigger speed was distributed between -28.62px / s and -18.53px / s, and the confirmation frame / time distribution was between 648 / 21.60 and 1220 / 40.67. The subsequent cumulative occurrences were all 8 times, with aspect ratios of 1.59, 1.44, 1.33, 1.78, and 1.40, and consecutive frame counts of 5 frames.

[0075] Experimental Results Analysis Calculate the representative speed of each reference vehicle's smoothed speed sequence. The values ​​are mainly distributed between -56.48 and -42.52 px / s. After robust fusion, the reference value for the directional pixel velocity of illegally parked vehicles in the current scene is approximately -47.95 px / s. Considering that this reference value is used for the lower boundary of the candidate interval, to avoid missing stationary or near-stationary vehicles close to the boundary, we take... =-49px / s.

[0076] The average speed of each vehicle during triggering ranges from -28.62px / s to -18.53px / s. After triggering, each vehicle was confirmed by subsequent cumulative occurrence counts, aspect ratio distribution, and consecutive frame counts. This indicates that the confirmed vehicles not only meet the speed window condition but also the conditions for continuous occurrence and continuous morphological confirmation.

[0077] Experimental results show that a single frame may only display a portion of confirmed illegally parked vehicles, while a complete video sequence, after vehicle detection, region filtering, trajectory tracking, initial speed assessment, continuity confirmation, and secondary morphological confirmation, can form a stable final set of illegally parked vehicles and generate corresponding illegal parking event records and evidence information. This multi-stage progressive judgment process avoids directly judging short pauses, detection frame jitter, trajectory drift, or low-speed targets in a single frame as illegally parked, improving the stability and verifiability of the detection results. The above experimental parameters are applicable to the drone altitude, shooting angle, and road traffic conditions in this embodiment; when the application scenario changes, they can be recalibrated according to actual video characteristics and regulatory requirements.

[0078] Embodiment 2 of this invention uses drone aerial video of a highway to conduct an experiment on illegally parked vehicles, verifying the effectiveness of the multi-stage detection method for parking behavior on two-way roads based on drone video described in this invention. Experimental results show that this invention can stably and accurately distinguish between genuine illegally parked vehicles, slow-moving vehicles, and normally moving vehicles under conditions such as changes in drone perspective, complex vehicle movement in two-way lanes, road congestion, slow-moving vehicles, target occlusion, and detection frame jitter. This reduces false alarms and missed detections, and generates a traceable and verifiable chain of evidence for illegal parking events, facilitating subsequent law enforcement review and platform reporting.

[0079] Example 3 Based on the multi-stage detection method for bidirectional road parking behavior based on UAV video proposed in Embodiment 1 of the present invention, Figure 3 Here is a schematic diagram of the multi-stage detection device for bidirectional road parking behavior based on UAV video proposed in Embodiment 3 of the present invention: At the hardware level, electronic device 300 includes a processor 310, and optionally, an internal bus 320, a network interface 330, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may also include non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its functions.

[0080] The processor 310, network interface 330, and memory can be interconnected via an internal bus 320. This internal bus 320 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus. The memory is used to store programs. Specifically, the program can include program code, which includes computer operation instructions. The memory can include main memory 340 and non-volatile memory 350, and provides instructions and data to the processor 310.

[0081] The processor 310 reads the corresponding computer program from the non-volatile memory 350 into the main memory 340 and then runs it, forming a multi-stage detection device for bidirectional road parking behavior at the logical level. The processor 310 executes the program stored in the memory and specifically performs the following: In step S1, a video stream of the road scene is acquired; In step S2, the target vehicle is detected from the video frame images of the video stream; the effective detection area is delineated from the video frame images; In step S3, target vehicles are screened based on the effective detection area, and valid vehicles that have entered the effective detection area are retained; In step S4, cross-frame trajectory association is performed on the effective vehicles to obtain a vehicle tracking set with trajectory numbers; for each vehicle trajectory in the vehicle tracking set, the pixel velocity in the image plane is calculated based on the displacement and time difference of the center point of the target detection box of the effective vehicle between two adjacent effective observations, and the velocity sign is determined according to the vertical motion direction of the image to construct a directed pixel velocity sequence; the directed pixel velocity sequence is subjected to sliding window averaging to obtain a smooth velocity sequence. In step S5, the candidate speed range for suspected illegal parking is determined based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene; In step S6, the trajectories of vehicles whose smooth speed falls within the suspected illegal parking candidate speed range are added to the suspected illegal parking candidate set; In step S7, a multi-stage fusion determination is performed on the vehicle trajectories in the suspected illegal parking candidate set; In step S8, vehicles that meet the judgment conditions are added to the final illegal parking set; when the vehicle trajectory enters the final illegal parking set for the first time, an illegal parking event record is generated.

[0082] Figure 1It can be applied to processor 310, or implemented by processor 310. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the processor or by instructions in the form of software. The processor mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0083] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0084] The description of the relevant parts of the multi-stage detection device for parking behavior on two-way roads based on UAV video provided in Embodiment 3 of this application can be found in the detailed description of the corresponding parts of the multi-stage detection method for parking behavior on two-way roads based on UAV video provided in Embodiment 1 of this application, and will not be repeated here.

[0085] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.

[0086] While specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art can make other modifications or variations based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A multi-stage detection method for parking behavior on two-way roads based on UAV video, characterized in that, Includes the following steps: Acquire a road scene video stream and detect the target vehicle from the video frame images of the video stream; Delineate the effective detection region from the video frame images; And based on the effective detection area, target vehicles are screened, and valid vehicles that have entered the effective detection area are retained; Cross-frame trajectory association is performed on the effective vehicles to obtain a vehicle tracking set with trajectory numbers; for each vehicle trajectory in the vehicle tracking set, the pixel velocity in the image plane is calculated based on the displacement and time difference of the center point of the target detection box of the effective vehicle between two adjacent effective observations, and the velocity sign is determined according to the vertical motion direction of the image to construct a directed pixel velocity sequence. The directed pixel velocity sequence is averaged using a sliding window to obtain a smooth velocity sequence. Based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene, the candidate speed range for suspected illegal parking is determined; vehicle trajectories whose smooth speed falls into the candidate speed range for suspected illegal parking are added to the candidate set for suspected illegal parking, and the vehicle trajectories in the candidate set for suspected illegal parking are subjected to multi-stage fusion judgment, and vehicles that meet the judgment conditions are added to the final illegal parking set. When a vehicle's trajectory first enters the final set of illegal parking events, an illegal parking event record is generated.

2. The method according to claim 1, characterized in that, The effective detection region is delineated from the video frame image, specifically as follows: Based on the UAV's flight altitude, camera pitch angle, and attitude stability, an effective detection region is defined in the video frame image; the effective detection region is the area in the image from the vertical starting position to the bottom of the image; wherein, the vertical starting position is adaptively determined based on the camera pitch angle and the UAV's flight altitude; Furthermore, by establishing a fusion relationship between pitch angle and flight altitude factors in advance, the longitudinal starting position is automatically calibrated when the preset stability conditions are met, so that the effective detection area can be adjusted with changes in camera pitch angle and UAV flight altitude.

3. The method according to claim 2, characterized in that, The longitudinal starting position is adaptively determined based on the camera pitch angle and the UAV flight altitude, specifically as follows: When the camera pitch angle transitions from horizontal to vertical shooting, the proportion of the longitudinal starting position in the image height direction increases. As the drone's flight altitude increases, the proportion of the longitudinal starting position in the image height direction decreases.

4. The method according to claim 1, characterized in that, Cross-frame trajectory association is performed on the valid vehicles to obtain a vehicle tracking set with trajectory numbers, specifically as follows: The effective vehicles within the effective detection area are input into the multi-target tracking model, and the effective vehicles across frames are associated to obtain a vehicle tracking set with trajectory numbers: ; in, For vehicle tracking sets; For the first The first frame One vehicle tracking target; For the first The x-coordinate of the first corner point of each valid vehicle detection frame; For the first The ordinate of the first corner point of a valid vehicle detection frame; For the first The x-coordinate of the second corner point of each valid vehicle detection frame; For the first The ordinate of the second corner point of each valid vehicle detection frame; For the first The trajectory number of each valid vehicle.

5. The method according to claim 4, characterized in that, The process of constructing a directed pixel velocity sequence is as follows: For each vehicle trajectory in the vehicle tracking set, take the center point of the valid vehicle target detection box in the current frame and the center point of the valid vehicle target detection box in the previous frame, and calculate the lateral and longitudinal displacements: ; in, For the first The first frame The x-coordinate of the center point of each valid vehicle target detection box; For the first The first frame The ordinate of the center point of each valid vehicle target detection box; The first in the previous valid frame The x-coordinate of the center point of each valid vehicle target detection box; The first in the previous valid frame The ordinate of the center point of each valid vehicle target detection box; This is a lateral displacement; This is the longitudinal displacement; Let the time difference between two valid observations be . Then the pixel velocity of the effective vehicle in the image plane is: ; when When a valid vehicle is moving downwards in the frame, it is recorded as... ;when When a valid vehicle is moving upwards in the frame, it is recorded as [time]. ;when When the time is right, it indicates that the valid vehicle has no longitudinal displacement in the image, and is recorded as follows: ; Therefore, the directed pixel velocity sequence for each vehicle trajectory is constructed as follows: ; in, For the first A directed pixel velocity sequence of 10 effective vehicles; For the first valid vehicles in Directed pixel velocity during the first effective observation.

6. The method according to claim 5, characterized in that, The directed pixel velocity sequence is averaged using a sliding window to obtain a smooth velocity sequence. With a sliding window length of At that time, the average directed pixel velocity within the window is calculated as a smooth velocity point: ; in, For the first valid vehicles in Smooth velocity point during the first effective observation; For the first valid vehicles in Directed pixel velocity at the first effective observation; For the first The sliding window length for the first effective observation is The set of all directed pixel velocity values ​​within the sliding speed window; Smooth velocity sequence Represented as: ; in, This represents the number of smooth speed points generated by the vehicle during the observation period.

7. The method according to claim 1, characterized in that, Based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene, the candidate speed ranges for suspected illegal parking are determined, specifically: Based on the smooth speed sequence distribution of all vehicle trajectories in the current video scene, vehicle trajectories belonging to normal driving in the same direction and normal driving in the opposite direction are removed, and vehicle trajectories located in the low-speed negative concentrated distribution area are retained to form a reference sample set. For each vehicle trajectory in the reference sample set, calculate its representative speed during the observation period. The representative speed is the average of all smoothed speed points of the vehicle trajectory during the observation period. Robust statistical fusion is performed on the representative speeds of all vehicles in the reference sample set to obtain the directed pixel reference values ​​of illegally parked vehicles in the current video scene, wherein the robust statistical fusion adopts the truncated mean, median or weighted mean. The speed range between the directional pixel reference value of the illegally parked vehicle and the zero speed line is determined as the candidate speed range for suspected illegal parking in the current video scene.

8. The method according to claim 1, characterized in that, The multi-stage fusion judgment includes a primary judgment based on velocity curve stability, a secondary judgment based on continuous features, and a tertiary verification based on target attitude, specifically: First-order discrimination: For the trajectory of a vehicle that has been added to the suspected illegal parking candidate set, determine whether the vehicle meets the speed stability condition for parking behavior based on the fluctuation amplitude and / or second-order change of its smooth speed sequence; if it does, retain it in the suspected illegal parking candidate set. Secondary discrimination: For vehicles that have been added to the suspected illegal parking candidate set but have not yet completed multi-frame confirmation, a counting interval threshold and a cumulative occurrence threshold are set; after a vehicle triggers a suspected illegal parking candidate, its occurrence in subsequent frames is observed. When the frame interval between two adjacent confirmations reaches the counting interval threshold, the confirmation count of the vehicle is incremented by one. When the cumulative number of occurrences reaches the cumulative number of occurrences threshold, the vehicle is added to the initial speed-based illegal parking set. Three-stage verification: For vehicles already added to the initial speed-based illegal parking set, calculate the aspect ratio of their detection boxes. When the height of the detection box is greater than the product of the aspect ratio judgment threshold and the width of the detection box, the current frame is determined to meet the vehicle shape constraints. Establish a shape confirmation window for each vehicle initially judged to be illegally parked. When multiple consecutive frames meet the above shape constraints, add the vehicle to the final illegal parking set.

9. The method according to claim 1, characterized in that, The record of the illegal parking incident Represented as: ; in, For the first Vehicle trajectory numbers of all valid vehicles; For trigger frame; For trigger time, To trigger average velocity, For the final confirmation frame or confirmation time, This is the cumulative number of occurrences. To confirm the aspect ratio of the detection frame, To ensure the number of frames that continuously meet the aspect ratio requirement, This is the screenshot path or remote image address for the illegal parking violation. This provides the latitude and longitude information of the equipment.

10. A multi-stage detection device for parking behavior on two-way roads based on UAV video, comprising at least one processor and a memory, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the at least one processor, it implements the multi-stage detection method for bidirectional road parking behavior based on UAV video as described in any one of claims 1 to 9.