A method and device for detecting misjudgment of a vehicle leaving state on a parking space

By training a vehicle detection model using a YOLOv5s network, misjudgments of vehicles leaving parking spaces are detected and corrected, solving the problem of misjudgments caused by non-perpendicular vehicle occlusion and improving the accuracy of parking space detection.

CN117274888BActive Publication Date: 2025-11-07BEIJING ICETECH SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310986026.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-07
Publication Date
2025-11-07
Estimated Expiration
2043-08-07

AI Technical Summary

Technical Problem

Existing computer vision-based parking space detection methods are prone to misjudging the vehicle's exit status when non-perpendicular vehicles are parked and obscuring perpendicular parking spaces.

Method used

The vehicle detection model is trained using a YOLOv5s network. By detecting the bounding boxes of perpendicular and non-perpendicular vehicles, the vehicle status is determined, the intersection-over-union ratio and loss time are calculated, passing vehicles and stationary vehicles are distinguished, and misjudgments are corrected.

Benefits of technology

It effectively detects and corrects misjudgments of vehicle exit status in parking spaces caused by non-perpendicular parking vehicles obstructing the view, thus improving the accuracy of parking space detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117274888B_ABST
    Figure CN117274888B_ABST
Patent Text Reader

Abstract

The application provides a detection method for misjudgment of a vehicle driving out state on a parking space, which comprises the following steps: obtaining a trained vehicle detection model by using a yolov5s network; obtaining a vertical parking vehicle rectangular frame and a non-vertical parking vehicle rectangular frame by using the trained vehicle detection model for vehicle detection; obtaining a target trajectory of the vertical parking vehicle; judging whether the vertical parking vehicle is lost and whether the non-vertical parking vehicle is a passing vehicle; and judging the state of the vehicle according to whether the vertical parking vehicle is lost, whether the non-vertical parking vehicle is a passing vehicle, an intersection-over-union ratio of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame, and a time and a frame number of loss of the vertical parking vehicle. Compared with the prior art, the application can avoid misjudgment of a vertical parking vehicle on a parking space as a driving out state due to being shielded by a non-vertical parking vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to image processing, intelligent parking, and parking space detection, and particularly relates to a detection method and device for misjudgment of a vehicle driving out state on a parking space. BACKGROUND

[0002] With the rapid development of economy, the number of vehicles is increasing day by day, and the problem of parking difficulty is becoming increasingly prominent. The parking space detection method can effectively solve the problem of limited parking space resources and improve the utilization rate of parking spaces.

[0003] The existing vehicle state detection method based on computer vision for parallel vertical multi-parking spaces will misjudge the vehicle on the vertical multi-parking space as a driving out state if a non-vertical vehicle is parked to block the vehicle on the vertical multi-parking space, thereby causing false reporting of the parking space state.

[0004] In summary, there is an urgent need to provide a detection method for misjudgment of a vehicle driving out state on a parking space to solve the above problems. SUMMARY

[0005] Therefore, the main purpose of the present application is to provide a detection method for misjudgment of a vehicle driving out state on a parking space, which can achieve both precision and speed.

[0006] To achieve the above purpose, according to a first aspect of the present application, a detection method for misjudgment of a vehicle driving out state on a parking space is provided, which comprises:

[0007] In a first step, a yolov5s network is used to input sample images of vertical parking vehicles and non-vertical parking vehicles to obtain a trained vehicle detection model;

[0008] In a second step, a video image of a parking lot is inputted, the trained vehicle detection model is used for vehicle detection, and a vertical parking vehicle rectangular frame and a non-vertical parking vehicle rectangular frame are obtained; according to the vertical parking vehicle rectangular frame in each frame of the video image of the parking lot, a target trajectory of the vertical parking vehicle is obtained;

[0009] In a third step, the video image of the current frame of the parking lot is inputted, whether the vertical parking vehicle is lost or whether the non-vertical parking vehicle is a passing vehicle is judged;

[0010] In a fourth step, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, the intersection over union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame is calculated; if the intersection over union is greater than a first threshold value, the state of the vertical parking vehicle does not change; otherwise, the loss time and the loss frame number of the vertical parking vehicle are counted, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is outputted as a driving out state, otherwise the state of the vertical parking vehicle does not change;

[0011] The fifth step is to output that the perpendicularly parked vehicle is in a stable state if it has not been lost.

