Parking lot order evasion detection method and device, electronic equipment and storage medium

By generating a tracking list through vehicle detection and visual tracking algorithms in video streams, and combining this with a state machine model to determine the vehicle's motion status, the problem of toll evasion in intelligent unattended parking lots has been solved, and the accuracy and reliability of gate control have been improved.

CN121884618APending Publication Date: 2026-04-17RECONOVA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RECONOVA TECH CO LTD
Filing Date
2025-12-17
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, intelligent unmanned parking lots cannot effectively distinguish between following vehicles and reversing vehicles, leading to payment evasion problems and causing the gate to be opened incorrectly or not opened at all.

Method used

Vehicle detection is performed on consecutive video frames in the video stream to obtain detection boxes. A unique tracking identifier is assigned to each vehicle based on a visual tracking algorithm, and a tracking list containing the identifier and the complete motion trajectory is generated. The vehicle's motion direction and state are determined by combining a state machine model, and corresponding gate control events are generated.

Benefits of technology

It significantly reduces the probability of erroneous or missed gate lifting, improves the accuracy and reliability of gate control, and reduces the system's unnecessary computing power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884618A_ABST
    Figure CN121884618A_ABST
Patent Text Reader

Abstract

The invention provides a parking lot order evasion detection method and device, electronic equipment and a storage medium, and the method is applied to the technical field of parking lot vehicle management, and comprises the steps: carrying out the vehicle detection of a plurality of continuous video frames in a video stream, and obtaining a detection frame of a vehicle in each video frame; tracking the vehicle based on a visual tracking algorithm to generate a tracking list; judging the motion direction of the vehicle according to the motion trail of the vehicle in the tracking list, determining the vehicle with the motion direction being the direction away from the parking lot as a target vehicle, and maintaining a motion state record for the target vehicle in the vehicle state list; traversing the motion state of the target vehicle in the vehicle state list; judging whether the motion state of the target vehicle is car following or car backing, and if yes, generating an abnormal behavior event; and sending the abnormal behavior event to a barrier gate control system, so that the barrier gate control system executes corresponding operations according to different events. The method can prevent the problem of vehicle fee evasion in the parking lot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of parking lot vehicle management technology, and more specifically, to a method, apparatus, electronic device, and storage medium for detecting parking lot fare evasion. Background Technology

[0002] With the development of the Internet of Things, artificial intelligence, and related smart parking system technologies, unmanned parking is becoming increasingly common. Parking management systems can realize functions such as vehicle entry and exit management, parking space information management, parking space reservation management, and parking fee collection, effectively improving the management level and service quality of parking lots and providing users with a more convenient and efficient parking experience; however, unmanned smart parking lots are prone to fee evasion.

[0003] In related technologies, inductive loop detectors and parking barriers are used to prevent fare evasion. However, when the inductive loop detector detects a vehicle, it triggers the parking barrier to open. In this situation, the parking management system cannot distinguish between following vehicles and reversing vehicles, leading to fare evasion issues such as following other vehicles to avoid paying and turning around to avoid paying. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for detecting parking lot fare evasion, which can prevent vehicles from evading parking fees.

[0005] Firstly, a method for detecting parking lot fare evasion is provided, the method comprising: Vehicle detection is performed on multiple consecutive video frames in the video stream, and the detection bounding boxes of multiple vehicles in each video frame are obtained. For each vehicle, the vehicle is tracked based on a visual tracking algorithm, and a tracking list containing the vehicle's tracking identifier and motion trajectory is generated and stored. Based on the movement trajectory of each vehicle in the tracking list, the movement direction of each vehicle is determined. Vehicles moving in the direction of leaving the parking lot are identified as target vehicles. Based on the state machine model, a movement state record is maintained for each target vehicle in the vehicle state list. The movement state includes detected, passing, abnormal, and leaving. Abnormal includes reversing and following. Iterate through the motion state of each target vehicle in the vehicle state list; For any target vehicle, if the target vehicle is in motion and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, then the current motion state of the target vehicle is determined to be leaving, and a normal leaving event is generated. The target detection box is the detection box of the target vehicle. If the target vehicle is in reverse and the target detection box does not intersect with the preset detection area, then the current movement state of the target vehicle is determined to be reversing and a reversing event is generated. If the target detection box intersects with the preset detection area, it is determined whether the target vehicle's movement state is following or reversing. If so, an abnormal behavior event is generated. The system sends the normal departure event, the reversing return event, and the abnormal behavior event to the barrier gate control system so that the barrier gate control system can perform the corresponding barrier gate control operation according to the different events.

[0006] The above-described scheme addresses the common issues of erroneous or missed gate openings in some barrier control systems. However, this method detects vehicles and obtains detection frames from consecutive frames in the video stream. Based on a visual tracking algorithm, it assigns a unique tracking identifier to each vehicle, generating a tracking list containing that identifier and its complete motion trajectory. The uniqueness of the tracking identifier allows for full tracking of the vehicle's trajectory from entering the preset detection area to leaving. By filtering out target vehicles in the departure direction based on their motion trajectory, state management is only performed on vehicles requiring barrier response, significantly reducing unnecessary computational power consumption. In this embodiment, by judging the vehicle's motion state, different behavioral intentions of the vehicle are accurately distinguished, significantly reducing the probability of erroneous or missed gate openings and improving the accuracy and reliability of barrier control.

[0007] In conjunction with the first aspect, in some possible implementations, determining the direction of motion of each vehicle based on the motion trajectory of each vehicle in the tracking list includes: Calculate the first average coordinates of the center points of the detection boxes in the initial consecutive preset frames of the motion trajectory, and use the first average coordinates as the coordinates of the starting reference point. Calculate the second average coordinates of the center points of the detection boxes in the last few consecutive preset frames of the motion trajectory, and use the second average coordinates as the coordinates of the end reference point. Subtracting the coordinates of the ending reference point from the coordinates of the starting reference point yields the coordinates of the reference vector. If the horizontal component of the reference vector is greater than a first preset threshold, the direction of the vehicle's movement is determined to be the direction of leaving the parking lot. If the horizontal component of the reference vector is less than a first preset threshold, the vehicle's direction of motion is determined to be the direction of entering the parking lot.

