A method, apparatus, electronic device, and storage medium for detecting vehicle parking status.
By adaptively selecting the detection mode and combining multi-information fusion of chassis key points and detection boxes, the accuracy problem of vehicle parking status detection in complex environments in existing technologies has been solved, and efficient vehicle parking status recognition in different scenarios has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN BOGUAN INTELLIGENT TECH CO LTD
- Filing Date
- 2022-10-31
- Publication Date
- 2026-05-05
AI Technical Summary
Existing vehicle parking status detection solutions are ill-suited to the complex and ever-changing parking lot environment, resulting in poor detection performance.
By acquiring pre-labeled parking space areas in real-time parking space images, the detection mode is adaptively selected based on the orientation of the parking space frame lines, and multi-information fusion is performed by combining chassis key points and detection frames in different scenarios to determine the parking status of the vehicle.
It improves the accuracy and adaptability of vehicle parking status detection, enabling accurate identification of vehicle parking location and status in different scenarios.
Smart Images

Figure CN115797906B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle inspection, and in particular to a method, apparatus, electronic device, and storage medium for detecting the parking status of a vehicle. Background Technology
[0002] To improve management efficiency, an increasing number of parking lots are introducing video surveillance and machine learning technologies to monitor vehicle parking status in real time. However, existing vehicle parking status detection solutions face stringent conditions, making them difficult to adapt to the complex installation requirements of video acquisition equipment and the varied parking patterns in parking lots. Consequently, existing solutions struggle to achieve satisfactory vehicle parking status detection results. Summary of the Invention
[0003] The purpose of this invention is to provide a vehicle parking status detection method, device, electronic device and storage medium, which can adaptively detect the parking status of a vehicle according to the orientation of the parking space, thereby effectively adapting to the complex and ever-changing vehicle parking methods in parking lots.
[0004] To solve the above technical problems, the present invention provides a method for detecting vehicle parking status, comprising:
[0005] Real-time acquisition of parking space images and pre-labeled parking space areas within the parking space images; determination of target detection mode based on the orientation of the specified parking space frame lines within the parking space area; detection modes include oblique detection mode and same-side detection mode;
[0006] When it is determined that a vehicle detected from the parking space image has come to a complete stop, the detection box corresponding to the vehicle is extracted, and the positions of multiple specified chassis key points on the vehicle in the parking space image are determined sequentially.
[0007] When the target detection mode is the oblique detection mode, the target parking space area and parking status of the vehicle are determined by using the chassis key points and each parking space area;
[0008] When the target detection mode is the same-side detection mode, the target parking space area and parking status of the vehicle are determined by using the chassis key points, the detection frame and the parking space area.
[0009] Optionally, determining the target detection mode based on the orientation of the specified parking space frame line in the parking space area includes:
[0010] Obtain a parking space frame line parallel to the normal parking direction of the vehicle from the parking space area and set it as the designated parking space frame line;
[0011] Determine the angle between the designated parking space frame line and the vertical centerline of the parking space image;
[0012] Obtain the included angle threshold range corresponding to each of the detection modes, and determine the target detection mode based on the target included angle threshold range into which the included angle falls.
[0013] Optionally, determining the target parking space area and parking status of the vehicle using the chassis key points and each of the parking space areas includes:
[0014] Determine the overlapping area of the chassis key point frame established by the chassis key points in each of the parking space areas, and use the area of the overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each of the parking space areas.
[0015] If it is determined that there is only one non-zero value among the ratios of the projected areas of the chassis, and the non-zero target chassis projected area ratio is greater than the first preset threshold, then it is determined that the vehicle is parked in the target parking space area corresponding to the target chassis projected area ratio, and is not in a cross-space state.
[0016] If it is determined that there are multiple non-zero values among the chassis projection area ratios, then the vehicle is determined to be parked in the target parking space area corresponding to the largest chassis projection area ratio, and is in the cross-space state.
[0017] Optionally, after extracting the detection bounding box corresponding to the vehicle and sequentially determining the positions of multiple specified chassis key points on the vehicle in the parking space image, the method further includes:
[0018] Using the position coordinates of each of the key points of the chassis and the preset orientation determination rules, the parking orientation of the vehicle in the target parking space area is determined.
[0019] Optionally, when the target detection mode is the same-side detection mode, determining the target parking space area and parking status of the vehicle using the chassis key points, the detection frame, and the parking space area includes:
[0020] Determine the overlapping area of the chassis key point frame established by the chassis key points in each of the parking space areas, and use the area of the overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each of the parking space areas.
[0021] Set the parking space area where the lower boundary of the detection frame is located as the initial parking space area, and determine the ratio of the overlapping area of the detection frame in the initial parking space area to the area of the initial parking space area.
[0022] When it is determined that the ratio of the projected area of the detection frame is greater than the third preset threshold, the initial parking space area is set as the target parking space area;
[0023] When it is determined that the ratio of the projected area of the detection frame is greater than the fourth preset threshold and less than or equal to the third preset threshold, it is then determined whether the ratio of the chassis projected area of the chassis key point frame in the initial parking space area is greater than its ratio of the chassis projected area in other parking space areas; the fourth preset threshold is greater than 0.
[0024] If the value is greater than the target parking space area, then the initial parking space area is set as the target parking space area.
[0025] If it is not greater than, then the parking space area corresponding to the largest chassis projection area ratio is set as the target parking space area;
[0026] When it is determined that the ratio of the projected area of the detection frame is less than or equal to the fourth preset threshold, it is determined that the vehicle is not parked in the parking space area;
[0027] The detection frame and the target parking space area are used to determine whether the vehicle is in a cross-space state.
[0028] Optionally, determining whether the vehicle is in a straddled parking space state using the detection frame and the target parking space area includes:
[0029] Determine the distance between the lower frame line of the detection frame and the lower frame line of the target parking space area;
[0030] Obtain the height of the target parking space area in the parking space image, and determine whether the ratio between the distance and the height is greater than a fifth preset threshold.
[0031] If so, the vehicle is determined to be in the straddle state, and when there is a target chassis projection area ratio greater than the sixth preset threshold in the chassis projection area ratio corresponding to the chassis key point frame, the parking space area corresponding to the target chassis projection area ratio is determined to be the parking space area crossed by the vehicle.
[0032] If not, then it is determined that the vehicle is not in the straddle position state.
[0033] Optionally, determining the target parking space area and parking status of the vehicle using the chassis key points, the detection frame, and the parking space area includes:
[0034] Acquire a panoramic image of the parking space when it is detected that the vehicle is in contact with the warning line around the parking space area; the warning line is obtained by extending the parking space area outward by a preset distance.
[0035] The vehicle foreground image is obtained by subtracting the parking space image and the parking space panoramic image using the frame difference method, and the vehicle foreground image is processed to obtain the vehicle contour mask image.
[0036] Determine the minimum bounding rectangle corresponding to the vehicle contour mask, and determine the angle between the minimum bounding rectangle and the detection frame;
[0037] The chassis center axis of the vehicle is determined using the key points of the chassis, and the tilt angle of the vehicle in the target parking space area is determined based on the angle between the chassis center axis and the designated parking space frame line.
[0038] Determine whether the difference between the included angle and the tilt angle is less than a second preset threshold;
[0039] If so, the target parking space area and parking status of the vehicle are determined based on the oblique detection mode;
[0040] If not, proceed to the step of determining the target parking space area and parking status of the vehicle using the chassis key points, the detection frame, and the parking space area.
[0041] The present invention also provides a vehicle parking status detection device, comprising:
[0042] The detection mode selection module is used to acquire parking space images and pre-marked parking space areas in the parking space images in real time, and determine the target detection mode according to the orientation of the specified parking space frame line in the parking space area; the detection modes include oblique detection mode and same-side detection mode;
[0043] The detection data extraction module is used to extract the detection box corresponding to the vehicle when it is determined that the vehicle detected from the parking space image has stopped, and to sequentially determine the positions of multiple specified chassis key points on the vehicle in the parking space image.
[0044] The oblique detection module is used to determine the target parking space area and parking status of the vehicle by using the chassis key points and each parking space area when the target detection mode is the oblique detection mode.
[0045] The same-side detection module is used to determine the target parking space area and parking status of the vehicle by using the chassis key points, the detection frame and the parking space area when the target detection mode is the same-side detection mode.
[0046] The present invention also provides an electronic device, comprising:
[0047] Memory, used to store computer programs;
[0048] A processor is used to implement the vehicle parking status detection method as described above when executing the computer program.
[0049] The present invention also provides a storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the vehicle parking status detection method described above.
[0050] This invention provides a method for detecting vehicle parking status, comprising: acquiring a parking space image and a pre-marked parking space area in the parking space image in real time, and determining a target detection mode based on the orientation of a specified parking space frame line in the parking space area; the detection mode includes a side-by-side detection mode and a same-side detection mode; when it is determined that a vehicle detected from the parking space image is stationary, extracting the detection frame corresponding to the vehicle, and sequentially determining the positions of multiple specified chassis key points on the vehicle in the parking space image; when the target detection mode is the side-by-side detection mode, determining the target parking space area and parking status of the vehicle using the chassis key points and each of the parking space areas; when the target detection mode is the same-side detection mode, determining the target parking space area and parking status of the vehicle using the chassis key points, the detection frame, and the parking space area.
[0051] As can be seen, before detecting the target parking space area and parking status of the vehicle, the present invention first acquires a pre-marked parking space area in the parking space image and adaptively determines the target detection mode based on the orientation of the specified parking space frame line in the parking space area. This mode includes an oblique detection mode and a same-side detection mode. That is, the present invention can adaptively determine whether the scene in which the parking space area is located is an oblique scene or a same-side scene, and then automatically adopt the most appropriate method to detect the parking status of the vehicle. Subsequently, when the present invention determines that the vehicle has stopped detected from the parking space image, it can extract the detection box corresponding to the vehicle and sequentially determine the positions of multiple specified chassis key points on the vehicle in the parking space image. In the oblique scene, the vehicle is not easily obscured, and the position of the chassis key points can better reflect the relationship between the vehicle and the parking space area. The relative position of the vehicle can be used to improve the accuracy of vehicle parking position and status detection. In same-side scenarios where the vehicle is easily obscured, combining chassis key points and detection frames for vehicle parking status detection can effectively avoid the unreliability caused by using single position information, thus also improving the accuracy of vehicle parking position and status detection. Furthermore, when the target detection mode is determined to be a side-view detection mode, this invention will use chassis key points and each parking space area to determine the target parking space area and parking status of the vehicle. When the target detection mode is determined to be a same-side detection mode, this invention will use chassis key points, detection frames, and parking space areas to determine the target parking space area and parking status of the vehicle. This allows for multi-information fusion to ensure the accuracy of vehicle parking status detection in various scenarios. This invention also provides a vehicle parking status detection device, electronic device, and storage medium, which have the above-mentioned beneficial effects. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0053] Figure 1 A flowchart of a vehicle parking status detection method provided in an embodiment of the present invention;
[0054] Figure 2 A schematic diagram of an oblique scene provided in an embodiment of the present invention;
[0055] Figure 3 This is a schematic diagram illustrating a vehicle parking behavior determination method provided in an embodiment of the present invention.
[0056] Figure 4 This is a schematic diagram illustrating the relative positional relationship between the vehicle and chassis and the parking space in a scenario on the same side, provided by an embodiment of the present invention.
[0057] Figure 5 A schematic diagram of a diagonal parking scenario on the same side provided by an embodiment of the present invention;
[0058] Figure 6 A schematic diagram of a vehicle contour mask provided in an embodiment of the present invention;
[0059] Figure 7 A schematic diagram of an early warning line provided in an embodiment of the present invention;
[0060] Figure 8 This is a structural block diagram of a vehicle parking status detection device provided in an embodiment of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] To improve management efficiency, an increasing number of parking lots are introducing video surveillance and machine learning technologies to monitor vehicle parking status in real time. However, existing vehicle parking status detection solutions face stringent conditions, making them difficult to adapt to the complex installation requirements of video acquisition equipment and the varied parking patterns in parking lots. Consequently, existing solutions often fail to achieve satisfactory vehicle parking status detection results. Therefore, this invention provides a vehicle parking status detection method that adaptively detects vehicle parking status based on the orientation of the parking space, effectively adapting to the complex and varied parking patterns in parking lots. Please refer to [reference needed]. Figure 1 , Figure 1 A flowchart of a vehicle parking status detection method provided in an embodiment of the present invention is shown. The method may include:
[0063] S101. Real-time acquisition of parking space images and pre-labeled parking space areas in the parking space images, and determination of target detection mode based on the orientation of the specified parking space frame line in the parking space area; the detection modes include oblique detection mode and same-side detection mode.
[0064] Due to factors such as installation environment and parking space layout, parking space areas may face different directions in the parking space image. The detection challenges differ depending on the orientation of the parking space area. For example, when the vehicle area is tilted relative to the image acquisition direction of the image acquisition device (i.e., the parking space area is in an oblique scene), determining the vehicle's parking status based on the vehicle detection bounding box is unreliable. Conversely, when the vehicle area is roughly parallel to the image acquisition direction of the image acquisition device (i.e., the parking space area is in a same-side scene), the vehicle is easily obscured, which can interfere with the determination of its parking status. However, existing vehicle parking status detection methods have high requirements for the tilt relationship between the vehicle area's orientation and the image acquisition direction of the image acquisition device, making it difficult to adaptively adjust the detection method according to the vehicle area's orientation. This can lead to inconvenience in installing the image acquisition device and negatively impact the effectiveness of vehicle parking status detection. Therefore, before detecting the parking status of a vehicle, this embodiment of the invention first extracts the pre-marked parking space area from the parking space image and determines the orientation of the designated parking space frame line (i.e., any one of the four frame lines of the parking space area) in that area. The orientation of the parking space frame line reflects the orientation of the parking space area. Subsequently, this invention adaptively selects the corresponding target detection mode according to the orientation of the extracted parking space frame line, so as to use the most suitable detection method to detect the parking status of the vehicle, thereby significantly improving the detection effect of the above detection.
[0065] It should be noted that the embodiments of the present invention do not limit the labeling method of the parking space area; only the outlines around the parking space area need to be manually labeled. The embodiments of the present invention also do not limit which parking space outline is used as the designated parking space outline; it can be selected according to actual application needs. Specifically, considering that the orientation of the parking space area is parallel to the normal parking orientation of the vehicle in that area, selecting a parking space outline parallel to the normal parking orientation of the vehicle area for parking space orientation determination is more effective. Therefore, the designated parking space outline can be any parking space outline parallel to the normal parking orientation of the vehicle in the parking space area. Furthermore, it is understood that the relationship between the angle between the designated parking space outline and a baseline in the parking space image and a preset threshold, or the relationship between the angle and a preset threshold range, should be used as the standard for distinguishing between oblique and same-side scenes. The embodiments of the present invention do not limit the specific baseline; for example, it can be the vertical centerline of the parking space image, or other straight lines, which can be set according to actual application needs.
[0066] In one possible scenario, determining the target detection mode based on the orientation of the designated parking space frame line within the parking space area could include:
[0067] Step 11: Obtain the parking space frame line parallel to the normal parking direction of the vehicle from the parking space area and set it as the specified parking space frame line;
[0068] Step 12: Determine the angle between the designated parking space frame line and the vertical centerline of the parking space image;
[0069] Step 13: Obtain the included angle threshold range corresponding to each detection mode, and determine the target detection mode based on the target included angle threshold range into which the included angle falls.
[0070] It should be noted that the embodiments of the present invention do not limit the specific target angle threshold range. For example, when the target detection mode includes oblique detection mode and same-side detection mode, the threshold range corresponding to the oblique detection mode can be 15° to 60°, while the range corresponding to the same-side detection mode can be 0° to 15°. Of course, the boundary values of the above threshold range can be adjusted according to actual application requirements. When there are more modes (i.e., scenes), more target angle threshold ranges can also be set.
[0071] Of course, it should be noted that since the relative position between the image detection device and the parking space will remain fixed for a long time, in order to save computing resources, the target detection mode only needs to be determined when the vehicle parking status is detected for the first time (i.e. when the first parking space image is received).
[0072] S102. When it is determined that the vehicle detected from the parking space image has come to a complete stop, extract the detection box corresponding to the vehicle, and sequentially determine the positions of multiple specified chassis key points on the vehicle in the parking space image.
[0073] This invention utilizes vehicle tracking technology to determine whether a vehicle detected in a parking space image has come to a complete stop. The tracking algorithm is the common Mot multi-object tracking algorithm, whose basic idea is to match the vehicle's frame-by-frame detection results and track the object based on the matching results. Related tracking algorithms can be referenced. Upon determining that the vehicle is stationary, this invention further acquires the corresponding detection box and sequentially determines the positions of multiple specified chassis key points in the vehicle image. The detection box is the one determined by the vehicle image detection model, while the chassis key points are specified locations on the vehicle's chassis, such as the four tires. The purpose of acquiring these chassis key points is that, compared to the detection box, these key points better reflect the vehicle's parking posture and the positional relationship between the vehicle and the parking space. Figure 2 In the oblique scene shown, compared to the detection box (i.e. Figure 2 The four chassis key points (i.e., the four dots marked at the tires in the image) clearly better reflect that the vehicle is parked normally in the parking space area. In addition, when the vehicle is easily obscured (in the same side scenario), the chassis key points may also play an auxiliary role in determining the vehicle's parking position, which can further improve the accuracy of vehicle parking status detection.
[0074] It should be noted that the chassis key points in this embodiment of the invention are marked by the vehicle image detection model. In other words, this model can not only determine the detection box, but also automatically mark the positions of the chassis key points in the detected vehicle. Furthermore, this model can be specifically trained using training data marked with detection boxes and chassis key points. It should also be noted that this embodiment of the invention requires the vehicle image detection model to sequentially determine the designated positions of each chassis key point on the vehicle chassis. This is because this embodiment of the invention can use the positions of each chassis key point to determine the vehicle's parking orientation; that is, the order of each chassis key point and the correspondence between them and the designated positions on the vehicle chassis are very important. For example, the vehicle image detection model needs to determine the positions of the chassis key points on each wheel in the order of left front wheel, right front wheel, left rear wheel, and right rear wheel. Of course, this embodiment of the invention does not limit the specific determination order and can be set according to actual application needs. This embodiment of the invention also does not limit how the vehicle image detection model detects vehicles, how it marks vehicle detection boxes, or how it marks chassis key points in the detected vehicles; relevant technologies for vehicle image detection can be referenced. This invention does not limit the specific location of chassis key points within the vehicle chassis. For example, they can be located on the car tires or the car bumper, and can be set according to actual application requirements. This invention also does not limit the number of chassis key points, as long as it is greater than or equal to 2. It is understood that the larger the number of chassis key points and the more dispersed their distribution on the vehicle chassis, the more accurate the corresponding parking state detection result. However, at the same time, the vehicle image detection model needs to spend more time and performance on key point annotation. Therefore, the number and location of chassis key points can be set after balancing accuracy, computation time, and performance. This invention also does not limit the specific vehicle image detection model; it can be a multi-layer convolutional neural network, such as SSD (Single Shot MultiBox Detector), YOLO (You Only Look Once) series, etc.
[0075] S103. When the target detection mode is oblique detection mode, the target parking space area and parking status of the vehicle are determined by using the key points of the chassis and each parking space area.
[0076] Considering that chassis key points are more reliable than the detection boxes corresponding to the vehicle in oblique scenes, when the target detection mode is determined to be oblique detection mode, this embodiment of the invention will use chassis key points and each vehicle area to determine the target parking space area where the vehicle is parked, as well as the parking status of the vehicle in the target parking area.
[0077] S104. When the target detection mode is the same-side detection mode, the target parking space area and parking status of the vehicle are determined by using the chassis key points, detection frame and parking space area.
[0078] Considering that vehicles are more likely to be obscured in the same-side scene, such as when a vehicle is parked in a parking space area, only the roof is visible, it is difficult to accurately determine the parking status of the vehicle in the parking space area by relying on a single piece of information. Therefore, this embodiment of the invention will use the chassis key points, detection frame and parking space area at the same time to determine the parking status of the vehicle. Thus, the accuracy of vehicle parking status detection under obscured conditions can be improved by using multi-information fusion.
[0079] Based on the above embodiments, before detecting the target parking space area and parking status of the vehicle, the present invention first acquires a pre-marked parking space area in the parking space image and adaptively determines the target detection mode according to the orientation of the specified parking space frame line in the parking space area. This mode includes a diagonal detection mode and a same-side detection mode. That is, the present invention can adaptively determine whether the scene in which the parking space area is located is a diagonal scene or a same-side scene, and then automatically take the most appropriate method to detect the vehicle parking status. Subsequently, when the present invention determines that the vehicle detected from the parking space image is stationary, it can extract the detection box corresponding to the vehicle and sequentially determine the positions of multiple specified chassis key points on the vehicle in the parking space image. In a diagonal scene, the vehicle is not easily obscured, and the position of the chassis key points can better reflect the relationship between the vehicle and the parking space area. The relative positions between domains can improve the accuracy of vehicle parking position and status detection. In same-side scenarios where vehicles are easily obscured, combining chassis key points and detection frames for vehicle parking status detection can effectively avoid the unreliability caused by using single position information, thus also improving the accuracy of vehicle parking position and status detection. Furthermore, when the target detection mode is determined to be oblique detection mode, this invention will use chassis key points and each parking space area to determine the target parking space area and parking status of the vehicle. When the target detection mode is determined to be same-side detection mode, this invention will use chassis key points, detection frames, and parking space areas to determine the target parking space area and parking status of the vehicle, thus enabling the use of multi-information fusion to ensure the accuracy of vehicle parking status detection in various scenarios.
[0080] Based on the above embodiments, the specific implementation of the oblique detection mode will be described in detail below. In one possible case, when the target detection mode is the oblique detection mode, determining the target parking space area and parking status of the vehicle by utilizing key points on the chassis and each parking space area may include:
[0081] S201. Determine the overlapping area of the chassis key point frame established by the chassis key points in each parking space area, and use the area of the overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each parking space area.
[0082] In this embodiment of the invention, chassis key points are mainly used to determine the target parking space area where the vehicle is parked, and to determine whether the vehicle is in a spanning state, that is, to determine whether the vehicle spans multiple parking spaces (such as spanning two parking spaces in front and behind). Specifically, this embodiment of the invention will use each chassis key point to establish a chassis key point frame, and achieve the above effect based on the area corresponding to the overlapping area of the frame in each parking space area. Specifically, this embodiment of the invention will first determine the linear equation of the line connecting each chassis key point in sequence, and determine the intersection point between the line connecting the chassis key points and the border line of each parking space area based on the equation, and then determine the overlapping area based on the intersection point. Subsequently, this embodiment of the invention will also determine the area of each overlapping area, and use the area of each overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each parking space area, so as to use the ratio to determine the target parking space area where the vehicle is parked and the spanning state.
[0083] For easier understanding, please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating a vehicle parking behavior judgment method provided in an embodiment of the present invention. Points P1, P2, P3, and P4 represent key chassis points, corresponding sequentially to the left front wheel, right front wheel, right rear wheel, and left rear wheel; l1 represents the left frame line of the parking space; l2 represents the central axis of the chassis key point frame; S... Lot1 S represents the area of the previous parking space. Lot2 S1 represents the area of the next parking space, and S1 represents the area of the chassis key point frame. Lot1 The overlapping area of the parking space area, S2 represents the area between the chassis key point frame and S. Lot2 The overlapping area of the parking spaces. Based on the above data, the ratio of the vehicle's chassis projection area to the area of the preceding parking space can be calculated as follows:
[0084]
[0085] The ratio of the vehicle's chassis projection area to that of the next parking space is:
[0086]
[0087] S202. When it is determined that there is only one non-zero value among the ratios of the projected areas of each chassis, and the non-zero target chassis projected area ratio is greater than the first preset threshold, it is determined that the vehicle is parked in the target parking space area corresponding to the target chassis projected area ratio, and is not in a cross-space state.
[0088] When it is determined that only one of the ratios of the projected areas of each chassis is non-zero, it can be confirmed that the vehicle is parked in only one parking space area and there is no situation where it spans between parking spaces. Of course, to ensure that the vehicle is indeed parked in a parking space area and not straddling a parking space area and a non-parking space area, it can be further determined whether the non-zero target chassis projected area ratio is greater than a first preset threshold. If so, it can be confirmed that the vehicle is indeed parked in the target parking space area corresponding to the non-zero target chassis projected area ratio. It should be noted that the embodiments of the present invention do not limit the specific value of the first preset threshold. This value can be set as needed according to the area of the parking space area and the chassis area of a typical vehicle. For example, it can typically be 0.4.
[0089] S203. When it is determined that there are multiple non-zero values among the ratios of the projected areas of each chassis, the vehicle is determined to be parked in the target parking space area corresponding to the largest ratio of the projected area of the chassis, and is in a cross-space state.
[0090] When multiple non-zero values are found among the ratios of the projected areas of each chassis, it can be determined that the vehicle spans multiple parking space areas, indicating a cross-parking situation. Therefore, it can be understood that the parking space area corresponding to the largest ratio of the projected chassis area can be considered the parking space where the vehicle is parked.
[0091] Based on the above embodiments, considering that in oblique scenarios, the chassis key points are more reliable than the detection boxes corresponding to the vehicles, when the target detection mode is determined to be oblique detection mode, the embodiments of the present invention will use the chassis key points and each vehicle area to determine the target parking space area where the vehicle is parked, as well as the parking status of the vehicle in the target parking area.
[0092] Based on the above embodiments, in addition to determining the target parking space area and spanning status of the vehicle, the embodiments of the present invention can also determine the parking orientation of the vehicle based on sequentially determined chassis key points. The specific process for determining the parking orientation is described in detail below. In one possible case, after extracting the detection box corresponding to the vehicle and sequentially determining the positions of multiple specified chassis key points on the vehicle in the parking space image, the method may further include:
[0093] S301. Using the position coordinates of each key point on the chassis and the preset orientation determination rules, determine the parking orientation of the vehicle within the target parking space area.
[0094] by Figure 3 For example, P1 and P2 represent the front of the car, and P3 and P4 represent the rear of the car. When the top left corner of the parking space image is taken as the origin, with the positive Y-axis pointing downwards and the positive X-axis pointing to the right, when the y-axis is determined... P1 -y P4 <0 and y P2 -y P3 When y < 0, it can be determined that the vehicle is parked in the wrong direction.P1 -y P4 >0 and y P2 -y P3 When the value is greater than 0, the vehicle can be determined to be parked in the correct position. Of course, the preset orientation determination rules can also be different when the coordinate system is different, and can be set according to the actual application requirements.
[0095] Based on the above embodiments, the specific implementation of the same-side detection mode will be described in detail below. In one possible case, when the target detection mode is the same-side detection mode, determining the target parking space area and parking status of the vehicle using chassis key points, detection frames, and parking space areas may include:
[0096] S501. Determine the overlapping area of the chassis key point frame established by the chassis key points in each parking space area, and use the area of the overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each parking space area.
[0097] Similar to the same-side detection mode, this embodiment of the invention also needs to determine the overlapping area of the chassis key point frame in each parking space area, and use the area of this overlapping area and the area of the parking space area where the area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each parking space area. The specific calculation results can be referred to the above embodiments, and will not be repeated here.
[0098] S502. Set the parking space area where the lower boundary of the detection box is located as the initial parking space area, and determine the ratio of the overlapping area of the detection box in the initial parking space area to the area of the initial parking space area.
[0099] In addition, embodiments of the present invention will use the lower boundary of the detection frame to roughly determine the initial position of the vehicle, that is, the parking space area where the lower boundary is located will be set as the initial parking space area. Furthermore, embodiments of the present invention also need to calculate the overlapping area of the detection frame in the initial parking space area, and use this overlapping area to calculate the ratio of the projected area of the detection frame to the area of the initial parking space area, so as to use this ratio to determine the target parking space area where the vehicle is parked.
[0100] S503. When it is determined that the ratio of the projected area of the detection frame is greater than the third preset threshold, the initial parking space area is set as the target parking space area.
[0101] When the ratio of the projected area of the detection frame is greater than a third preset threshold, it means that the vehicle occupies a larger area in the initial parking space area. Therefore, the initial parking space area can be set as the target parking space area. It should be noted that the embodiments of the present invention do not limit the specific value of the third preset threshold, and it can be set according to actual application needs. For example, a typical value is 0.6.
[0102] S504. When it is determined that the ratio of the projected area of the detection frame is greater than the fourth preset threshold and less than or equal to the third preset threshold, it is determined whether the ratio of the chassis projected area of the chassis key point frame in the initial parking space area is greater than the ratio of its chassis projected area in other parking space areas; the fourth preset threshold is greater than 0; if yes, proceed to step S505; if no, proceed to step S506.
[0103] When the ratio of the projected area of the detection frame is less than or equal to a third preset threshold and greater than a fourth preset threshold, it becomes impossible to accurately determine whether the target parking space area where the vehicle is parked is the initial parking space area based on the detection frame. In this case, this embodiment of the invention will combine the ratio of the chassis projected area of the chassis key point frame in each parking space area to determine the target parking space area where the vehicle is parked. Specifically, if the ratio of the chassis projected area of the chassis key point frame in the initial parking space area is greater than its ratio in other parking space areas, it can be determined that the vehicle should be parked in the initial parking space area; conversely, if the ratio of the chassis projected area of the chassis key point frame in the initial parking space area is less than or equal to its ratio in other parking space areas, it indicates that the vehicle should be parked in the parking space area with the largest chassis projected area ratio. Of course, if the ratio of the chassis projected area of the chassis key point frame in the initial parking space area is equal to its ratio in other parking space areas, the specific parking position of the vehicle can also be determined manually. It should be noted that the embodiments of the present invention do not limit the specific value of the fourth preset threshold, which can be determined according to actual application needs. For example, it can typically be 0.3.
[0104] S505. Set the initial parking space area as the target parking space area;
[0105] S506. Set the parking space area corresponding to the largest chassis projection area ratio as the target parking space area.
[0106] S507. When the ratio of the projected area of the detection frame is less than or equal to the fourth preset threshold, it is determined that the vehicle is not parked in the parking space area.
[0107] If the ratio of the projected area of the detection frame is less than or equal to the fourth preset threshold, it can be determined that the vehicle is not parked in any parking space area.
[0108] S508. Use the detection frame and the target parking space area to determine whether the vehicle is in a cross-space state.
[0109] After determining the target parking space area where the vehicle is parked, the relative positional relationship between the detection frame and the target parking space area can be used to determine whether the vehicle is in a straddled parking space state. Specifically, determining whether the vehicle is in a straddled parking space state using the detection frame and the target parking space area can include:
[0110] S601. Determine the distance between the lower frame line of the detection frame and the lower frame line of the target parking space area.
[0111] This embodiment of the invention determines whether a vehicle is crossing the line based on the distance between the lower frame line of the detection frame and the lower frame line of the target parking space area, as well as the height of the target parking space area in the parking space image.
[0112] S602. Obtain the height of the target parking space area in the parking space image, and determine whether the ratio between distance and height is greater than a fifth preset threshold. If yes, proceed to step S603; otherwise, proceed to step S604.
[0113] Specifically, in this embodiment of the invention, the presence of a vehicle crossing a parking space is determined based on the ratio between the aforementioned distance and the aforementioned height. This further mitigates the impact of perspective relationships on vehicle parking status detection. It should be noted that this embodiment of the invention does not limit the specific value of the fifth preset threshold; it can be set according to actual application requirements, for example, typically 0.2.
[0114] S603. Determine that the vehicle is in a straddle position, and when there is a target chassis projection area ratio greater than the sixth preset threshold in the chassis projection area ratio corresponding to the chassis key point box, determine the parking space area corresponding to the target chassis projection area ratio as the parking space area crossed by the vehicle.
[0115] After determining that the vehicle is in a straddle position, this embodiment of the invention can further determine the target parking space that the vehicle is straddling based on whether there is a target chassis projection area ratio greater than a sixth preset threshold among the chassis projection area ratios corresponding to the chassis key point boxes. That is, the parking space area corresponding to the target chassis projection area ratio with a value greater than the sixth preset threshold is the parking space area straddled by the vehicle. It should be noted that this embodiment of the invention does not limit the specific value of the sixth preset threshold; it can be set according to actual application needs, for example, typically 0.3.
[0116] S604. Confirm that the vehicle is not in a straddle position.
[0117] To facilitate understanding, the following diagram illustrates the specific process of determining the target parking space and parking status of a vehicle using key points on the chassis, the detection frame, and the parking space area. Please refer to the diagram. Figure 4 , Figure 4 This is a schematic diagram illustrating the relative positional relationship between the vehicle and chassis and the parking space in a scenario on the same side, as provided in an embodiment of the present invention. The process specifically includes:
[0118] 1) Calculate which parking space the lower boundary of the vehicle detection box is located in, and use it as the initial parking space number InitLot for the vehicle.
[0119] 2) Calculate whether the ratio of the projected area of the vehicle detection box within the initial parking space is greater than a certain threshold thread1 (thread1 is set to 0.6). If the ratio is greater than 0.6, directly use the InitLot as the final output parking space number. Otherwise, continue with the following judgment.
[0120] 3) If the value calculated in 2) is greater than the threshold thread2 (thread2 is set to 0.3), then when it is determined that the ratio is greater than the threshold thread2 and less than the threshold thread1, it is determined whether the ratio of the projection area of the chassis projection area in the initial parking space is greater than the ratio of the projection area in the adjacent parking space.
[0121] 4) If the ratio of the projected area of the chassis projection area within the initial parking space is greater than the ratio of the projected area within the adjacent parking spaces, then InitLot is used as the final output parking space number. Otherwise, the maximum ratio of the area of the chassis projection area to the area within each of the other parking spaces (excluding InitLot) is further calculated as the final parking space number.
[0122] 5) Based on the determined parking space number, calculate the height H of the parking space and the distance L from the detection frame to the lower parking space line. If If the value is less than the threshold thread3 (thread3 is set to 0.2), then output that the vehicle has not crossed a parking space.
[0123] 6) If If the ratio is greater than thread3, the final determined cross-parking space number is the parking space number corresponding to the ratio being greater than the threshold thread4 (thread4 is set to 0.3) based on the calculated ratio of the chassis projection area in other adjacent and secondary adjacent parking spaces.
[0124] like Figure 4 As shown in the figure, S D S is the projected area determined by the vehicle detection frame and the parking space frame. B and S U S represents the projected area of the quadrilateral region formed by the key points of the chassis and parking spaces Lot1 and Lot2. Lot1 Let S represent the area of parking space Lot1, H represent the height of the parking space, and L represent the distance from the lower boundary of the detection frame to the lower parking space line. B and S U The specific calculation process is similar to the method for determining the chassis projected area under the aforementioned oblique side condition, and will not be repeated here.
[0125] by Figure 4 For example, S can be determined using the above calculation method. B S U S D S Lot1 S Lot2Since L and H satisfy the conditions shown in the following formula, the specific parking space number corresponding to the vehicle can be determined to be Lot1, and the vehicle has not engaged in parking space skipping.
[0126]
[0127]
[0128]
[0129] Based on the above embodiments, considering that vehicles are more likely to be covered in the same-side scene, such as when a vehicle is parked in a parking space area and only the roof is exposed, it is difficult to accurately determine the parking status of the vehicle in the parking space area by relying on a single piece of information. Therefore, the embodiments of the present invention will simultaneously use chassis key points, detection frames and parking space areas to determine the parking status of the vehicle. Thus, the accuracy of vehicle parking status detection under covered conditions can be improved by multi-information fusion.
[0130] Based on the above embodiments, considering that the parking status of a vehicle in a same-side scenario also affects the accuracy of detecting the parking area and parking status, a secondary detection of the vehicle's posture in the parking space can be performed before using the same-side detection mode to enable a more suitable detection mode for vehicle parking status detection. The specific steps for the secondary vehicle posture detection are described below. In one possible scenario, before determining the target parking space area and parking status of the vehicle using chassis key points, detection frames, and the parking space area, the following may also be included:
[0131] S401. Acquire a panoramic image of the parking space when a vehicle is detected to be in contact with the warning line around the parking space area; the warning line is obtained by extending the parking space area outward by a preset distance.
[0132] In same-side scenarios, vehicles are easily obscured due to perspective, making their chassis features less prominent. The reliability of key chassis points is lower than that of the detection frame. Therefore, this embodiment of the invention integrates the use of chassis key points and the detection frame to detect the parking status of vehicles in same-side scenarios. Of course, it is also necessary to consider that same-side scenarios may also exhibit other characteristics. Figure 5 As shown in the example of angled parking, the vehicle's chassis features are more clearly defined, making the chassis key points more reliable. To appropriately detect whether a vehicle is tilted or not in a same-side scenario, it's necessary to determine whether the vehicle is tilted once it has reached a stable stop. That is, in this embodiment of the invention, when the parking area is determined to be in a same-side scenario, the vehicle's posture needs to be determined a second time.
[0133] Specifically, in this embodiment of the invention, the vehicle is determined to be tilted based on whether the orientation of the chassis center axis, determined by key points on the chassis, is the same as the orientation determined by the vehicle contour mask. The chassis center axis is a straight line passing through a point located between the two front wheels and a point located between the two rear wheels. The vehicle contour mask is a map containing only the vehicle image. Figure 6 The gray area is shown in the diagram. Specifically, the vehicle contour mask can be obtained by subtracting the panoramic image of the parking space acquired when it is determined that the vehicle is not parked in the parking space area and the parking space image acquired when it is determined that the vehicle is parked in the parking space area. To improve the reliability of the panoramic image of the parking space, in this embodiment of the invention, the panoramic image of the parking space can be acquired when it is determined that the vehicle is in contact with the warning line in the parking space area, wherein the warning line is a straight line obtained by expanding the parking space area by a preset distance, such as... Figure 7 As shown, once the vehicle has come to a complete stop, only a panoramic image of the parking space needs to be acquired. It should be noted that the embodiments of the present invention do not limit the specific preset outward distance, and can be set according to actual application needs.
[0134] S402. The vehicle foreground image is obtained by subtracting the parking space image and the panoramic parking space image using the frame difference method, and the vehicle foreground image is processed to obtain the vehicle contour mask image.
[0135] It should be noted that the embodiments of the present invention do not limit the specific method of subtraction processing, and relevant technologies for image subtraction processing can be referred to. The embodiments of the present invention also do not limit what processing needs to be performed on the vehicle foreground image to obtain the vehicle contour mask image. For example, a shadow detection algorithm based on HIS space can be used, and then mathematical morphology can be used to remove isolated points and burrs formed by shadow interference in the foreground, thereby ensuring a good effect for the foreground and obtaining a fine vehicle contour mask image.
[0136] S403. Determine the minimum bounding rectangle corresponding to the vehicle contour mask, and determine the angle between the minimum bounding rectangle and the detection frame.
[0137] Furthermore, the orientation determined by the vehicle contour mask can specifically be the angle between the smallest bounding rectangle corresponding to the vehicle contour mask and the detection box corresponding to the vehicle, such as... Figure 6 The tilted rectangle shown is the minimum bounding rectangle corresponding to the vehicle contour mask, while the horizontally arranged rectangles are the detection boxes. Therefore, the included angle is the size of the acute angle formed by the minimum bounding rectangle and the detection boxes.
[0138] S404. Determine the vehicle's chassis centerline using key chassis points, and determine the vehicle's tilt angle within the target parking space area based on the angle between the chassis centerline and the designated parking space frame line.
[0139] S405. Determine whether the difference between the included angle and the tilt angle is less than the second preset threshold. If yes, proceed to step S406; if no, proceed to step S407.
[0140] When the difference between the angle and the tilt angle is less than the second preset threshold, the vehicle is determined to be parked at an angle. In this case, the chassis key points are more reliable than the detection frame. Therefore, the vehicle parking status can be detected based on the oblique detection mode, which means that the target parking space area and parking status of the vehicle can be determined by using the chassis key points and each parking space area. Conversely, when the difference between the angle and the tilt angle is greater than or equal to the second preset threshold, the chassis key points are determined to be unreliable, and the vehicle is obstructed. Therefore, the target parking space area and parking position of the vehicle can be determined by using the chassis key points and the detection frame (i.e., the parking space area).
[0141] S406. Determine the target parking space area and parking status of the vehicle based on the oblique side detection mode.
[0142] It should be noted that the relevant description of step S406 can be found in the relevant descriptions of steps S201 to S203, and will not be repeated here.
[0143] S407. Proceed to the step of determining the target parking space area and parking status of the vehicle by utilizing chassis key points, detection frames, and parking space areas.
[0144] In this embodiment of the invention, the vehicle's posture in the parking space can also be detected a second time so as to adopt a more suitable detection mode for vehicle parking status detection.
[0145] The vehicle parking status detection device, electronic device, and storage medium provided in the embodiments of the present invention will be described below. The vehicle parking status detection device, electronic device, and storage medium described below can be referred to in correspondence with the vehicle parking status detection method described above.
[0146] Please refer to Figure 8 , Figure 8 This is a structural block diagram of a vehicle parking status detection device provided in an embodiment of the present invention. The device may include:
[0147] The detection mode selection module 801 is used to acquire parking space images and pre-marked parking space areas in the parking space images in real time, and determine the target detection mode according to the orientation of the specified parking space frame line in the parking space area; the detection modes include oblique detection mode and same-side detection mode;
[0148] The detection data extraction module 802 is used to extract the detection box corresponding to the vehicle when it is determined that the vehicle detected from the parking space image has stopped, and to sequentially determine the positions of multiple specified chassis key points on the vehicle in the parking space image.
[0149] The oblique detection module 803 is used to determine the target parking space area and parking status of the vehicle by using key points on the chassis and each parking space area when the target detection mode is oblique detection mode.
[0150] The same-side detection module 804 is used to determine the target parking space area and parking status of the vehicle by using chassis key points, detection frame and parking space area when the target detection mode is same-side detection mode.
[0151] Optionally, the detection mode selection module 801 may include:
[0152] The frame selection submodule is used to obtain the parking space frame line parallel to the normal parking direction of the vehicle from the parking space area and set it as the specified parking space frame line;
[0153] The angle determination submodule is used to determine the angle between the specified parking space frame line and the vertical centerline of the parking space image;
[0154] The first determination submodule is used to obtain the included angle threshold range corresponding to each detection mode, and determine the target detection mode based on the target included angle threshold range into which the included angle falls.
[0155] Optionally, the oblique detection module 803 includes:
[0156] The chassis projection area ratio calculation submodule is used to determine the overlapping area of the chassis key point frame established by the chassis key points in each parking space area, and to calculate the chassis projection area ratio of the chassis key point frame in each parking space area using the area of the overlapping area and the area of the parking space area where the overlapping area is located.
[0157] The second determination module is used to determine that if only one non-zero value exists among the ratios of the projected areas of each chassis, and the non-zero ratio of the target chassis projected area is greater than the first preset threshold, then the vehicle is parked in the target parking space area corresponding to the ratio of the target chassis projected area and is not in a cross-space state.
[0158] The third determination module is used to determine that if there are multiple non-zero values among the ratios of the projected areas of each chassis, the vehicle is parked in the target parking space area corresponding to the largest ratio of the projected area of the chassis and is in a cross-space state.
[0159] Optionally, the device may further include:
[0160] The orientation determination module is used to determine the parking orientation of the vehicle in the target parking space area after extracting the detection box corresponding to the vehicle and sequentially determining the positions of multiple specified chassis key points on the vehicle in the parking space image, using the position coordinates of each chassis key point and the preset orientation determination rules.
[0161] Optionally, the same-side detection module 804 may include:
[0162] The chassis projection area ratio calculation submodule is used to determine the overlapping area of the chassis key point frame established by the chassis key points in each parking space area, and to calculate the chassis projection area ratio of the chassis key point frame in each parking space area using the area of the overlapping area and the area of the parking space area where the overlapping area is located.
[0163] The initial parking space area setting submodule is used to set the parking space area where the lower boundary of the detection box is located as the initial parking space area, and to determine the ratio of the overlapping area of the detection box in the initial parking space area to the area of the initial parking space area.
[0164] The first target parking space area determination submodule is used to set the initial parking space area as the target parking space area when the ratio of the projected area of the detection frame is greater than the third preset threshold.
[0165] The judgment submodule is used to determine whether the ratio of the projected area of the chassis key point frame in the initial parking space area is greater than the ratio of its chassis projected area in other parking space areas when the ratio of the projected area of the detection frame is greater than the fourth preset threshold and less than or equal to the third preset threshold; the fourth preset threshold is greater than 0.
[0166] The second target parking space area determination submodule is used to set the initial parking space area as the target parking space area if the target area is greater than the target area.
[0167] The third target parking space area determination submodule is used to set the parking space area corresponding to the largest chassis projection area ratio as the target parking space area if it is not greater than 0.5%.
[0168] The "Not Parked" determination submodule is used to determine that a vehicle is not parked within the parking space area when the ratio of the projected area of the detection frame is less than or equal to the fourth preset threshold.
[0169] The cross-space detection submodule is used to determine whether a vehicle is in a cross-space state by using the detection frame and the target parking space area.
[0170] Optionally, the cross-position detection submodule may include:
[0171] The distance determination unit is used to determine the distance between the lower frame line of the detection frame and the lower frame line of the target parking space area;
[0172] The judgment unit is used to obtain the height of the target parking space area in the parking space image and determine whether the ratio between the distance and the height is greater than the fifth preset threshold.
[0173] The first cross-position determination unit is used to determine that the vehicle is in a cross-position state if the vehicle is in a cross-position state, and when there is a target chassis projection area ratio greater than the sixth preset threshold in the chassis projection area ratio corresponding to the chassis key point box, the parking space area corresponding to the target chassis projection area ratio is determined as the parking space area crossed by the vehicle.
[0174] The second cross-position determination unit is used to determine that the vehicle is not in a cross-position state if no.
[0175] Optionally, the same-side detection module 804 may further include:
[0176] The parking space panoramic image acquisition submodule is used to acquire the parking space panoramic image when the vehicle is detected to be in contact with the warning line around the parking space area before determining the target parking space area and parking status of the vehicle using chassis key points, detection boxes and parking space area; the warning line is obtained by extending the parking space area outward by a preset distance.
[0177] The vehicle contour mask generation submodule is used to obtain the vehicle foreground image by subtracting the parking space image and the parking space panoramic image using the frame difference method, and then process the vehicle foreground image to obtain the vehicle contour mask.
[0178] The first angle value determination submodule is used to determine the minimum bounding rectangle corresponding to the vehicle contour mask and to determine the angle between the minimum bounding rectangle and the detection box.
[0179] The second angle value determination submodule is used to determine the chassis center axis of the vehicle using chassis key points, and to determine the tilt angle of the vehicle in the target parking space area based on the angle between the chassis center axis and the specified parking space frame line.
[0180] The judgment submodule is used to determine whether the difference between the included angle and the tilt angle is less than a second preset threshold.
[0181] The first processing submodule is used to determine the target parking space area and parking status of the vehicle based on the oblique detection mode if the condition is met.
[0182] The second processing submodule is used to determine the target parking space area and parking status of the vehicle by using chassis key points, detection boxes and parking space areas if no.
[0183] This invention also provides an electronic device, comprising:
[0184] Memory, used to store computer programs;
[0185] A processor is used to execute computer programs to implement the steps of the vehicle parking status detection method described above.
[0186] Since the embodiments of the electronic device part correspond to the embodiments of the vehicle parking status detection method part, please refer to the description of the embodiments of the vehicle parking status detection method part for the embodiments of the electronic device part, and will not be repeated here.
[0187] This invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the vehicle parking status detection method of any of the above embodiments.
[0188] Since the embodiments of the storage medium portion correspond to the embodiments of the vehicle parking status detection method portion, please refer to the description of the embodiments of the vehicle parking status detection method portion for the embodiments of the storage medium portion, and will not be repeated here.
[0189] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0190] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0191] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0192] The present invention has provided a detailed description of a vehicle parking status detection method, apparatus, electronic device, and storage medium. Specific examples have been used to illustrate the principles and implementation methods of the invention. The descriptions of these embodiments are merely illustrative of the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from its principles, and these improvements and modifications also fall within the scope of protection of the claims.
Claims
1. A method for detecting the parking status of a vehicle, characterized in that, include: Real-time acquisition of parking space images and pre-labeled parking space areas within the parking space images; determination of target detection mode based on the orientation of the specified parking space frame lines within the parking space areas. The detection modes include oblique detection mode and same-side detection mode; When it is determined that a vehicle detected from the parking space image has come to a complete stop, the detection box corresponding to the vehicle is extracted, and the positions of multiple specified chassis key points on the vehicle in the parking space image are determined sequentially. When the target detection mode is the oblique detection mode, the target parking space area and parking status of the vehicle are determined by using the chassis key points and each parking space area; When the target detection mode is the same-side detection mode, the target parking space area and parking status of the vehicle are determined by using the chassis key points, the detection frame and the parking space area.
2. The vehicle parking status detection method according to claim 1, characterized in that, The step of determining the target detection mode based on the orientation of the specified parking space frame line in the parking space area includes: Obtain a parking space frame line parallel to the normal parking direction of the vehicle from the parking space area and set it as the designated parking space frame line; Determine the angle between the designated parking space frame line and the vertical centerline of the parking space image; Obtain the included angle threshold range corresponding to each of the detection modes, and determine the target detection mode based on the target included angle threshold range into which the included angle falls.
3. The vehicle parking status detection method according to claim 1, characterized in that, The step of determining the target parking space area and parking status of the vehicle using the key points of the chassis and each of the parking space areas includes: Determine the overlapping area of the chassis key point frame established by the chassis key points in each of the parking space areas, and use the area of the overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each of the parking space areas. If it is determined that there is only one non-zero value among the ratios of the projected areas of the chassis, and the non-zero target chassis projected area ratio is greater than the first preset threshold, then it is determined that the vehicle is parked in the target parking space area corresponding to the target chassis projected area ratio, and is not in a cross-space state. If it is determined that there are multiple non-zero values among the chassis projection area ratios, then the vehicle is determined to be parked in the target parking space area corresponding to the largest chassis projection area ratio, and is in the cross-space state.
4. The vehicle parking status detection method according to claim 1, characterized in that, After extracting the detection bounding box corresponding to the vehicle and sequentially determining the positions of multiple specified chassis key points on the vehicle in the parking space image, the method further includes: Using the position coordinates of each of the key points of the chassis and the preset orientation determination rules, the parking orientation of the vehicle in the target parking space area is determined.
5. The vehicle parking status detection method according to any one of claims 1 to 4, characterized in that, When the target detection mode is the same-side detection mode, the target parking space area and parking status of the vehicle are determined using the chassis key points, the detection frame, and the parking space area, including: Determine the overlapping area of the chassis key point frame established by the chassis key points in each of the parking space areas, and use the area of the overlapping area and the area of the parking space area where the overlapping area is located to calculate the ratio of the chassis projection area of the chassis key point frame in each of the parking space areas. Set the parking space area where the lower boundary of the detection frame is located as the initial parking space area, and determine the ratio of the overlapping area of the detection frame in the initial parking space area to the area of the initial parking space area. When it is determined that the ratio of the projected area of the detection frame is greater than the third preset threshold, the initial parking space area is set as the target parking space area; When it is determined that the ratio of the projected area of the detection frame is greater than the fourth preset threshold and less than or equal to the third preset threshold, it is then determined whether the ratio of the chassis projected area of the chassis key point frame in the initial parking space area is greater than the ratio of its chassis projected area in other parking space areas; the fourth preset threshold is greater than 0. If the value is greater than the target parking space area, then the initial parking space area is set as the target parking space area. If it is not greater than, then the parking space area corresponding to the largest chassis projection area ratio is set as the target parking space area; When it is determined that the ratio of the projected area of the detection frame is less than or equal to the fourth preset threshold, it is determined that the vehicle is not parked in the parking space area; The detection frame and the target parking space area are used to determine whether the vehicle is in a cross-space state.
6. The vehicle parking status detection method according to claim 5, characterized in that, The step of determining whether the vehicle is in a cross-parking space state using the detection frame and the target parking space area includes: Determine the distance between the lower frame line of the detection frame and the lower frame line of the target parking space area; Obtain the height of the target parking space area in the parking space image, and determine whether the ratio between the distance and the height is greater than a fifth preset threshold. If so, the vehicle is determined to be in the straddle state, and when there is a target chassis projection area ratio greater than the sixth preset threshold in the chassis projection area ratio corresponding to the chassis key point frame, the parking space area corresponding to the target chassis projection area ratio is determined to be the parking space area crossed by the vehicle. If not, then it is determined that the vehicle is not in the straddle position state.
7. The vehicle parking status detection method according to claim 5, characterized in that, Before determining the target parking space area and parking status of the vehicle using the chassis key points, the detection frame, and the parking space area, the method further includes: Acquire a panoramic image of the parking space when the vehicle is detected to be in contact with a warning line surrounding the parking space area; the warning line is obtained by extending a preset distance outward from the parking space area. The vehicle foreground image is obtained by subtracting the parking space image and the parking space panoramic image using the frame difference method, and the vehicle foreground image is processed to obtain the vehicle contour mask image. Determine the minimum bounding rectangle corresponding to the vehicle contour mask, and determine the angle between the minimum bounding rectangle and the detection frame; The chassis center axis of the vehicle is determined using the key points of the chassis, and the tilt angle of the vehicle in the target parking space area is determined based on the angle between the chassis center axis and the designated parking space frame line. Determine whether the difference between the included angle and the tilt angle is less than a second preset threshold; If so, the target parking space area and parking status of the vehicle are determined based on the oblique detection mode; If not, proceed to the step of determining the target parking space area and parking status of the vehicle using the chassis key points, the detection frame, and the parking space area.
8. A vehicle parking status detection device, characterized in that, include: The detection mode selection module is used to acquire parking space images and pre-marked parking space areas in the parking space images in real time, and determine the target detection mode according to the orientation of the specified parking space frame line in the parking space area; the detection modes include oblique detection mode and same-side detection mode; The detection data extraction module is used to extract the detection box corresponding to the vehicle when it is determined that the vehicle detected from the parking space image has stopped, and to sequentially determine the positions of multiple specified chassis key points on the vehicle in the parking space image. The oblique detection module is used to determine the target parking space area and parking status of the vehicle by using the chassis key points and each parking space area when the target detection mode is the oblique detection mode. The same-side detection module is used to determine the target parking space area and parking status of the vehicle by using 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, characterized in that, include: Memory, used to store computer programs; A processor is configured to implement the vehicle parking status detection method as described in any one of claims 1 to 7 when executing the computer program.
10. A storage medium, characterized in that, The storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the vehicle parking status detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Deep learning-based vehicle reverse parking judgment method and system, and server
CN108256554A
Parking detection method, device and equipment based on chassis detection and storage medium
CN114494795A