CN-115797906-B - Vehicle parking state detection method and device, electronic equipment and storage medium
Abstract
The invention provides a vehicle parking state detection method, a device, electronic equipment and a storage medium, and relates to the field of vehicle detection, wherein the method comprises the steps of acquiring a parking space image and a pre-calibrated parking space area in the parking space image in real time, and determining a target detection mode according to the direction of a specified parking space frame line in the parking space area; the detection mode comprises an oblique side detection mode and a same side detection mode, when the vehicle detected from the parking space image is determined to be stationary, a detection frame corresponding to the vehicle is extracted, positions of a plurality of appointed chassis key points on the vehicle in the parking space image are sequentially determined, when the target detection mode is the oblique side detection mode, the chassis key points and the parking space areas are used for determining a target parking space area and a parking state of the vehicle for parking, when the target detection mode is the same side detection mode, the chassis key points, the detection frame and the parking space areas are used for determining the target parking space area and the parking state of the vehicle for parking, and the parking state of the vehicle can be adaptively detected according to the parking space orientation.
Inventors
- ZHANG WENHUI
- MA YAO
- Duan Peicong
Assignees
- 济南博观智能科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221031
Claims (10)
- 1. A vehicle parking state detection method, characterized by comprising: Acquiring a parking space image and a pre-calibrated parking space area in the parking space image in real time, and determining a target detection mode according to the direction of a specified parking space frame line in the parking space area, wherein the detection mode comprises an oblique side detection mode and a same side detection mode; When the vehicle detected from the parking space image is determined to be stationary, extracting a detection frame corresponding to the vehicle, and sequentially determining the positions of a plurality of appointed chassis key points on the vehicle in the parking space image; when the target detection mode is the oblique side detection mode, determining a target parking space area and a parking state of the vehicle parking by utilizing the chassis key points and the parking space areas; And when the target detection mode is the same-side detection mode, determining a target parking space area and a parking state of the vehicle parking by utilizing the chassis key points, the detection frame and the parking space area.
- 2. The vehicle parking state detection method according to claim 1, wherein the determining the target detection mode from the orientation of the specified space frame line in the space region includes: acquiring a parking space frame line parallel to the normal parking direction of the vehicle from the parking space area and setting the parking space frame line as the appointed parking space frame line; Determining an included angle between the frame line of the appointed parking space and a vertical central axis line of the parking space image; And acquiring an included angle threshold interval corresponding to each detection mode, and determining the target detection mode according to a target included angle threshold interval in which the included angle falls.
- 3. The vehicle parking state detection method according to claim 1, wherein the determining the target parking space area and the parking state for parking the vehicle using the chassis key point and each of the parking space areas includes: determining an overlapping area of a chassis key point frame established by the chassis key point in each parking space area, and calculating a chassis projection area ratio of the chassis key point frame in each parking space area by utilizing the area of the overlapping area and the area of the parking space area where the overlapping area is positioned; when only one non-zero value exists in each chassis projection area ratio, and the non-zero target chassis projection area ratio is larger than a first preset threshold value, determining that the vehicle is parked in a target parking space area corresponding to the target chassis projection area ratio and is not in a trans-position state; and when a plurality of non-zero values exist in the chassis projection area ratios, determining that the vehicle is parked in the target parking space area corresponding to the largest chassis projection area ratio, and in the trans-position state.
- 4. The vehicle parking state detection method according to claim 1, characterized by further comprising, after extracting a detection frame corresponding to the vehicle and sequentially determining positions of a plurality of specified chassis key points on the vehicle in the parking space image: and determining the parking orientation of the vehicle in the target parking space area by using the position coordinates of the chassis key points and a preset orientation judging rule.
- 5. The vehicle parking state detection method according to any one of claims 1 to 4, wherein when the target detection mode is the ipsilateral detection mode, determining a target parking space area and a parking state of the vehicle parking using the chassis key point, the detection frame and the parking space area includes: determining an overlapping area of a chassis key point frame established by the chassis key point in each parking space area, and calculating a chassis projection area ratio of the chassis key point frame in each parking space area by utilizing the area of the overlapping area and the area of the parking space area where the overlapping area is positioned; setting a parking space area where the lower boundary of the detection frame is positioned as an initial parking space area, and determining the projection area ratio of the detection frame between the overlapping area of the detection frame in the initial parking space area and the area of the initial parking space area; When the ratio of the projection areas of the detection frames is larger than a third preset threshold, setting the initial parking space area as the target parking space area; When the detection frame projection area ratio is determined to be larger than a fourth preset threshold value and smaller than or equal to the third preset threshold value, judging whether the chassis projection area ratio of the chassis key point frame in the initial parking space area is larger than the chassis projection area ratio of the chassis key point frame in other parking space areas or not, wherein the fourth preset threshold value is larger than 0; If the vehicle is larger than the initial parking space area, setting the initial parking space area as a target parking space area; if not, setting a parking space area corresponding to the largest chassis projection area ratio as the target parking space area; When the ratio of the projection areas of the detection frames is smaller than or equal to the fourth preset threshold value, determining that the vehicle is not parked in the parking space area; and determining whether the vehicle is in a straddling state or not by utilizing the detection frame and the target parking space area.
- 6. The vehicle parking state detection method according to claim 5, wherein the determining whether the vehicle is in a straddle state using the detection frame and the target parking space region includes: determining the distance between the lower frame wire of the detection frame and the lower frame wire of the target parking space area; acquiring the height of the target parking space area in the parking space image, and judging whether the ratio of the distance to the height is larger than a fifth preset threshold value or not; If yes, determining that the vehicle is in the crossing state, and determining that a parking space area corresponding to the target chassis projection area ratio is a parking space area crossed by the vehicle when determining that the target chassis projection area ratio which is larger than a sixth preset threshold exists in the chassis projection area ratio corresponding to the chassis key point frame; if not, determining that the vehicle is not in the trans-position state.
- 7. The vehicle parking state detection method according to claim 5, characterized by further comprising, before determining the target parking space area and the parking state for parking the vehicle using the chassis keypoints, the detection frame, and the parking space area: acquiring a parking space panoramic image acquired when the contact of the vehicle and an early warning line around the parking space area is detected, wherein the early warning line is obtained by expanding a preset distance outside the parking space area; the frame difference method is utilized to perform difference on the parking space image and the parking space panoramic image to obtain a vehicle foreground image, and the vehicle foreground image is processed to obtain a vehicle contour mask image; Determining a minimum circumscribed rectangle corresponding to the vehicle outline mask map, and determining the size of an included angle between the minimum circumscribed rectangle and the detection frame; Determining a chassis central axis of the vehicle by utilizing the chassis key points, and determining an inclination angle of the vehicle in the target parking space area according to an included angle between the chassis central axis and the designated parking space frame line; Judging whether the difference value between the included angle and the inclined angle is smaller than a second preset threshold value or not; If yes, determining a target parking space area and a parking state of the vehicle on the basis of the oblique side detection mode; if not, the method enters the step of determining a target parking space area and a parking state of the vehicle by utilizing the chassis key points, the detection frame and the parking space area.
- 8. A vehicle parking state detection apparatus characterized by comprising: The detection mode selection module is used for acquiring a parking space image and a pre-calibrated parking space area in the parking space image in real time, and determining a target detection mode according to the direction of a specified parking space frame line in the parking space area, wherein the detection mode comprises an oblique side detection mode and a same side detection mode; The detection data extraction module is used for extracting a detection frame corresponding to a vehicle when the vehicle detected from the parking space image is determined to be stationary, and sequentially determining the positions of a plurality of specified chassis key points on the vehicle in the parking space image; The oblique side detection module is used for determining a target parking space area and a parking state of the vehicle parking by utilizing the chassis key points and the parking space areas when the target detection mode is the oblique side detection mode; And the same-side detection module is used for determining a target parking space area and a parking state of the vehicle parking by utilizing the chassis key points, the detection frame and the parking space area when the target detection mode is the same-side detection mode.
- 9. An electronic device, comprising: A memory for storing a computer program; Processor for implementing the vehicle parking state detection method according to any one of claims 1 to 7 when executing the computer program.
- 10. A storage medium having stored therein computer executable instructions which, when loaded and executed by a processor, implement the vehicle parking status detection method of any one of claims 1 to 7.
Description
Vehicle parking state detection method and device, electronic equipment and storage medium Technical Field The present invention relates to the field of vehicle detection, and in particular, to a method and apparatus for detecting a parking state of a vehicle, an electronic device, and a storage medium. Background In order to improve management efficiency, more and more parking lots introduce video monitoring and machine learning technologies to monitor the parking states of vehicles in real time. In the related art, conditions suitable for a vehicle parking state detection scheme are harsh, are difficult to adapt to complex video acquisition equipment installation conditions, and are also difficult to adapt to complex and changeable vehicle parking modes in a parking lot, so that the existing scheme is difficult to obtain a better vehicle parking state detection result. Disclosure of Invention The invention aims to provide a vehicle parking state detection method, a device, electronic equipment and a storage medium, which can carry out self-adaptive detection on the parking state of a vehicle according to the parking space orientation, and further can effectively adapt to complex and changeable vehicle parking modes in a parking lot. In order to solve the above technical problems, the present invention provides a vehicle parking state detection method, including: Acquiring a parking space image and a pre-calibrated parking space area in the parking space image in real time, and determining a target detection mode according to the direction of a specified parking space frame line in the parking space area, wherein the detection mode comprises an oblique side detection mode and a same side detection mode; When the vehicle detected from the parking space image is determined to be stationary, extracting a detection frame corresponding to the vehicle, and sequentially determining the positions of a plurality of appointed chassis key points on the vehicle in the parking space image; when the target detection mode is the oblique side detection mode, determining a target parking space area and a parking state of the vehicle parking by utilizing the chassis key points and the parking space areas; And when the target detection mode is the same-side detection mode, determining a target parking space area and a parking state of the vehicle parking by utilizing the chassis key points, the detection frame and the parking space area. Optionally, the determining the target detection mode according to the direction of the specified parking space frame line in the parking space area includes: acquiring a parking space frame line parallel to the normal parking direction of the vehicle from the parking space area and setting the parking space frame line as the appointed parking space frame line; Determining an included angle between the frame line of the appointed parking space and a vertical central axis line of the parking space image; And acquiring an included angle threshold interval corresponding to each detection mode, and determining the target detection mode according to a target included angle threshold interval in which the included angle falls. Optionally, the determining the target parking space area and the parking state of the vehicle by using the chassis key point and each parking space area includes: determining an overlapping area of a chassis key point frame established by the chassis key point in each parking space area, and calculating a chassis projection area ratio of the chassis key point frame in each parking space area by utilizing the area of the overlapping area and the area of the parking space area where the overlapping area is positioned; when only one non-zero value exists in each chassis projection area ratio, and the non-zero target chassis projection area ratio is larger than a first preset threshold value, determining that the vehicle is parked in a target parking space area corresponding to the target chassis projection area ratio and is not in a trans-position state; and when a plurality of non-zero values exist in the chassis projection area ratios, determining that the vehicle is parked in the target parking space area corresponding to the largest chassis projection area ratio, and in the trans-position state. Optionally, after extracting a detection frame corresponding to the vehicle and sequentially determining positions of a plurality of specified chassis key points on the vehicle in the parking space image, the method further includes: and determining the parking orientation of the vehicle in the target parking space area by using the position coordinates of the chassis key points and a preset orientation judging rule. Optionally, when the target detection mode is the same-side detection mode, determining a target parking space area and a parking state of the vehicle parking by using the chassis key point, the detection frame and the parking space area includes: determining an overla