[0012] Further, the first step includes: using a YOLOv5s network with an input scale of 448*256 and two output classes, one for perpendicularly parked vehicles and the other for non-perpendicularly parked vehicles; training the YOLOv5s network with sample images of perpendicularly parked vehicles and non-perpendicularly parked vehicles until convergence, thus obtaining a trained vehicle detection model.

[0013] Furthermore, the third step includes:

[0014] The current frame video image input step involves inputting the current frame video image of the parking lot.

[0015] The steps for determining if a vertically parked vehicle is missing are as follows: If no rectangular frame of the vertically parked vehicle is detected, but the target trajectory of the vertically parked vehicle exists, then the vertically parked vehicle is considered missing.

[0016] The steps for determining passing vehicles include obtaining the width W and lower boundary coordinates Y of the rectangle containing non-perpendicular parked vehicles. d Left boundary coordinates X l Right boundary coordinates X r If the following three conditions are met simultaneously: (1) the width W of the non-perpendicular parking vehicle rectangle is greater than λ1*img_Width; (2) the lower boundary coordinate Y of the non-perpendicular parking vehicle rectangle is Y. d >λ2*img_Height; (3) The left boundary coordinate X of the non-perpendicular parking vehicle rectangle. l <λ3*img_Width or the right boundary coordinate X of the non-perpendicular parking vehicle rectangle r If the value is greater than λ4*img_Width, then non-perpendicular parking vehicles are considered to be passing vehicles; where img_Width and img_Height represent the width and height of the video image of the parking lot, respectively.

[0017] Wherein, λ1, λ2, λ3, and λ4 represent the first proportional threshold, the second proportional threshold, the third proportional threshold, and the fourth proportional threshold, respectively.

[0018] Furthermore, the fourth step includes:

[0019] The response steps for passing vehicles are as follows: if a perpendicularly parked vehicle is lost and a non-perpendicularly parked vehicle is a passing vehicle, then proceed to the intersection and comparison calculation and vehicle status judgment steps; if a perpendicularly parked vehicle is lost and a non-perpendicularly parked vehicle is not a passing vehicle, then proceed to the vehicle loss statistics and vehicle status judgment steps.

[0020] The intersection-over-union calculation and vehicle state determination step calculates the intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection-over-union is greater than a first threshold value, it is considered that the vertical parking vehicle is blocked by the passing vehicle, the vertical parking vehicle is marked as blocked, and the vertical parking vehicle state does not change, otherwise the vehicle loss statistics and vehicle state determination step is entered;

[0021] The vehicle loss statistics and vehicle state determination step counts the vertical parking vehicle loss time and loss frame number, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as a driving-out state, otherwise the vertical parking vehicle state does not change.

[0022] According to another aspect of the present application, a vehicle driving-out state misjudgment detection device is provided, which comprises:

[0023] The vehicle detection model training module is configured to input sample images of vertical parking vehicles and non-vertical parking vehicles into a yolov5s network to obtain a trained vehicle detection model;

[0024] The vertical parking vehicle and non-vertical parking vehicle acquisition module is configured to input video images of a parking lot, perform vehicle detection on the video images by using the trained vehicle detection model, and acquire a vertical parking vehicle rectangular frame and a non-vertical parking vehicle rectangular frame; and acquire a target trajectory of the vertical parking vehicle according to the vertical parking vehicle rectangular frame in each frame of the video images of the parking lot;

[0025] The vehicle loss and passing vehicle determination module is configured to input a current frame of video images of the parking lot, determine whether the vertical parking vehicle is lost, and determine whether the non-vertical parking vehicle is a passing vehicle;

[0026] The vehicle loss time vehicle state determination module is configured to, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, calculate the intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection-over-union is greater than a first threshold value, the vertical parking vehicle state does not change; otherwise, count the vertical parking vehicle loss time and loss frame number, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, output the vertical parking vehicle as a driving-out state, otherwise the vertical parking vehicle state does not change;

[0027] The vehicle loss time vehicle state determination module is configured to, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, calculate the intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection-over-union is greater than a first threshold value, the vertical parking vehicle state does not change; otherwise, count the vertical parking vehicle loss time and loss frame number, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, output the vertical parking vehicle as a driving-out state, otherwise the vertical parking vehicle state does not change;

[0028] Further, the vehicle detection model training module comprises: a yolov5s network is used, the network input scale is 448*256, and the output is two categories, one is a vertical parking vehicle, and the other is a non-vertical parking vehicle; in the yolov5s network, a sample image of the vertical parking vehicle and the non-vertical parking vehicle is input for training until convergence, so that a trained vehicle detection model is obtained.