[0008] In conjunction with the first aspect, in some possible implementations, the state machine-based model maintains a motion state record for each target vehicle in the vehicle state list, including: If the tracking identifier in the vehicle status list appears in the tracking list for a duration less than a first preset duration, it is determined that the target vehicle has left the preset detection area, and the tracking information of the target vehicle in the vehicle status list is deleted.

[0009] In conjunction with the first aspect, in some possible implementations, if the target detection box intersects with the preset detection area, determining whether the target vehicle's movement state is following or reversing includes: Obtain the x-coordinate of the center point of the right bounding box of the target detection box and the x-coordinate of the center point of the left bounding box of the reference detection box, wherein the reference detection box is the detection box of vehicles other than the target vehicle. If the x-coordinate of the center point of the left frame is greater than the x-coordinate of the center point of the right frame, and the difference between the x-coordinate of the center point of the left frame and the x-coordinate of the center point of the right frame is greater than the second preset threshold and less than the third preset threshold, then it is determined that the target vehicle is suspected of following another vehicle. If the number of consecutive video frames of the suspected following vehicle exceeds the fourth preset threshold, then the movement state of the target vehicle is determined to be following.

[0010] In conjunction with the first aspect, in some possible implementations, if the target detection box intersects with the preset detection area, determining whether the target vehicle's movement state is following or reversing includes: The coordinates of multiple first center points of the target vehicle's trajectory within a second preset time period are obtained, as well as the coordinates of multiple second center points of the target vehicle's trajectory within a third preset time period, wherein the third preset time period is earlier than the second preset time period. The instantaneous motion direction vector of the target vehicle is obtained by taking a weighted average of the coordinates of the multiple first center points and the multiple second center points. Calculate the angle between the instantaneous motion direction vector and the overall motion direction vector of the target vehicle; If the angle is greater than the fifth preset threshold and the duration of the angle is greater than the sixth preset threshold, the motion state of the target vehicle is determined to be reversing.

[0011] In conjunction with the first aspect, in some possible implementations, if the target detection box intersects with the preset detection area, before determining whether the target vehicle's movement state is following or reversing, the method further includes: Obtain the coordinates of the first top-left corner and the first bottom-right corner of the target detection box; Obtain the coordinates of the second upper left corner and the second lower right corner of the preset detection area; The calculation is performed based on the first upper left corner coordinate, the first lower right corner coordinate, the second upper left corner coordinate, and the second lower right corner coordinate to determine whether there is an intersection between the target detection box and the preset detection area.

[0012] Secondly, a method for detecting parking lot fare evasion is provided, the method comprising: When the first detector sends a normal vehicle departure event, the control gate ends the transaction process. When the detector receives a vehicle reversing event, it controls the barrier gate to cancel the current transaction's passage permission. When the detector receives an abnormal vehicle behavior event, it controls the barrier gate to stop raising or terminate the raising of the barrier gate to ensure that the barrier gate is in the closed state.

[0013] Thirdly, a device for detecting parking lot fare evasion is provided, the device comprising: The acquisition module is used to detect vehicles in multiple consecutive video frames in the video stream and acquire the detection boxes of multiple vehicles in each video frame. The generation module is used to track each vehicle based on a visual tracking algorithm, generate and store a tracking list containing the vehicle's tracking identifier and motion trajectory. The judgment module is used to determine the movement direction of each vehicle based on the movement trajectory of each vehicle in the tracking list. Vehicles whose movement direction is to leave the parking lot are identified as target vehicles. Based on the state machine model, a movement state record is maintained for each target vehicle in the vehicle state list. The movement state includes detected, passing, abnormal and leaving. Abnormal includes reversing and following. The traversal module is used to traverse the motion state of each target vehicle in the vehicle state list; The determination module is used to determine the current movement state of the target vehicle as leaving if the target vehicle's movement state is "passing" and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, and generate a normal departure event. The target detection box is the detection box of the target vehicle. The determination module is used to determine the current motion state of the target vehicle as reversing and generate a reversing return event if the target vehicle's motion state is reversing and the target detection box does not intersect with the preset detection area. The generation module is used to determine whether the target vehicle's motion state is following or reversing if the target detection box intersects with the preset detection area; if so, an abnormal behavior event is generated. The sending module is used to send the normal departure event, the reversing return event, and the abnormal behavior event to the barrier gate control system, so that the barrier gate control system can perform corresponding barrier gate control operations according to different events.

[0014] Fourthly, an electronic device is provided, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the electronic device to perform the methods described above for detecting fare evasion in parking lots.

[0015] Fifthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to perform the method described above for detecting fare evasion in parking lots.

[0016] In a sixth aspect, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the method described above for detecting fare evasion in parking lots. Attached Figure Description

[0017] Figure 1 This is a schematic diagram illustrating the implementation environment of a parking lot fare evasion detection method provided in this application embodiment; Figure 2 This is a schematic flowchart of a parking lot fare evasion detection method provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the field of view of a camera according to an embodiment of this application; Figure 4 This is a schematic diagram illustrating the change in the motion state of a vehicle according to an embodiment of this application; Figure 5 This is a schematic flowchart illustrating another method for detecting fare evasion in parking lots provided in an embodiment of this application; Figure 6 This is a schematic flowchart illustrating another method for detecting fare evasion in parking lots provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a parking lot fare evasion detection device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0019] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0020] In the following description of the embodiments of this application, it is used as... Figure 1 Taking an example, the implementation environment of the embodiments of this application will be introduced.

[0021] For example, such as Figure 1 As shown, the implementation environment includes detector 110 and barrier gate control system 120.

[0022] Detector 110 is used to acquire video frames of vehicles moving at the parking lot entrance. In some embodiments, detector 110 includes an image acquisition module, a data processing module, and a vehicle behavior analysis module. For example, detector 110 includes a wide-angle camera and a central processing unit. Detector 110 can detect the acquired video frames of vehicles moving and determine the vehicle's behavior events, while simultaneously sending the vehicle's behavior events to the barrier gate control system 120. In some embodiments, detector 110 connects to a device via a remote configuration interface to set the vehicle's entry and exit directions and a preset detection area.

[0023] The barrier gate control system 120 is used to control whether the barrier gate is raised. In some embodiments, after receiving a behavior event sent by the detector 110, the barrier gate control system 120 controls the barrier gate to perform corresponding control processing based on the behavior event.