[0029] Further, the vehicle loss and passing vehicle judgment module comprises:

[0030] A current frame video image input module is configured to input a video image of a current frame of a parking lot.

[0031] A vertical parking vehicle loss judgment module is configured to determine that the vertical parking vehicle is lost if a vertical parking vehicle rectangular frame is not detected, but a target trajectory of the vertical parking vehicle exists.

[0032] A passing vehicle judgment module is configured to obtain a width W, a lower boundary coordinate Y d , a left boundary coordinate X l , and a right boundary coordinate X r of a non-vertical parking vehicle rectangular frame; and determine that the non-vertical parking vehicle is a passing vehicle if the following three conditions are met simultaneously: (1) the width W of the non-vertical parking vehicle rectangular frame is greater than λ1*img_Width; (2) the lower boundary coordinate Y d of the non-vertical parking vehicle rectangular frame is greater than λ2*img_Height; and (3) the left boundary coordinate X l of the non-vertical parking vehicle rectangular frame is less than λ3*img_Width or the right boundary coordinate X r of the non-vertical parking vehicle rectangular frame is greater than λ4*img_Width; wherein the img_Width and the img_Height respectively represent the width and the height of the video image of the parking lot.

[0033] The λ1, the λ2, the λ3, and the λ4 respectively represent a first proportion threshold, a second proportion threshold, a third proportion threshold, and a fourth proportion threshold.

[0034] Further, the vehicle state judgment module when the vehicle is lost comprises:

[0035] A passing vehicle response module is configured to enter the CIO calculation and vehicle state judgment module if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle; and enter the vehicle loss statistics and vehicle state judgment module if the vertical parking vehicle is lost and the non-vertical parking vehicle is not a passing vehicle.

[0036] The intersection-over-union calculation and vehicle state judgment module is used for calculating the intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection-over-union is greater than a first threshold value, it is considered that the vertical parking vehicle is blocked by the passing vehicle, the vertical parking vehicle is marked as being blocked, and the vertical parking vehicle state does not change, otherwise, the vehicle loss statistics and vehicle state judgment module is entered;

[0037] The vehicle loss statistics and vehicle state judgment module is used for counting the loss time and the loss frame number of the vertical parking vehicle; if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as the driving-out state, otherwise, the vertical parking vehicle state does not change.

[0038] Compared with the existing vehicle state detection technology, the vehicle driving-out state misjudgment detection method has the advantages that the vehicle driving-out state misjudgment caused by the non-vertical vehicle parking blocking can be effectively detected. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 A flowchart of a vehicle driving-out state misjudgment detection method according to the present application is shown.

[0040] Figure 2 A framework diagram of a vehicle driving-out state misjudgment detection device according to the present application is shown. EMBODIMENTS

[0041] In order for those skilled in the art to further understand the structure, features and other purposes of the present application, the preferred embodiments are described in detail as follows, and the preferred embodiments described are only used to illustrate the technical solutions of the present application, not to limit the present application.

[0042] Figure 1 A flowchart of a vehicle driving-out state misjudgment detection method according to the present application is shown. As shown in the figure, Figure 1 a vehicle driving-out state misjudgment detection method according to the present application includes:

[0043] The first step S1 uses the yolov5s network to input the sample images of the vertical parking vehicle and the non-vertical parking vehicle, and obtains a trained vehicle detection model;

[0044] The second step S2 inputs the video images of the parking lot, uses the trained vehicle detection model for vehicle detection, and obtains the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; according to the vertical parking vehicle rectangular frame in each frame of the video images of the parking lot, the target trajectory of the vertical parking vehicle is obtained;

[0045] In the third step S3, the video image of the current frame of the parking lot is input, and it is determined whether the vertical parking vehicle is lost and whether the non-vertical parking vehicle is a passing vehicle.

[0046] In the fourth step S4, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, the intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame is calculated; if the intersection-over-union is greater than a first threshold value, the state of the vertical parking vehicle is not changed; otherwise, the lost time and the lost frame number of the vertical parking vehicle are counted, and if the lost time is greater than a second threshold value and the lost frame number is greater than a third threshold value, it is output that the vertical parking vehicle is in a driving-out state, otherwise, the state of the vertical parking vehicle is not changed.

[0047] In the fifth step S5, if the vertical parking vehicle is not lost, it is output that the vertical parking vehicle is in a stable parking state.

[0048] Further, the first step S1 comprises: using a yolov5s network, the network input scale is 448*256, and the output is two categories, one is a vertical parking vehicle and the other is a non-vertical parking vehicle; in the yolov5s network, a sample image of the vertical parking vehicle and the non-vertical parking vehicle is input for training until convergence, so as to obtain a trained vehicle detection model.

[0049] The sample images of the vertical parking vehicle and the non-vertical parking vehicle respectively refer to vehicle images that have been marked as vertical parking and non-vertical parking, and the scale of the sample images of the vertical parking vehicle and the non-vertical parking vehicle is 448*256.

[0050] The yolov5s network is an open source network architecture.

[0051] Further, the third step S3 comprises:

[0052] In the current frame video image input step S31, the video image of the current frame of the parking lot is input.

[0053] In the vertical parking vehicle loss determination step S32, if no vertical parking vehicle rectangular frame is detected, but the target trajectory of the vertical parking vehicle exists, it is considered that the vertical parking vehicle is lost.

[0054] In the passing vehicle determination step S33, the width W, the lower boundary coordinate Y d , the left boundary coordinate X l , and the right boundary coordinate X r of the non-vertical parking vehicle rectangular frame are obtained; if the following three conditions are met at the same time: (1) the width W of the non-vertical parking vehicle rectangular frame is greater than λ1*img_Width; (2) the lower boundary coordinate Y dλ2*img_Height; (3) the left boundary coordinate X of the non-vertical parking vehicle rectangular frame l λ3*img_Width or the right boundary coordinate X of the non-vertical parking vehicle rectangular frame r λ4*img_Width, the non-vertical parking vehicle is considered as a passing vehicle; wherein the img_Width and img_Height respectively represent the width and height of the video image of the parking lot.

[0055] wherein the λ1, λ2, λ3, and λ4 respectively represent a first proportion threshold value, a second proportion threshold value, a third proportion threshold value, and a fourth proportion threshold value. Further, the λ1 has a value range of 0.3-0.4, the λ2 has a value range of 0.85-0.92, the λ3 has a value range of 0.02-0.08, and the λ4 has a value range of 0.9-0.98. Exemplarily, the λ1, λ2, λ3, and λ4 are respectively selected as 0.35, 0.9, 0.05, and 0.95.

[0056] Further, the fourth step S4 comprises:

[0057] If the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, the passing vehicle response step S41 is entered, and if the vertical parking vehicle is lost and the non-vertical parking vehicle is not a passing vehicle, the vehicle loss statistics and vehicle state judgment step S43 is entered.

[0058] The intersection-over-union ratio calculation and vehicle state judgment step S42 calculates the intersection-over-union ratio of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame. If the intersection-over-union ratio is greater than a first threshold value, it is considered that the vertical parking vehicle is blocked by the passing vehicle, the vertical parking vehicle is marked as blocked, and the vertical parking vehicle state does not change, otherwise the vehicle loss statistics and vehicle state judgment step S43 is entered.

[0059] The vehicle loss statistics and vehicle state judgment step S43 counts the loss time and loss frame number of the vertical parking vehicle. If the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as a driving-out state, otherwise the vertical parking vehicle state does not change.

[0060] wherein the first threshold value has a value range of 0.35-0.45. Exemplarily, the first threshold value is selected as 0.4. The second threshold value has a value range of 1-20 seconds, and the third threshold value has a value range of 20-100 frames. Exemplarily, the second threshold value is selected as 5 seconds, and the third threshold value is selected as 50 frames.

[0061] Figure 2A framework diagram of a vehicle driving-out state misjudgment detection device according to the present application is given. Figure 2 As shown in the figure, the vehicle driving-out state misjudgment detection device according to the present application comprises:

[0062] A vehicle detection model training module 1 is configured to input sample images of vertical parking vehicles and non-vertical parking vehicles into a yolov5s network to obtain a trained vehicle detection model.

[0063] A vertical parking vehicle and non-vertical parking vehicle obtaining module 2 is configured to input video images of a parking lot, perform vehicle detection on the video images by using the trained vehicle detection model, and obtain a vertical parking vehicle rectangular frame and a non-vertical parking vehicle rectangular frame; and obtain a target trajectory of the vertical parking vehicle according to the vertical parking vehicle rectangular frame in each frame of the video images of the parking lot.