[0024] To address at least one of the aforementioned technical problems, this application provides a method for detecting parking lot fare evasion. Some gate control systems are prone to issues such as erroneous gate opening and missed gate openings. This method, however, can detect vehicles and obtain detection frames from consecutive frames in a video stream. Based on a visual tracking algorithm, a unique tracking identifier is assigned to each vehicle, generating a tracking list containing the identifier and its complete motion trajectory. The uniqueness of the tracking identifier allows for full tracking of the vehicle's trajectory from entering the preset detection area to leaving. Target vehicles in the departure direction are filtered out based on the motion trajectory, and state management is only performed on vehicles requiring gate response, significantly reducing unnecessary computational power consumption. In this application embodiment, by judging the vehicle's motion state, different behavioral intentions of the vehicle are accurately distinguished, significantly reducing the probability of erroneous or missed gate openings and improving the accuracy and reliability of gate control.

[0025] Figure 2 This is a schematic flowchart of a parking lot fare evasion detection method provided in an embodiment of this application.

[0026] For example, such as Figure 2 As shown, taking the detector as the executing entity as an example, this application describes a method for detecting parking lot fare evasion. The method includes the following steps.

[0027] Step 201: Perform vehicle detection on multiple consecutive video frames in the video stream and obtain the detection boxes of multiple vehicles in each video frame.

[0028] The video stream is a sequence of continuously transmitted video frames used for vehicle detection. The continuous video frames are the video frames of the vehicle at the parking lot exit.

[0029] In some embodiments, consecutive single-frame images are acquired from the video stream according to the frame rate to form an image sequence to be detected; the size of each frame image is adjusted to the YOLO model input specification, and the pixels of each frame image are normalized; finally, the normalized images are format matched.

[0030] In some embodiments, multiple vehicles in each video frame are detected based on the YOLO model to obtain a detection box corresponding to each vehicle.

[0031] Step 202: For each vehicle, track the vehicle based on the visual tracking algorithm, and generate and store a tracking list containing the vehicle's tracking identifier and motion trajectory.

[0032] The visual tracking algorithm is used to locate vehicles through continuous image sequences (video / frame sequences) and continuously output the target's position, pose, or motion state. In some embodiments, the visual tracking algorithm can be an algorithm based on networks such as CNN or Transformer. The tracking identifier is a unique identifier assigned by the visual tracking algorithm to each individual vehicle in the video sequence. The tracking identifier is used to distinguish different vehicles in different video frames. The tracking list includes the vehicle's tracking identifier and its motion trajectory. The vehicle's motion trajectory is the motion trajectory acquired and tracked by the detector.

[0033] Step 203: Determine the movement direction of each vehicle based on the movement trajectory of each vehicle in the tracking list. Identify the vehicle whose movement direction is to leave the parking lot as the target vehicle. Based on the state machine model, maintain a movement state record for each target vehicle in the vehicle state list. The movement state includes detected, passing, abnormal and leaving. Abnormal includes reversing and following.

[0034] The tracking list includes the movement trajectories of each vehicle and its tracking identifier. The vehicle's direction of movement includes the first direction of departure from the parking lot and the second direction of entry into the parking lot. The target vehicle is the vehicle whose direction of movement is determined to be departing from the parking lot. A state machine model is used to define the vehicle's motion states. Vehicle motion states include detected, in transit, abnormal, and departing; abnormal states include reversing and following.

[0035] It should be understood that the detector determines the direction of entry and exit of a vehicle based on the movement trajectory of the detection frame of each vehicle. The detector only stores the running status record of the target vehicle and determines the current state of the target vehicle as detected.

[0036] In some embodiments, if the current motion state of the target vehicle is detected as detected, the motion state is stored in the vehicle state list.

[0037] In one possible implementation, the first average coordinates of the center points of the detection frames in the initial multiple preset frames of the motion trajectory are calculated, and these first average coordinates are used as the starting reference point coordinates; the second average coordinates of the center points of the detection frames in the final multiple preset frames of the motion trajectory are calculated, and these second average coordinates are used as the ending reference point coordinates; the coordinates of the reference vector are obtained by subtracting the coordinates of the starting reference point from the coordinates of the ending reference point; if the horizontal coordinate component of the coordinates of the reference vector is greater than a first preset threshold, the direction of motion of the vehicle is determined to be the direction of leaving the parking lot; if the horizontal coordinate component of the coordinates of the reference vector is less than the first preset threshold, the direction of motion of the vehicle is determined to be the direction of entering the parking lot.

[0038] The motion trajectory is obtained by tracking the vehicle in consecutive video frames using a visual tracking algorithm. A detection box is used to track the vehicle. The coordinates of the center point of the detection box represent the coordinates of the vehicle's motion trajectory. Multiple preset frames are multiple consecutive preset frames; this embodiment does not limit this, for example, multiple preset frames are m consecutive frames. The first preset threshold is a threshold automatically generated by the detector; this embodiment does not limit this, for example, the first preset threshold is 0.

[0039] It should be understood that in practical applications, in the field of vehicle tracking, the vehicle's trajectory includes a starting trajectory and an ending trajectory. The overall direction of the vehicle's movement needs to be determined based on the starting and ending trajectories. That is, the vehicle's direction of movement is determined based on multiple preset consecutive frames of the starting segment and the ending segment of the trajectory.

[0040] In some embodiments, the reference vector is calculated using the following formula.

[0041]

[0042] in, The coordinates are those of the reference vector; The x-axis component in the first average coordinate system; The ordinate component in the first average coordinate system; The x-axis component in the second average coordinate system; This represents the ordinate component in the second average coordinate system.

[0043] In some embodiments, if If the value is greater than 0, then the vehicle's direction of movement is determined to be the direction of leaving the parking lot. If If <0, then the vehicle's direction of movement is determined to be the direction of entering the parking lot. If =0, then the vehicle is stationary and not moving.

[0044] In this implementation, the initial segment video frame and the final segment video frame of the vehicle's motion trajectory are acquired to determine the overall direction of the vehicle's motion. That is, the vehicle's direction can be directly determined based on the coordinates of the center point of the detection box. Moreover, based on the average characteristics of the initial segment video frame and the final segment video frame of the vehicle's motion trajectory, it is not necessary to rely on the complete trajectory. This not only ensures the effectiveness of the direction determination but also does not increase the computational burden on the detector.