[0064] A vehicle loss and passing vehicle judgment module 3 is configured to input the current frame of the video images of the parking lot, judge whether the vertical parking vehicle is lost, and judge whether the non-vertical parking vehicle is a passing vehicle.

[0065] A vehicle state judgment module 4 for the case of vehicle loss is configured to, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, calculate an intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection-over-union is greater than a first threshold value, the state of the vertical parking vehicle does not change; otherwise, the loss time and the loss frame number of the vertical parking vehicle are counted, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, it is output that the vertical parking vehicle is in a driving-out state, otherwise the state of the vertical parking vehicle does not change.

[0066] A vehicle state judgment module 5 for the case of no vehicle loss is configured to, if the vertical parking vehicle is not lost, output that the vertical parking vehicle is in a stable parking state.

[0067] Further, the vehicle detection model training module 1 comprises: a yolov5s network is adopted, the network input scale is 448*256, and the output is two categories, one is a vertical parking vehicle and the other is a non-vertical parking vehicle; the yolov5s network is trained by inputting sample images of vertical parking vehicles and non-vertical parking vehicles until convergence, and a trained vehicle detection model is obtained.

[0068] The sample images of the vertical parking vehicle and the non-vertical parking vehicle respectively refer to vehicle images that have been labeled as vertical parking and non-vertical parking, and the scale of the sample images of the vertical parking vehicle and the non-vertical parking vehicle is 448*256.

[0069] The yolov5s network is an open-source network architecture.

[0070] Further, the vehicle loss and passing vehicle judging module 3 comprises:

[0071] a current frame video image input module 31, configured to input a video image of a current frame of a parking lot;

[0072] a vertical parking vehicle loss judging module 32, configured to consider that a vertical parking vehicle is lost if no vertical parking vehicle rectangular frame is detected, but a target trajectory of the vertical parking vehicle exists;

[0073] a passing vehicle judging module 33, configured to acquire a width W, a lower boundary coordinate Y d , a left boundary coordinate X l , and a right boundary coordinate X r of a non-vertical parking vehicle rectangular frame; if the following three conditions are met simultaneously: (1) the width W of the non-vertical parking vehicle rectangular frame > λ1*img_Width; (2) the lower boundary coordinate Y d of the non-vertical parking vehicle rectangular frame > λ2*img_Height; (3) the left boundary coordinate X l of the non-vertical parking vehicle rectangular frame < λ3*img_Width or the right boundary coordinate X r of the non-vertical parking vehicle rectangular frame > λ4*img_Width, the non-vertical parking vehicle is considered to be a passing vehicle; wherein the img_Width and the img_Height respectively represent a width and a height of the video image of the parking lot.

[0074] wherein the λ1, the λ2, the λ3, and the λ4 respectively represent a first proportion threshold value, a second proportion threshold value, a third proportion threshold value, and a fourth proportion threshold value. Further, the λ1 has a value range of 0.3-0.4, the λ2 has a value range of 0.85-0.92, the λ3 has a value range of 0.02-0.08, and the λ4 has a value range of 0.9-0.98. Exemplarily, the λ1, the λ2, the λ3, and the λ4 are respectively selected as 0.35, 0.9, 0.05, and 0.95.

[0075] Further, the vehicle state judging module 4 comprises:

[0076] a passing vehicle response module 41, configured to enter a game ratio calculation and vehicle state judging module 42 if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle; and enter a vehicle loss statistics and vehicle state judging module 43 if the vertical parking vehicle is lost and the non-vertical parking vehicle is not a passing vehicle;

[0077] The intersection-over-union calculation and vehicle state judgment module 42 is configured to calculate the intersection-over-union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection-over-union is greater than a first threshold value, it is considered that the vertical parking vehicle is blocked by the passing vehicle, the vertical parking vehicle is marked as being blocked, and the vertical parking vehicle state does not change, otherwise, the vehicle loss statistics and vehicle state judgment module 43 is entered.

[0078] The vehicle loss statistics and vehicle state judgment module 43 is configured to count the vertical parking vehicle loss time and loss frame number, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as a driving-out state, otherwise, the vertical parking vehicle state does not change.

[0079] The first threshold value is selected as 0.4, the second threshold value is selected as 5 seconds, and the third threshold value is selected as 50 frames.

[0080] Compared with the existing vehicle state detection technology, the vehicle driving-out state misjudgment detection method has the advantages that the vehicle driving-out state misjudgment caused by the non-vertical vehicle parking blocking can be effectively detected.