[0045] It should be understood that after determining the direction of a vehicle's movement, it is necessary to identify vehicles leaving the parking lot. In practical applications, vehicles leaving the parking lot may attempt to evade payment. To determine whether a vehicle has evaded payment, it is also necessary to determine whether the vehicle's departure was abnormal; that is, the vehicle's movement status needs to be determined.

[0046] In one possible implementation, if the tracking identifier in the vehicle status list appears in the tracking list for a duration less than a first preset duration, it is determined that the target vehicle has left the preset detection area, and the tracking information of the target vehicle in the vehicle status list is deleted.

[0047] The first preset duration is automatically determined by the detector, and this embodiment does not limit this duration. The tracking list includes the vehicle's tracking identifier and a list of the vehicle's movement trajectory. The preset detection area is the area where the detector detects whether a vehicle has skipped out of the parking lot.

[0048] It should be understood that in practical applications, because the detector detects and tracks each vehicle in real time, the tracking list stores the vehicle's tracking identifier and movement trajectory in real time. However, if a vehicle disappears after being stored in the tracking list for a preset period of time, it indicates that the vehicle has left the parking lot and has left the preset detection area.

[0049] In some embodiments, such as Figure 3 The diagram shows a schematic representation of the field of view of a camera according to an embodiment of this application. Figure 3 The diagram shows the camera, the preset detection area, and the vehicle's direction of movement. The camera is a wide-angle camera used to capture video frames of the vehicle as it travels through the parking lot exit. The vehicle's direction of movement includes both leaving and entering the parking lot. Figure 3 It only shows the direction to leave the parking lot.

[0050] In this implementation, since the preset detection area is used to determine whether a vehicle has skipped out of the parking lot, that is, to determine whether a vehicle has entered or exited the parking lot effectively, there is no need to detect vehicles that appear normally and for a short period of time. The detector automatically determines and deletes invalid information based on the duration of the tracking identifier, eliminating the need for maintenance personnel to manually clean up redundant data in the tracking list, thus reducing manual operation costs and the probability of errors.

[0051] Step 204: Iterate through the motion state of each target vehicle in the vehicle state list.

[0052] It should be understood that the vehicle status list includes the movement status of each target vehicle, and the movement status includes detected, passing, abnormal, and leaving. Abnormal includes reversing and following. These movement statuses can determine whether the target vehicle has skipped out of the parking lot. Therefore, in order to determine whether each target vehicle has left the parking lot normally, it is necessary to traverse the movement status of each target vehicle in the vehicle status list.

[0053] Step 205: For any target vehicle, if the target vehicle's movement state is "passing" and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, the current movement state of the target vehicle is determined to be "leaving", and a normal departure event is generated. The target detection box is the detection box of the target vehicle.

[0054] Figure 4 This illustration shows a schematic diagram of the change in the motion state of a vehicle according to an embodiment of this application.

[0055] It should be understood that in practical applications, the motion state of a target vehicle at a parking lot exit may undergo multiple changes; that is, the target vehicle's current motion state may change during its passage. For example, if the target vehicle's motion state is as follows... Figure 4 As shown. The vehicle status list stores the motion state of the target vehicle, and this motion state is detected. After determining that the target vehicle's motion state is detected, the target vehicle's motion state will change over time. For example, if the target vehicle is determined to be in transit, after the target vehicle is in transit, it is determined whether the horizontal coordinate of the center point of the right frame of the target vehicle's detection box is located to the left of the preset detection area. If the target vehicle's motion state is in transit, and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, then the target vehicle's current motion state is determined to be departing, and a normal departure event is generated. This target detection box is the target vehicle's detection box.

[0056] Step 206: If the target vehicle is in reverse and the target detection box does not intersect with the preset detection area, then the current movement state of the target vehicle is determined to be reversing and a reversing event is generated.

[0057] like Figure 4 As shown, if the target vehicle is in reverse and the target detection box does not intersect with the preset detection box, then the current movement state of the target vehicle is determined to be reversing, and a reversing event is generated. That is, if the target vehicle was previously in reverse, then the target vehicle may have reversed from the parking lot exit into the parking lot, meaning the target vehicle has exited the preset detection area. In this case, a reversing event is generated.

[0058] Step 207: If the target detection box intersects with the preset detection area, determine whether the target vehicle's movement state is following or reversing. If so, generate an abnormal behavior event.

[0059] The target detection box is used to track the motion state of the target vehicle.

[0060] It should be understood that if the target detection box intersects with the preset detection area, it means that the target vehicle is still at the parking lot exit. Therefore, it is still necessary to determine whether the target vehicle may evade payment, that is, to determine whether the target vehicle is following or reversing.

[0061] In one possible implementation, the abscissa of the center point of the right frame of the target detection box and the abscissa of the center point of the left frame of the reference detection box are obtained, wherein the reference detection box is the detection box of vehicles other than the target vehicle; if the abscissa of the center point of the left frame is greater than the abscissa of the center point of the right frame, and the difference between the abscissa of the center point of the left frame and the abscissa of the center point of the right frame is greater than a second preset threshold and less than a third preset threshold, then it is determined that the target vehicle is suspected of following another vehicle; if the number of consecutive video frames for which the following suspicion continues is greater than a fourth preset threshold, then the motion state of the target vehicle is determined to be following another vehicle.

[0062] Wherein, the second preset threshold is a threshold automatically determined by the detector, the third preset threshold is a threshold automatically determined by the detector, and the fourth preset threshold is a threshold automatically determined by the detector. This application embodiment does not limit these, for example, the second preset threshold can be 0, and the fourth preset threshold can be 5-10 frames.

[0063] In some embodiments, In this case, it was determined that the target vehicle was suspected of following another vehicle.

[0064] in, The x-coordinate of the center point of the right bounding box of the target vehicle's detection bounding box; The x-coordinate of the center point of the left border of the reference detection box; The second preset threshold, This is the third preset threshold.