[0081] The above is only a preferred embodiment of the present application, and is not used to limit the protection scope of the present application. It should be understood that the present application is not limited to the implementation described herein, and the purpose of the implementation described herein is to help those skilled in the art to practice the present application. Any person skilled in the art can easily make further improvements and modifications without departing from the spirit and scope of the present application. Therefore, the present application is limited only by the content and scope of the claims, and its intention covers all alternatives and equivalents included in the spirit and scope of the present application defined by the appended claims.

Claims

1. A method for detecting misjudgment of a vehicle leaving state on a parking space, characterized in that, The method comprises: A first step, using a yolov5s network, inputting sample images of vertical parking vehicles and non-vertical parking vehicles, and obtaining a trained vehicle detection model; A second step, inputting video images of a parking lot, using the trained vehicle detection model for vehicle detection, and obtaining vertical parking vehicle rectangular frames and non-vertical parking vehicle rectangular frames; according to the vertical parking vehicle rectangular frames in each frame of the video images of the parking lot, target trajectories of the vertical parking vehicles are obtained; A third step, inputting the video images of the current frame of the parking lot, judging whether the vertical parking vehicle is lost, and judging whether the non-vertical parking vehicle is a passing vehicle; A fourth step, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, calculating the intersection over union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame; if the intersection over union is greater than a first threshold value, the state of the vertical parking vehicle does not change; otherwise, the lost time and the lost frame number of the vertical parking vehicle are counted, and if the lost time is greater than a second threshold value and the lost frame number is greater than a third threshold value, it is output that the vertical parking vehicle is in an exiting state, otherwise the state of the vertical parking vehicle does not change; A fifth step, if the vertical parking vehicle is not lost, it is output that the vertical parking vehicle is in a stable parking state; Further, the third step comprises: A current frame video image input step, inputting the video images of the current frame of the parking lot; A vertical parking vehicle loss judgment step, if no vertical parking vehicle rectangular frame is detected, but the target trajectory of the vertical parking vehicle exists, it is considered that the vertical parking vehicle is lost. The passing vehicle judging step acquires the width W, the lower boundary coordinate Y d , the left boundary coordinate X l , and the right boundary coordinate X r of the non-perpendicular parking vehicle rectangular frame; if the following three conditions are satisfied simultaneously: (1) the width W of the non-perpendicular parking vehicle rectangular frame > λ1*img_Width; (2) the lower boundary coordinate Y d of the non-perpendicular parking vehicle rectangular frame > λ2*img_Height; (3) the left boundary coordinate X l of the non-perpendicular parking vehicle rectangular frame < λ3*img_Width or the right boundary coordinate X r of the non-perpendicular parking vehicle rectangular frame > λ4*img_Width, the non-perpendicular parking vehicle is considered as a passing vehicle; wherein the img_Width and img_Height respectively represent the width and height of the video image of the parking lot. The λ1, λ2, λ3, and λ4 represent a first proportion threshold value, a second proportion threshold value, a third proportion threshold value, and a fourth proportion threshold value, respectively.

2. The method of claim 1, wherein, The first step comprises: using a yolov5s network, the network input scale is 448*256, and the output is two categories, one is a vertical parking vehicle, and the other is a non-vertical parking vehicle; in the yolov5s network, sample images of vertical parking vehicles and non-vertical parking vehicles are input respectively for training until convergence, and a trained vehicle detection model is obtained.

3. The method of claim 1, wherein, The λ1 is in a range of 0.3-0.4, the λ2 is in a range of 0.85-0.92, the λ3 is in a range of 0.02-0.08, and the λ4 is in a range of 0.9-0.

98.

4. The method of claim 1, wherein, The fourth step comprises: A passing vehicle response step, if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, it is transferred to the intersection over union calculation and vehicle state judgment step; if the vertical parking vehicle is lost and the non-vertical parking vehicle is not a passing vehicle, it is transferred to the vehicle loss counting and vehicle state judgment step; An intersection over union calculation and vehicle state judgment step, the intersection over union of the vertical parking vehicle rectangular frame and the non-vertical parking vehicle rectangular frame is calculated; if the intersection over union is greater than a first threshold value, it is considered that the vertical parking vehicle is blocked by a passing vehicle, the vertical parking vehicle is marked as being blocked, and the state of the vertical parking vehicle does not change, otherwise it is transferred to the vehicle loss counting and vehicle state judgment step; The vehicle loss statistics and vehicle state judgment step is used for counting the loss time and loss frame number of the vertical parking vehicle, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as a driving-out state, otherwise the state of the vertical parking vehicle is not changed.