[0065] In this implementation, the motion state of the target vehicle is determined as following another vehicle based on the x-coordinate of the center point of the right bounding box of the target detection box and the x-coordinate of the center point of the left bounding box of the reference detection box. That is, only the x-coordinates of the center points of the target detection box and the reference detection box are compared, eliminating the need for complex depth estimation or trajectory prediction and reducing computational complexity. Furthermore, by limiting the range of the difference in x-coordinates between the two vehicles using second and third preset thresholds, it is possible to effectively distinguish between following another vehicle, normal following distance, and excessively close distance, avoiding misjudgments caused by excessively large or small distances and improving detection accuracy.

[0066] In one possible implementation, the coordinates of multiple first center points of the target vehicle's trajectory within a second preset time period and the coordinates of multiple second center points of the target vehicle's trajectory within a third preset time period, the third preset time period being earlier than the second preset time period, are obtained; a weighted average of the multiple first center point coordinates and the multiple second center point coordinates is performed to obtain the instantaneous motion direction vector of the target vehicle; the angle between the instantaneous motion direction vector and the overall motion direction vector of the target vehicle is calculated; if the angle is greater than a fifth preset threshold and the duration of the angle is greater than a sixth preset threshold, the motion state of the target vehicle is determined to be reversing.

[0067] Wherein, the second preset duration is the duration automatically determined by the detector, the third preset duration is the duration automatically determined by the detector, the fifth preset threshold is the threshold automatically determined by the detector, and the sixth preset threshold is the threshold automatically determined by the detector. This application embodiment does not limit these, for example, the fifth preset threshold is 135 degrees, and the sixth preset threshold is 5-10 frames.

[0068] It should be understood that the instantaneous motion direction vector is the direction of movement of the vehicle in the shortest possible time. A 180-degree angle between the instantaneous motion direction and the overall motion direction indicates that the instantaneous motion direction and the overall motion direction are completely opposite. However, in practical applications, the target vehicle's trajectory may experience slight fluctuations, and the target vehicle's reversing path may change. Therefore, a 135-degree angle between the instantaneous motion direction and the overall motion direction indicates that the target vehicle's motion direction has changed drastically.

[0069] In some embodiments, the coordinates of the plurality of first center points and the plurality of second center points are weighted and averaged based on time decay to obtain the instantaneous motion direction vector of the target vehicle. That is, the coordinates closer to the end of the time window in the target vehicle's trajectory have higher weights, thus making the detector pay more attention to slow directional changes. In this case, even if the target vehicle has just begun to slowly reverse, the motion state of the target vehicle can be quickly determined by the instantaneous motion direction vector of the target vehicle.

[0070] In this implementation, the instantaneous motion direction vector of the target vehicle is calculated by weighted average, and this instantaneous motion direction vector is more biased towards the latest motion trend of the target vehicle, making the instantaneous direction vector more stable. Furthermore, the motion state of the target vehicle is determined based on the angle between the instantaneous motion direction vector and the overall motion direction vector of the target vehicle, as well as the duration of the angle. This makes the determination of the motion state of the target vehicle more stable, thereby enhancing the anti-interference ability of judging the motion state of the target vehicle based on the instantaneous motion direction vector.

[0071] Optionally, the following steps may also be performed before performing step 207 above.

[0072] In one possible implementation, the coordinates of the first upper left corner and the first lower right corner of the target detection box are obtained; the coordinates of the second upper left corner and the second lower right corner of the preset detection area are obtained; and calculations are performed based on the first upper left corner coordinates, the first lower right corner coordinates, the second upper left corner coordinates, and the second lower right corner coordinates to determine whether there is an intersection between the target detection box and the preset detection area.

[0073] The coordinates of the first upper left corner of the target detection box are (x1, y1), the coordinates of the first lower right corner are (x2, y2), the coordinates of the second upper left corner of the preset detection area are (a1, b1), and the coordinates of the second lower right corner are (a2, b2).

[0074] In some embodiments, if the first right x-coordinate in the first lower right corner coordinates of the target detection box is less than or equal to the second left x-coordinate in the second upper left corner coordinates of the preset detection region, it is determined that the target detection box and the preset detection region have no intersection. That is, the target detection box is completely to the left of the preset detection region, and the target detection box and the preset detection region have no intersection. That is, x2≤a1.

[0075] In some embodiments, if the second left abscissa in the first upper-left corner coordinates of the target detection box is greater than or equal to the second right abscissa in the second lower-right corner coordinates of the preset detection region, it is determined that the target detection box and the preset detection region have no intersection. That is, the target detection box is completely to the right of the preset detection region, and the target detection box and the preset detection region have no intersection. That is, x1≥a2.

[0076] In some embodiments, if the first right ordinate in the first lower right corner coordinate of the target detection box is less than or equal to the second left ordinate in the second upper left corner coordinate of the preset detection region, it is determined that the target detection box and the preset detection region have no intersection. That is, the target detection box is completely above the preset detection region, and the target detection box and the preset detection region have no intersection. That is, y2≤b1.

[0077] In some embodiments, if the second left ordinate in the first upper-left corner coordinates of the target detection box is greater than or equal to the second right ordinate in the second lower-right corner coordinates of the preset detection region, it is determined that the target detection box and the preset detection region have no intersection. That is, the target detection box is completely below the preset detection region, and the target detection box and the preset detection region have no intersection. That is, y1≥b2.

[0078] In some embodiments, if none of the above non-intersection conditions are met, it is determined that the target detection box and the preset detection area do not intersect.

[0079] In this implementation, the existence of an intersection between the target detection box and the preset detection area is determined based on the coordinates of the target detection box and the coordinates of the preset detection area, which has high reliability.

[0080] Step 208: Send the normal departure event, reversing return event, and abnormal behavior event to the barrier gate control system so that the barrier gate control system can perform the corresponding barrier gate control operation according to the different events.

[0081] It should be understood that a normal departure event indicates that the target vehicle did not evade payment, an abnormal behavior event indicates that the target vehicle is suspected of evading payment, and a reversing return event indicates that the target vehicle may be suspected of evading payment. Therefore, for different vehicle events, the barrier gate control system needs to perform corresponding barrier gate control operations to prevent the target vehicle from evading payment from the parking lot, thereby reducing the loss of parking lot revenue.

[0082] This application provides a method for detecting parking lot fare evasion. Some gate control systems are prone to problems such as erroneous gate opening and missed gate opening. However, this method can detect vehicles and obtain detection frames by analyzing continuous frames in a video stream, and assign a unique tracking identifier to each vehicle based on a visual tracking algorithm. This generates a tracking list containing the identifier and the complete motion trajectory. The uniqueness of the tracking identifier allows for full tracking of the vehicle's trajectory from entering the preset detection area to leaving. By filtering out target vehicles in the departure direction based on the motion trajectory, state management is only performed on vehicles requiring gate response, significantly reducing the system's unnecessary computational power consumption. In this application embodiment, by judging the vehicle's motion state, different behavioral intentions of the vehicle are accurately distinguished, significantly reducing the probability of erroneous or missed gate opening and improving the accuracy and reliability of gate control.

[0083] Figure 5 This is a schematic flowchart illustrating another parking lot fare evasion detection method provided in the embodiments of this application.

[0084] For example, such as Figure 5 As shown, a method for detecting parking lot fare evasion according to this application is described, which includes the following steps.

[0085] Step 501: The detector sends the normal departure event, the reversing return event, and the abnormal behavior event to the barrier gate control system.

[0086] It should be understood that in practical applications, after the detector detects the behavioral event of the target vehicle, it sends the normal departure event, and / or the abnormal behavior event, and / or the reversing return event to the barrier gate control system so that the barrier gate control system can take appropriate action to prevent the target vehicle from evading payment.

[0087] Step 502: When the barrier gate control system receives a normal vehicle departure event sent by the detector, it controls the barrier gate to end the current transaction process.

[0088] In some embodiments, when the gate control system receives a normal vehicle departure event indicating that the target vehicle has not evaded tolls, the gate is opened and the transaction process ends.

[0089] Step 503: When the barrier gate control system receives a vehicle reversing return event sent by the detector, it controls the barrier gate to cancel the current transaction's passage permission.

[0090] In some embodiments, when the gate control system receives a vehicle reversing back event indicating that the target vehicle is suspected of evading tolls, the gate control system closes the gate and cancels the current transaction's access permission, thereby preventing the target vehicle from evading tolls.

[0091] Step 504: When the barrier gate control system receives an abnormal vehicle behavior event sent by the detector, it controls the barrier gate to stop raising the barrier or terminate the raising of the barrier to ensure that the barrier gate is in the closed state.

[0092] Among them, abnormal vehicle behavior events include the target vehicle following or reversing.

[0093] In some embodiments, when the gate control system receives an abnormal vehicle behavior event indicating that the target vehicle is evading tolls, it controls the gate to stop raising or terminate raising the gate to ensure that the gate is in the closed state, thereby preventing the target vehicle from evading tolls.

[0094] In some embodiments, upon receiving a follow-by event from a target vehicle, the barrier gate is controlled to stop lifting until no follow-by event is detected, at which point the instruction to close the barrier gate is released, allowing the barrier gate to return to normal operation.

[0095] This application provides a method for detecting parking lot fare evasion. The barrier gate control system controls the barrier gate to raise or close based on the vehicle behavior events sent by the detector, thereby preventing the target vehicle from evading payment and effectively solving the problem of preventing vehicles from evading parking lot fees.

[0096] Figure 6 This is a schematic flowchart of a parking lot fare evasion detection method provided in an embodiment of this application.

[0097] For example, such as Figure 6 As shown, taking the detector as the executing entity as an example, this application describes a method for detecting parking lot fare evasion. The method includes the following steps.

[0098] Step 601: Detect consecutive video frames to obtain the detection box of the vehicle.

[0099] It is understood that the relevant description of step 601 can be found in the aforementioned step 201, and will not be repeated here.

[0100] Step 602: Track each detection box and generate a tracking identifier and tracking trajectory.

[0101] It is understood that the relevant description of step 602 can be found in the aforementioned step 202, and will not be repeated here.

[0102] Step 603: Calculate the overall motion direction and instantaneous motion direction vector of the target vehicle based on the tracking trajectory.

[0103] It is understood that the relevant description of step 603 can be found in the aforementioned steps 203-207, and will not be repeated here.

[0104] Step 604: Determine whether the target vehicle has left.

[0105] It is understood that the relevant description of step 604 can be found in the aforementioned step 204, and will not be repeated here.

[0106] Step 605: If the target vehicle has not left, determine whether the target vehicle's movement status is "passing".

[0107] It is understood that the relevant description of step 605 can be found in step 204 above, and will not be repeated here.

[0108] Step 606: If the target vehicle is in a state of motion and is in traffic, determine whether the target vehicle is reversing within the preset detection area.

[0109] It is understood that the relevant description of step 606 can be found in the aforementioned step 206, and will not be repeated here.

[0110] Step 607: If the target vehicle is not reversing within the preset detection area, determine whether the target vehicle is following the vehicle.

[0111] It is understood that the relevant description of step 606 can be found in the aforementioned step 206, and will not be repeated here.

[0112] Step 608: If the target vehicle is not following another vehicle, confirm that the target vehicle is passing normally.

[0113] Step 609: Send the detection event.

[0114] Step 610: Generate a normal departure event.

[0115] Step 611: Determine that the target vehicle's motion state is abnormal.

[0116] Figure 7 This is a schematic diagram of a parking lot fare evasion detection device provided in an embodiment of this application.

[0117] For example, the device 700 includes: The acquisition module 701 is used to perform vehicle detection on multiple consecutive video frames in the video stream and acquire the detection boxes of multiple vehicles in each video frame. The generation module 702 is used to track each vehicle based on a visual tracking algorithm, generate and store a tracking list containing the tracking identifier and motion trajectory of the vehicle. The judgment module 703 is used to determine the movement direction of each vehicle based on the movement trajectory of each vehicle in the tracking list, and to identify the vehicle whose movement direction is to leave the parking lot as the target vehicle. Based on the state machine model, a movement state record is maintained for each target vehicle in the vehicle state list. The movement state includes detected, passing, abnormal and leaving. Abnormal includes reversing and following. Traversal module 704 is used to traverse the motion state of each target vehicle in the vehicle state list; The determination module 705 is used to determine the current movement state of the target vehicle as leaving if the target vehicle is in the process of passing and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, and generate a normal departure event. The target detection box is the detection box of the target vehicle. The determination module 705 is used to determine the current motion state of the target vehicle as reversing and generate a reversing return event if the target vehicle's motion state is reversing and the target detection box does not intersect with the preset detection area. The generation module 706 is used to determine whether the movement state of the target vehicle is following or reversing if the target detection box intersects with the preset detection area; if so, an abnormal behavior event is generated. The sending module 707 is used to send the normal departure event, the reversing return event, and the abnormal behavior event to the barrier gate control system, so that the barrier gate control system can perform corresponding barrier gate control operations according to different events.