5. The method of claim 4, wherein, The first threshold value ranges from 0.35 to 0.45, the second threshold value ranges from 1 to 20 seconds, and the third threshold value ranges from 20 to 100 frames.

6. A detection device for misjudging the state of a vehicle leaving a parking space, characterized in that, The device comprises: The vehicle detection model training module is used for inputting sample images of the vertical parking vehicle and the non-vertical parking vehicle by using a yolov5s network, and obtaining a trained vehicle detection model. The vertical parking vehicle and non-vertical parking vehicle obtaining module is used for inputting video images of a parking lot, performing vehicle detection by using the trained vehicle detection model, and obtaining a vertical parking vehicle rectangular frame and a non-vertical parking vehicle rectangular frame. The vehicle loss and passing vehicle judgment module is used for inputting the video images of the current frame of the parking lot, judging whether the vertical parking vehicle is lost, and judging whether the non-vertical parking vehicle is a passing vehicle. The vehicle loss time and loss frame number of the vertical parking vehicle are counted, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as a driving-out state, otherwise the state of the vertical parking vehicle is not changed. The vehicle loss and passing vehicle judgment module comprises: The current frame video image input module is used for inputting the video images of the current frame of the parking lot. The vertical parking vehicle loss judgment module is used for judging that the vertical parking vehicle is lost if the vertical parking vehicle rectangular frame is not detected but the target trajectory of the vertical parking vehicle exists. The λ1, λ2, λ3 and λ4 represent a first proportion threshold value, a second proportion threshold value, a third proportion threshold value and a fourth proportion threshold value respectively. The passing vehicle detection module is used to obtain the width W and lower boundary coordinate Y of the rectangle containing non-perpendicular parked vehicles. d Left boundary coordinates X l Right boundary coordinates X r If the following three conditions are met simultaneously: (1) the width W of the non-perpendicular parking vehicle rectangle is greater than λ1*img_Width; (2) the lower boundary coordinate Y of the non-perpendicular parking vehicle rectangle is Y. d >λ2*img_Height;(3) The left boundary coordinate X of the non-perpendicular parking vehicle rectangle l <λ3*img_Width or the right boundary coordinate X of the non-perpendicular parking vehicle rectangle r If the value is greater than λ4*img_Width, then non-perpendicular parking vehicles are considered to be passing vehicles; where img_Width and img_Height represent the width and height of the video image of the parking lot, respectively. The vehicle detection model training module comprises a yolov5s network, the network input scale is 448*256, and the output is two categories, one is the vertical parking vehicle and the other is the non-vertical parking vehicle.

7. The apparatus of claim 6, wherein, The vehicle loss time and loss frame number of the vertical parking vehicle are counted, and if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertical parking vehicle is output as a driving-out state, otherwise the state of the vertical parking vehicle is not changed.

8. The apparatus of claim 6, wherein, The passing vehicle response module is used for entering the intersection and union ratio calculation and vehicle state judgment module if the vertical parking vehicle is lost and the non-vertical parking vehicle is a passing vehicle, and entering the vehicle loss statistics and vehicle state judgment module if the vertical parking vehicle is lost and the non-vertical parking vehicle is not a passing vehicle. ​ The intersection-over-union calculation and vehicle state judgment module is configured to calculate the intersection-over-union of the rectangular frame of the vertically parked vehicle and the rectangular frame of the non-vertically parked vehicle; if the intersection-over-union is greater than a first threshold value, it is considered that the vertically parked vehicle is blocked by the passing vehicle, the vertically parked vehicle is marked as being blocked, and the state of the vertically parked vehicle does not change, otherwise, the vehicle loss statistics and vehicle state judgment module is entered; The vehicle loss statistics and vehicle state judgment module is configured to count the loss time and the loss frame number of the vertically parked vehicle; if the loss time is greater than a second threshold value and the loss frame number is greater than a third threshold value, the vertically parked vehicle is output as a driving-out state, otherwise, the state of the vertically parked vehicle does not change.

Citation Information

Patent Citations

  • Parking space and vehicle state monitoring method

    CN116343106A

  • Parking space-based heading adjustment method suitable for ultrasonic perpendicular parking spaces

    WO2021072919A1