[0118] In one possible implementation, the device 700 includes: The judgment module 703 is specifically used to calculate the first average coordinates of the center point coordinates of the detection box of the first consecutive preset frames in the motion trajectory, and use the first average coordinates as the starting reference point coordinates. The judgment module 703 is specifically used to calculate the second average coordinates of the center point coordinates of the detection boxes of multiple consecutive preset frames at the end of the motion trajectory, and use the second average coordinates as the coordinates of the end reference point. The judgment module 703 is specifically used to subtract the coordinates of the ending reference point from the coordinates of the starting reference point to obtain the coordinates of the reference vector; The judgment module 703 is specifically used to determine the direction of the vehicle's movement as the direction of leaving the parking lot when the horizontal coordinate component in the coordinates of the reference vector is greater than a first preset threshold. The judgment module 703 is specifically used to determine the direction of the vehicle's movement as the direction of entering the parking lot when the horizontal coordinate component in the coordinates of the reference vector is less than a first preset threshold.

[0119] In one possible implementation, the device 700 includes: The judgment module 703 is specifically used to determine that the target vehicle has left the preset detection area if the tracking identifier in the vehicle status list appears in the tracking list for a duration less than a first preset duration, and to delete the tracking information of the target vehicle in the vehicle status list.

[0120] In one possible implementation, the device 700 includes: The generation module 706 is used to obtain the horizontal coordinate of the center point of the right frame of the target detection box and the horizontal coordinate of the center point of the left frame of the reference detection box, wherein the reference detection box is the detection box of vehicles other than the target vehicle. The generation module 706 is used to determine that the target vehicle is suspected of following another vehicle if the horizontal coordinate of the center point of the left frame is greater than the horizontal coordinate of the center point of the right frame, and the difference between the horizontal coordinate of the center point of the left frame and the horizontal coordinate of the center point of the right frame is greater than a second preset threshold and less than a third preset threshold. The generation module 706 is used to determine the motion state of the target vehicle as following another vehicle if the number of consecutive video frames of the suspected following vehicle exceeds a fourth preset threshold.

[0121] In one possible implementation, the device 700 includes: The generation module 706 is used to obtain the coordinates of multiple first center points of the target vehicle's trajectory within a second preset time period, and the coordinates of multiple second center points of the target vehicle's trajectory within a third preset time period, wherein the third preset time period is earlier than the second preset time period. The generation module 706 is used to perform a weighted average of the coordinates of the multiple first center points and the multiple second center points to obtain the instantaneous motion direction vector of the target vehicle. The generation module 706 is used to calculate the angle between the instantaneous motion direction vector and the overall motion direction vector of the target vehicle; The generation module 706 is used to determine the motion state of the target vehicle as reversing when the included angle is greater than a fifth preset threshold and the duration of the included angle is greater than a sixth preset threshold.

[0122] In one possible implementation, the device 700 includes: The acquisition module 701 is also used to acquire the first upper left corner coordinates and the first lower right corner coordinates of the target detection box; The acquisition module 701 is also used to acquire the second upper left corner coordinates and the second lower right corner coordinates of the preset detection area; The acquisition module 701 is also used to perform calculations based on the first upper left corner coordinates, the first lower right corner coordinates, the second upper left corner coordinates, and the second lower right corner coordinates to determine whether there is an intersection between the target detection box and the preset detection area.

[0123] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0124] For example, such as Figure 8 As shown, the electronic device 800 includes a memory 801 and a processor 802. The memory 801 stores executable program code 803, and the processor 802 is used to call and execute the executable program code 803 to perform a parking lot fare evasion detection method.

[0125] Furthermore, embodiments of this application also protect an apparatus that may include a memory and a processor, wherein the memory stores executable program code, and the processor is used to call and execute the executable program code to perform a parking lot fare evasion detection method provided in embodiments of this application.

[0126] This embodiment can divide the device into functional modules based on the above method example. For example, each module can correspond to a separate function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0127] It should be understood that the device provided in this embodiment is used to perform the above-described method for detecting parking lot fare evasion, and therefore can achieve the same effect as the above-described implementation method.

[0128] When using integrated units, the device may include a processing module and a storage module. When applied to an electronic device, the processing module can be used to control and manage the operation of the electronic device. The storage module can be used to support the execution of relevant program code by the electronic device.

[0129] The processing module may be a processor or a controller, which can implement or execute various exemplary logic blocks, modules, and circuits shown in conjunction with the disclosure of this application. The processor may also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc., and the storage module may be a memory.

[0130] In addition, the device provided in the embodiments of this application may specifically be a chip, component or module. The chip may include a connected processor and a memory. The memory is used to store instructions. When the processor calls and executes the instructions, the chip can execute a parking lot fare evasion detection method provided in the above embodiments.

[0131] This embodiment also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer, the computer executes the above-described related method steps to implement the parking lot fare evasion detection method provided in the above embodiment.

[0132] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the parking lot fare evasion detection method provided in the above embodiment.

[0133] In this embodiment, the device, computer-readable storage medium, computer program product, or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0134] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0135] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0136] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of parking lot skimming detection, the method comprising: Applied to a detector, the method includes: Vehicle detection is performed on multiple consecutive video frames in the video stream, and the detection bounding boxes of multiple vehicles in each video frame are obtained. For each vehicle, the vehicle is tracked based on a visual tracking algorithm, and a tracking list containing the vehicle's tracking identifier and motion trajectory is generated and stored. Based on the movement trajectory of each vehicle in the tracking list, the movement direction of each vehicle is determined. Vehicles whose movement direction is to leave the parking lot are identified as target vehicles. Based on the state machine model, a movement state record is maintained for each target vehicle in the vehicle state list. The movement state includes detected, passing, abnormal and leaving. Abnormal includes reversing and following. Iterate through the motion state of each target vehicle in the vehicle state list; For any of the target vehicles, if the target vehicle is in motion and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, then the current motion state of the target vehicle is determined to be leaving, and a normal leaving event is generated. The target detection box is the detection box of the target vehicle. If the target vehicle is in a reversing state and the target detection box does not intersect with the preset detection area, then the current movement state of the target vehicle is determined to be reversing back, and a reversing back event is generated. If the target detection box intersects with the preset detection area, it is determined whether the target vehicle's movement state is following or reversing. If so, an abnormal behavior event is generated. The system sends the normal departure event, the reversing return event, and the abnormal behavior event to the barrier gate control system, so that the barrier gate control system can perform corresponding barrier gate control operations according to different events.

2. The method of claim 1, wherein, Determining the direction of movement of each vehicle based on the movement trajectory of each vehicle in the tracking list includes: Calculate the first average coordinates of the center points of the detection boxes in the initial multiple preset frames of the motion trajectory, and use the first average coordinates as the coordinates of the starting reference point. Calculate the second average coordinates of the center points of the detection boxes in the last multiple consecutive preset frames of the motion trajectory, and use the second average coordinates as the coordinates of the end reference point; Subtracting the coordinates of the ending reference point from the coordinates of the starting reference point yields the coordinates of the reference vector. If the horizontal coordinate component of the reference vector is greater than a first preset threshold, the direction of movement of the vehicle is determined to be the direction of leaving the parking lot. If the horizontal coordinate component of the reference vector is less than a first preset threshold, the direction of movement of the vehicle is determined to be the direction of entering the parking lot.

3. The method of claim 1, wherein, The state machine model maintains a motion state record for each target vehicle in the vehicle state list, including: If the tracking identifier in the vehicle status list appears in the tracking list for a duration less than a first preset duration, it is determined that the target vehicle has left the preset detection area, and the tracking information of the target vehicle in the vehicle status list is deleted.

4. The method of claim 1, wherein, If the target detection box intersects with the preset detection area, determining whether the target vehicle's movement state is following or reversing includes: Obtain the x-coordinate of the center point of the right frame of the target detection box and the x-coordinate of the center point of the left frame of the reference detection box, wherein the reference detection box is the detection box of vehicles other than the target vehicle. If the x-coordinate of the center point of the left frame is greater than the x-coordinate of the center point of the right frame, and the difference between the x-coordinate of the center point of the left frame and the x-coordinate of the center point of the right frame is greater than a second preset threshold and less than a third preset threshold, then it is determined that the target vehicle is suspected of following another vehicle. If the number of consecutive video frames of the suspected following vehicle exceeds a fourth preset threshold, then the motion state of the target vehicle is determined to be following vehicle.

5. The method according to claim 1, characterized in that, If the target detection box intersects with the preset detection area, determining whether the target vehicle's movement state is following or reversing includes: The coordinates of multiple first center points of the target vehicle's trajectory within a second preset time period are obtained, as well as the coordinates of multiple second center points of the target vehicle's trajectory within a third preset time period, wherein the third preset time period is earlier than the second preset time period. The instantaneous motion direction vector of the target vehicle is obtained by taking a weighted average of the coordinates of the plurality of first center points and the coordinates of the plurality of second center points. Calculate the angle between the instantaneous motion direction vector and the overall motion direction vector of the target vehicle; If the included angle is greater than a fifth preset threshold and the duration of the included angle is greater than a sixth preset threshold, the motion state of the target vehicle is determined to be reversing.

6. The method according to claim 1, characterized in that, Before determining whether the target vehicle's motion state is following or reversing if the target detection box intersects with the preset detection area, the method further includes: Obtain the coordinates of the first upper left corner and the first lower right corner of the target detection box; Obtain the second upper left corner coordinates and the second lower right corner coordinates of the preset detection area; Calculations are performed based on the first upper left corner coordinates, the first lower right corner coordinates, the second upper left corner coordinates, and the second lower right corner coordinates to determine whether the target detection box intersects with the preset detection area.

7. A method for detecting parking lot fare evasion, characterized in that, Applied to a barrier gate control system, the method includes: When the detector as described in claim 1 sends a normal vehicle departure event, the control gate ends the transaction process. When the detector sends a vehicle reversing return event, the gate is controlled to cancel the current transaction's passage permission; When the detector receives an abnormal vehicle behavior event, it controls the barrier gate to stop raising or terminate raising the barrier gate to ensure that the barrier gate is in the closed state.

8. A device for detecting parking lot fare evasion, characterized in that, The device includes: The acquisition module is used to detect vehicles in multiple consecutive video frames in the video stream and acquire the detection boxes of multiple vehicles in each video frame. The generation module is used to track each vehicle based on a visual tracking algorithm, generate and store a tracking list containing the tracking identifier and motion trajectory of the vehicle. The judgment module is used to determine the movement direction of each vehicle based on the movement trajectory of each vehicle in the tracking list, and to identify the vehicle whose movement direction is to leave the parking lot as the target vehicle. Based on the state machine model, a movement state record is maintained for each target vehicle in the vehicle state list. The movement state includes detected, passing, abnormal and leaving. Abnormal includes reversing and following. The traversal module is used to traverse the motion state of each target vehicle in the vehicle state list; The determination module is used to determine the current movement state of the target vehicle as leaving if, for any target vehicle, the target vehicle's movement state is "passing" and the horizontal coordinate of the center point of the right frame of the target detection box is located to the left of the preset detection area, and generate a normal departure event. The target detection box is the detection box of the target vehicle. The determination module is used to determine the current motion state of the target vehicle as reversing and generate a reversing return event if the target vehicle's motion state is reversing and the target detection box does not intersect with the preset detection area. The generation module is used to determine whether the movement state of the target vehicle is following or reversing if the target detection box intersects with the preset detection area; if so, an abnormal behavior event is generated. The sending module is used to send the normal departure event, the reversing return event, and the abnormal behavior event to the barrier gate control system, so that the barrier gate control system can perform corresponding barrier gate control operations according to different events.

9. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, causing the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores executable program code that, when executed, implements the method as described in any one of claims 1 to 7.