Mechanical parking space detection method and apparatus, electronic device, medium, product, and vehicle

WO2026149542A1PCT designated stage Publication Date: 2026-07-16ZHEJIANG GEELY HLDG GRP CO LTD +1

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ZHEJIANG GEELY HLDG GRP CO LTD
Filing Date
2026-01-09
Publication Date
2026-07-16

AI Technical Summary

Technical Problem

Monocular cameras are limited by their field of view and obstructions in mechanical parking inspection, resulting in low detection accuracy and a tendency to make false or missed judgments.

Method used

By detecting multiple frames of parking space images, extracting point and line information, using a deep learning model to fuse detections and remove duplicates, matching entrance corner points and inner edges of parking spaces, and performing rectangular processing to obtain parking space lines for mechanical parking spaces.

Benefits of technology

This improves the accuracy and reliability of mechanical parking space detection, reduces false positives and false negatives, and ensures the accuracy of parking space detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026071685_16072026_PF_FP_ABST
    Figure CN2026071685_16072026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a mechanical parking space detection method and apparatus, an electronic device, a medium, a product, and a vehicle. The method may comprise: performing detection on a plurality of parking space image frames to obtain point-line information in the plurality of parking space image frames, wherein the plurality of parking space image frames are obtained by photographing a mechanical parking space by means of a monocular camera, the point-line information comprises an entrance corner point of the mechanical parking space and a parking space internal boundary line, and a direction of the parking space internal boundary line is a direction from an entrance of the parking space to a rear boundary of the parking space; matching the entrance corner point with the parking space internal boundary line to obtain a point-line pair for the mechanical parking space; and performing rectangularization processing on the point-line pair to obtain a parking space line of the mechanical parking space.
Need to check novelty before this filing date? Find Prior Art

Description

Mechanical parking space inspection methods, devices, electronic equipment, media, products and vehicles Cross-reference to related applications

[0001] This disclosure claims priority to Chinese patent application No. 202510034885.5, filed on January 9, 2025, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to, but is not limited to, the field of assisted driving technology, and in particular to a method, device, electronic device, medium, product, and vehicle for detecting mechanical parking spaces. Background Technology

[0003] With the acceleration of urbanization and the increasing scarcity of land resources, mechanical parking spaces, as an efficient way to utilize space, have been widely used in various parking lots. However, mechanical parking spaces are often designed to be compact and structurally complex, with narrow spacing between spaces, and are often accompanied by obstructions such as pillars and beams. Summary of the Invention

[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.

[0005] This application provides a method, apparatus, electronic device, medium, product, and vehicle for detecting mechanical parking spaces.

[0006] According to a first aspect of any embodiment of this application, a method for detecting mechanical parking spaces is provided. The method includes: detecting multiple frames of parking space images to obtain point and line information in the multiple frames of parking space images; wherein the multiple frames of parking space images are obtained by capturing the mechanical parking space with a monocular camera, and the point and line information includes: the entrance corner point and the inner edge of the mechanical parking space, wherein the direction of the inner edge of the parking space is from the entrance of the parking space to the end of the parking space; matching the entrance corner point and the inner edge of the parking space to obtain a point and line pair of the mechanical parking space; and performing rectangular processing on the point and line pair to obtain the parking space line of the mechanical parking space.

[0007] According to a second aspect of any embodiment of this application, a mechanical parking space detection device is provided. The device includes: a detection module configured to detect multiple frames of parking space images to obtain point and line information in the multiple frames of parking space images; wherein the multiple frames of parking space images are obtained by capturing the mechanical parking space with a monocular camera, and the point and line information includes: the entrance corner point of the mechanical parking space and the inner edge line of the parking space, wherein the direction of the inner edge line of the parking space is along the direction from the entrance of the parking space to the end of the parking space; a matching module configured to match the entrance corner point and the inner edge line of the parking space to obtain a point and line pair of the mechanical parking space; and a processing module configured to perform rectangular processing on the point and line pair to obtain the parking space line of the mechanical parking space.

[0008] According to a third aspect of any embodiment of this application, an electronic device is provided, comprising: at least one processor; and at least one memory communicatively connected to the at least one processor, the at least one memory storing computer-executable instructions, wherein the at least one processor is configured to read the computer-executable instructions from the at least one memory and execute the computer-executable instructions to implement the method described in any embodiment of this application.

[0009] According to a fourth aspect of any embodiment of this application, a non-transitory computer-readable storage medium is provided, wherein computer-executable instructions are stored on the non-transitory computer-readable storage medium, and when executed by at least one processor, the computer-executable instructions implement the method described in any of the embodiments of this application above.

[0010] According to a fifth aspect of any embodiment of this application, a computer program product is provided, including a computer program that, when executed by at least one processor, implements the method described in any of the embodiments of this application above.

[0011] According to a sixth aspect of any embodiment of this application, a vehicle is provided, including a mechanical parking space detection device as described in the second aspect, or an electronic device as described in the third aspect, or a non-transitory computer-readable storage medium as described in the fourth aspect, or a computer program product as described in the fifth aspect.

[0012] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application. Other aspects will become clear after reading and understanding the accompanying drawings and detailed description. Attached Figure Description

[0013] The accompanying drawings are included to provide a further understanding of the technical solutions of this application, are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with this application, and are used together with the specification to explain the principles of this application, but do not constitute a limitation on the technical solutions of this application.

[0014] Figure 1 is a flowchart illustrating a mechanical parking space detection method according to an exemplary embodiment of this application.

[0015] Figure 2 is a schematic diagram of dot and line information in a multi-frame parking space image according to an exemplary embodiment of this application.

[0016] Figure 3 is a flowchart illustrating the detection of the inner edge of a parking space according to an exemplary embodiment of this application.

[0017] Figure 4 is a schematic diagram illustrating a maximum viewing angle difference according to an exemplary embodiment of this application.

[0018] Figure 5 is a schematic diagram illustrating a matching point-line pair according to an exemplary embodiment of this application.

[0019] Figure 6 is a schematic diagram illustrating a search for matching point-line pairs according to an exemplary embodiment of this application.

[0020] Figure 7 is a schematic diagram illustrating a rectangularization process of a dot-line pair according to an exemplary embodiment of this application.

[0021] Figure 8 is a flowchart illustrating another method for detecting mechanical parking spaces according to an exemplary embodiment of this application.

[0022] Figure 9 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this application.

[0023] Figure 10 is a block diagram of a mechanical parking space detection device according to an exemplary embodiment of this application. Detailed Implementation

[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0025] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any one or all possible combinations of one or more of the associated listed items.

[0026] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0027] Monocular cameras are widely used in parking space detection due to their relatively low cost and ease of installation. However, because various obstructions exist around mechanical parking spaces, the field of view of a monocular camera is limited by its installation position and angle. It often only captures parking space information within a certain range directly in front of the camera, failing to obtain complete parking space information. This affects the accuracy of parking space detection, making it prone to false positives or false negatives.

[0028] To address the aforementioned problems, this application proposes a method for detecting mechanical parking spaces. The following embodiments are provided to further illustrate this application.

[0029] Please refer to Figure 1, which is a flowchart illustrating a mechanical parking space detection method according to an exemplary embodiment of this application. This mechanical parking space detection method can be executed by a parking space detection system, which can be applied to vehicles or cloud servers.

[0030] The detection method for the mechanical parking space may include the following steps 102 to 106.

[0031] In step 102, the multi-frame parking space images are detected to obtain the point and line information in the multi-frame parking space images; wherein, the multi-frame parking space images are obtained by taking pictures of mechanical parking spaces with a monocular camera, and the point and line information includes: the entrance corner point of the mechanical parking space and the inner edge of the parking space, and the direction of the inner edge of the parking space is from the entrance of the parking space to the end of the parking space.

[0032] In this step, the parking space detection system can capture images of mechanical parking spaces using a monocular camera, obtaining multiple frames of parking space images. The system can then use a deep learning model to fuse and detect these multiple frames of images, identifying points and lines within them. These points and lines are then deduplicated to obtain the point and line information from the multiple frames of parking space images.

[0033] The parking space detection system can also use image processing technologies such as edge detection, corner detection, and line detection to identify point and line information in multiple frames of parking space images.

[0034] When detecting multiple frames of parking space images, the parking space detection system can also detect the relative position of point and line information in the mechanical parking space by analyzing the spatial position, direction and relative relationship between them. For example, it can determine whether the entrance corner point and the inner edge of the parking space belong to the left or right side of the mechanical parking space.

[0035] In this embodiment of the application, the multi-frame parking space image is an image sequence obtained by taking multiple shots of the mechanical parking space at different time points or different angles using a monocular camera, which is used to obtain parking space information such as the location, size and shape of the mechanical parking space.

[0036] A monocular camera is a camera system that captures image information using only one lens. It captures light and generates a two-dimensional image through an image sensor. Monocular cameras can be monocular cameras, pinhole cameras, etc.

[0037] Point and line information refers to the key points and line information extracted from multiple frames of parking space images. This information can include the entrance corner points and the inner edges of the mechanical parking space. Entrance corner points are feature points at the entrance of the parking space, used to locate the entrance position of the mechanical parking space.

[0038] The inner edge of a parking space is a line running from the entrance to the end of the parking space. It indicates the length and direction of a mechanical parking space. The direction of the inner edge is from the entrance to the end of the parking space. The inner edge of a parking space can include the left and right inner edges of a mechanical parking space.

[0039] By fusing point and line information from multiple frames of parking space images, the inner edge information of both sides of the mechanical parking space can be obtained, avoiding the inability to see the inner edges of both sides of the parking space simultaneously due to occlusion, thereby improving the accuracy of parking space detection.

[0040] Methods for deduplicating points and lines in multi-frame parking space images include, for example, determining that two points are duplicates and retaining one point when the distance between two points is less than a threshold based on the Euclidean distance or Manhattan distance between them; or determining that two lines are duplicates and retaining one line if the slopes of two lines are similar and their positions overlap based on the angle, slope, or positional relationship between them.

[0041] For example, for detected points and lines, feature descriptors can be extracted, such as feature point descriptors based on Scale-Invariant Feature Transform (SIFT) and Speeded-Up Robust Features (SURF), or line segment-based feature descriptors. Feature matching algorithms can then be used to match points and lines in different frames. If the feature descriptors of two points or lines are very similar, it is determined that the two points or lines are duplicates.

[0042] Please refer to Figure 2, which illustrates a schematic diagram of point and line information in a multi-frame parking space image. For example, the parking space detection system can obtain multi-frame parking space images by taking pictures of mechanical parking spaces with a monocular camera, and detect the left inner edge 21 and right inner edge 22, as well as the left entrance corner point 23 and right entrance corner point 24 in the multi-frame parking space images.

[0043] In step 104, the entrance corner point and the inner edge of the parking space are matched to obtain the point-line pair of the mechanical parking space.

[0044] In this step, the parking space detection system can extract point feature information such as the location coordinates and direction of the entrance corner point, and line feature information such as the slope, start point, and end point of the line along the inner edge of the parking space. Based on the point feature information and line feature information, the entrance corner point and the inner edge of the parking space are matched to obtain multiple point-line pairs of mechanical parking spaces.

[0045] For example, a parking space detection system can calculate the distance from the entrance corner point to each point along the inner edge of the parking space and select the point with the smallest distance as the matching point. It can also determine the spatial relationship between the entrance corner point and the inner edge of the parking space. The entrance corner point should be located at or near the beginning of the inner edge of the parking space, and the inner edge of the parking space should extend in the direction from the entrance corner point to the end of the parking space.

[0046] In the embodiments of this application, a dot-line pair is an information unit that can represent the basic shape and position of a mechanical parking space, used to reflect an entrance and extension direction of the mechanical parking space. The dot-line pair can be the left dot-line pair of the mechanical parking space or the right dot-line pair of the mechanical parking space.

[0047] The left point-line pair is a point-line pair formed by the left inner edge of the mechanical parking space and the left entrance corner point, while the right point-line pair is a point-line pair formed by the right inner edge of the mechanical parking space and the right entrance corner point.

[0048] Please refer to Figure 2. The parking space detection system can match the entrance corner point and the inner edge of the parking space in multiple frames of parking space images to obtain the left point line pair and the right point line pair of the mechanical parking space. The left point line pair includes the left inner edge 21 and the left entrance corner point 23, and the right point line pair includes the right inner edge 22 and the right entrance corner point 24.

[0049] In step 106, the point-line pairs are rectangularized to obtain the parking lines of the mechanical parking spaces.

[0050] In this step, the parking space detection system performs rectangular processing on the multiple point-line pairs obtained from the matching to obtain the parking space lines of the mechanical parking spaces.

[0051] For example, the left and right point line pairs of the same mechanical parking space are rectangularized, and the entrance corner points and inner edges of the parking space in the left and right point line pairs are converted into standard rectangular shapes in order to more accurately describe and locate the parking space and obtain the parking space lines of the mechanical parking space.

[0052] The mechanical parking space detection method of this application embodiment detects multiple frames of parking space images to obtain point and line information in the multiple frames of parking space images. It then matches the entrance corner point and the inner edge of the parking space in the point and line information to obtain point and line pairs for the mechanical parking space. Finally, it performs rectangular processing on the point and line pairs to obtain the parking space line of the mechanical parking space. Therefore, through multi-frame image processing and point and line matching, the parking space line of the mechanical parking space can be accurately identified, thereby improving the accuracy of parking space detection.

[0053] In the foregoing embodiments, it was described how to accurately detect parking lines in mechanical parking spaces by performing point and line detection, matching, and rectangularization processing on multiple frames of parking space images. In the following embodiments, the detection process for point and line information will be described in more detail, and this method can be applied to any of the embodiments described above.

[0054] In one embodiment, Figure 3 illustrates a flowchart for detecting the inner edge of a parking space. As shown in Figure 3, the parking space detection system can input each frame of the parking space image into the point and line detection model. Using the backbone networks such as ResNet (Residual Network) and MobileNet in the point and line detection model, convolution and pooling operations are performed on the parking space image to extract the inner edge features from multiple frames of parking space images.

[0055] By using one or more convolutional layers in the point and line detection model, a first heatmap corresponding to the inner edge features is generated. Each pixel value on the first heatmap represents the probability that the corresponding position is the inner edge of the parking space.

[0056] In the first heatmap, first candidate points along the line within the parking space are selected. For example, in this embodiment, pixels with pixel values ​​higher than a first preset threshold in the first heatmap are selected as first candidate points. The number of first candidate points can be further reduced by methods such as non-maximum suppression to eliminate redundant and overlapping points in the first heatmap.

[0057] The parking space detection system can also use a point-line detection model to generate a first offset corresponding to the inner edge features. The first offset is then added to the original predicted position of the first candidate point in the first heat map to obtain the adjusted first candidate point.

[0058] Clustering algorithms such as K-means clustering and density-based clustering of applications with noise (DBSCAN) are used to group the adjusted first candidate points and then group the adjusted first candidate points into a set of points along the inner edge of the mechanical parking space.

[0059] Using fitting algorithms such as polynomial fitting and least squares fitting, the set of points along the inner edge of the parking space is fitted to obtain the two-dimensional inner edge of the parking space output by the point-line detection model.

[0060] In this embodiment, the inner edge feature is the feature information of the inner edge of the parking space. The first candidate point is the pixel point that makes up the inner edge of the parking space in the first heatmap. The point and line detection model is a temporal model based on deep learning.

[0061] The first heatmap is a visual representation of the first candidate points along the inner edge of the parking space, reflecting the probability that each pixel in the parking space image belongs to the inner edge of the parking space. The first offset is the offset between the predicted position of the first candidate point and its actual position, used to adjust the predicted position of the first candidate point relative to its actual inner edge position.

[0062] As described above, by extracting the inner edge features from multiple frames of parking space images, a first heatmap and a first offset corresponding to the inner edge features are generated. Based on the first heatmap and the first offset, adjusted first candidate points of the parking space's inner edge are determined, which refines the position of the inner edge. Then, the adjusted first candidate points are clustered and fitted to obtain the parking space's inner edge. In this way, false positives and false negatives of the inner edge can be effectively reduced, improving the reliability of parking space detection.

[0063] In one embodiment, please continue to refer to Figure 3. The parking space detection system uses the backbone network in the point and line detection model to perform convolution and pooling operations on the parking space images to extract point features from multiple frames of parking space images.

[0064] One or more convolutional layers in the point and line detection model can be used to generate a second heatmap corresponding to the point features. Each pixel value on the second heatmap represents the probability that the corresponding position is an entry corner point.

[0065] In the second heat map, the second candidate point of the entry corner is selected, and the pixel point with the pixel value in the second heat map that is higher than the second preset threshold is selected as the second candidate point.

[0066] The parking space detection system can also use a point-line detection model to generate a second offset corresponding to the point features. The second offset is then added to the original predicted position of the second candidate point in the second heat map to obtain the adjusted second candidate point.

[0067] Furthermore, the non-maximum suppression method can be used to remove duplicate points in the adjusted second candidate points, and the remaining second candidate points can be used as entry corner points to obtain the two-dimensional entry corner points output by the point and line detection model.

[0068] In this embodiment, the point feature is the feature information of the entrance corner point. The second candidate point is the pixel point that makes up the entrance corner point in the second heat map.

[0069] The second heatmap represents the second candidate points for the entrance corner, reflecting the probability that each pixel in the parking space image belongs to an entrance corner. The second offset is the offset of the predicted position of the second candidate point relative to its actual position, used to adjust the predicted position of the second candidate point to the actual entrance corner position.

[0070] As described above, by extracting point features from multiple frames of parking space images and generating a second heatmap and a second offset corresponding to the point features, the positioning error caused by factors such as image noise and distortion can be reduced. Based on the second heatmap and the second offset, the adjusted second candidate points of the entrance corner are determined. Duplicate points in the adjusted second candidate points are deleted, and the remaining second candidate points are used as the entrance corner points. This can avoid repeated calculations or misjudgments in subsequent processing, thereby improving the accuracy of parking space detection.

[0071] In one embodiment, the parking space detection system can perform distortion correction on the detected two-dimensional inner edge of the parking space and entrance corner point, and map the inner edge of the parking space and entrance corner point in the distorted parking space image onto the undistorted image through geometric transformation to obtain the corrected inner edge of the parking space and entrance corner point.

[0072] Based on the intrinsic parameter matrix of the monocular camera, the inverse matrix is ​​calculated using a matrix inversion algorithm. The inverse matrix is ​​then used to transform the parking space inner edge and entrance corner points from the image coordinate system to the camera coordinate system. The image coordinates of the parking space inner edge and entrance corner points are then projected onto a normalized plane, resulting in normalized parking space inner edge and entrance corner points that are unaffected by camera intrinsic parameters and distortion.

[0073] As described above, by performing distortion correction on the detected inner edge of the parking space and entrance corner, the influence of distortion on the inner edge of the parking space and entrance corner can be reduced. Based on the inverse matrix of the intrinsic parameter matrix of the monocular camera, the image coordinates of the inner edge of the parking space and entrance corner are projected onto the normalized plane to obtain the normalized inner edge of the parking space and entrance corner, reducing computational complexity and error sources, making subsequent detection of parking space lines simpler and more accurate.

[0074] In one embodiment of this application, before matching the entrance corner point and the inner edge of the parking space, the parking space detection system can obtain the position and orientation information of the vehicle corresponding to the parking space image through the vehicle positioning system, map matching algorithm, etc., based on the timestamp of the parking space image.

[0075] Based on the vehicle's pose information and the extrinsic parameters of the monocular camera, point and line triangulation algorithms are used to convert two-dimensional points or lines from the camera's perspective into three-dimensional positions or directions in the world coordinate system, thereby determining the three-dimensional positions of point and line information.

[0076] Parking space detection systems can use point triangulation algorithms to determine the 3D location of entrance corner points. For example, by minimizing projection errors, the system ensures that 2D entrance corner points observed from multiple frames of parking space images match the same 3D point, thus determining the 3D location of the entrance corner point.

[0077] Parking space detection systems can use line triangulation algorithms to determine the three-dimensional position of the lines within the parking space. For example, points along the lines within the parking space can be triangulated first, and then a three-dimensional straight line can be fitted using methods such as least squares. Alternatively, the geometric constraints of linear features in the parking space image can be directly used to estimate the three-dimensional direction or position of the lines within the parking space.

[0078] Because the vehicle and camera are constantly moving during operation, the observation perspective for the same point / line information will change. The parking space detection system analyzes the observation perspective of multiple frames of parking space images based on the three-dimensional positions of the entrance corner point and the inner edge of the parking space, and determines the maximum viewing perspective difference between the entrance corner point and the inner edge of the parking space in any two frames.

[0079] If the maximum viewing angle difference is greater than the preset threshold, it indicates that the point and line information has obvious positional changes between different frames of parking space images. This is more likely due to real motion or structural changes. The point and line information can be preserved, and it maintains relatively stable and significant features under different viewing angles.

[0080] If the maximum viewing angle difference is less than or equal to a preset threshold, delete the dot and line information and do not use the dot and line information in the multi-frame parking space image for dot and line matching and rectangularization.

[0081] In the embodiments of this application, the extrinsic parameters of a monocular camera refer to the position and orientation of the monocular camera in the world coordinate system, which are used to define the transformation relationship between the camera coordinate system and the world coordinate system. The extrinsic parameters can be fixed or obtained through camera calibration.

[0082] The maximum viewing angle difference is the maximum angular difference formed by the observation viewing angles of multiple frames of parking space images. A preset threshold is used to distinguish whether the viewing angle change is large enough to affect the accuracy of parking space detection.

[0083] Please refer to Figure 4, which illustrates a schematic diagram of the maximum viewing angle difference. For example, the observation frames of the multi-frame parking space image include observation frame A and observation frame B, and the viewing angle difference formed by observation frames A and B at the left entrance corner point 23 is the maximum viewing angle difference.

[0084] The parking space detection system compares the maximum viewing angle difference with a preset threshold. If the maximum viewing angle difference is greater than the preset threshold, the system uses the point and line information in the multi-frame parking space images for subsequent point and line matching and rectangularization.

[0085] As described above, by determining the three-dimensional position of point and line information based on the vehicle's pose information and the extrinsic parameters of the monocular camera, and then determining the maximum viewing angle difference of the point and line information based on the three-dimensional position, the point and line information is retained when the maximum viewing angle difference is greater than a preset threshold. This allows for a more accurate assessment of the visibility and consistency of point and line information under different viewing angles, thereby improving the accuracy of subsequent point and line matching.

[0086] In the foregoing embodiments, it was introduced that by using heatmaps and offsets corresponding to point-line features, and by verifying the maximum viewing angle difference of point-line information, the accuracy of parking line detection for mechanical parking spaces can be further improved. In the following embodiments, the point-line matching and rectangularization processes will be described in more detail, and these methods can be applied to any of the embodiments described above.

[0087] In one embodiment of this application, the entrance corner point may include: a first entrance corner point and a second entrance corner point. The inner edge of the parking space may include: a first inner edge and a second inner edge, wherein the first inner edge is the inner edge of the parking space closest to the first entrance corner point, and the second inner edge is the inner edge of the parking space closest to the second entrance corner point.

[0088] The parking space detection system can obtain the inner edge of the nearest parking space to each entrance corner point. It detects the distance between the entrance corner point and the inner edge of the nearest parking space, compares the distance value with a distance threshold, and obtains matching point-line pairs.

[0089] If the first distance between the first entrance corner point and the first inner edge is less than a distance threshold, the first entrance corner point and the first inner edge are paired as a point-line. If the second distance between the second entrance corner point and the second inner edge is less than a distance threshold, the second entrance corner point and the second inner edge are paired as a point-line.

[0090] In this embodiment, the first distance value is the distance between the first entrance corner point and the first inner edge. The first distance value may include at least one of the following: a horizontal distance value, a vertical distance value, and the distance between the first entrance corner point and the endpoint of the first inner edge closest to the first entrance corner point.

[0091] The second distance value is the distance value between the second entrance corner point and the second inner border line. The second distance value may include at least one of the following: a horizontal distance value, a vertical distance value, and the distance value between the second entrance corner point and the end point of the second inner border line that is closest to the second entrance corner point.

[0092] The first inner border line is a line inside the mechanical parking space that is close to one side boundary. The direction of the first inner border line is from the parking space entrance to the end of the parking space. The first inner border line may be the left inner border line of the mechanical parking space.

[0093] The second inner border line is a line inside the mechanical parking space that is close to the other side boundary. The direction of the second inner border line is from the parking space entrance to the end of the parking space. The second inner border line may be the right inner border line of the mechanical parking space.

[0094] The first inner border line and the second inner border line are relatively parallel or approximately parallel to each other, and jointly define the inner space of the mechanical parking space.

[0095] The first entrance corner point is a corner point at the entrance of the mechanical parking space, marking the start of one side boundary of the parking space. The first entrance corner point may be the left entrance corner point of the mechanical parking space. The second entrance corner point corresponds to the first entrance corner point. The second entrance corner point is another corner point at the entrance of the mechanical parking space, marking the start of the other side boundary of the parking space. The second entrance corner point may be the right entrance corner point of the mechanical parking space.

[0096] Please refer to FIG. 5, which shows a schematic diagram of a matching point-line pair. Exemplarily, the first entrance corner point is the left entrance corner point 23, and the second entrance corner point is the right entrance corner point 24. The first inner border line closest to the left entrance corner point 23 is the left inner border line 21, and the second inner border line closest to the right entrance corner point 24 is the right inner border line 22.

[0097] When both the horizontal distance value and the vertical distance value between the left entrance corner point 23 and the left inner border line 21 are less than the distance threshold, the left entrance corner point 23 and the left inner border line 21 are combined to form a left point-line pair. When both the horizontal distance value and the vertical distance value between the right entrance corner point 24 and the right inner border line 22 are less than the distance threshold, the right entrance corner point 24 and the right inner border line 22 are combined to form a right point-line pair.

[0098] As described above, by forming a left point-line pair with the first entrance corner point and the first inner border line closest to it when the first distance value between the first entrance corner point and the first inner border line is less than the distance threshold, and forming a right point-line pair with the second entrance corner point and the second inner border line closest to it when the second distance value between the second entrance corner point and the second inner border line is less than the distance threshold, the corner points can be accurately paired with the corresponding inner border lines, filtering out some incorrect pairings caused by errors, more accurately determining the boundary of the mechanical parking space, and thus improving the accuracy of parking space detection.

[0099] In an embodiment of the present application, the dot-line pairs may include: multiple first dot-line pairs and multiple second dot-line pairs. Among them, the first dot-line pair may be a dot-line pair composed of a first entrance corner point and a first inner along-line, that is, the left dot-line pair. The second dot-line pair may be a dot-line pair composed of a second entrance corner point and a second inner along-line, that is, the right dot-line pair.

[0100] The parking space detection system can match multiple first dot-line pairs and multiple second dot-line pairs, and form the matching dot-line pairs of the same mechanical parking space with the matched first dot-line pairs and second dot-line pairs.

[0101] Please refer to FIG. 6. FIG. 6 shows a schematic diagram of searching for matching dot-line pairs. For each first dot-line pair, search in the direction towards the inside of the mechanical parking space (for example, search to the right in FIG. 6) for the second dot-line pair with the closest distance. For each second dot-line pair, search in the direction towards the inside of the mechanical parking space (for example, search to the left in FIG. 6) for the first dot-line pair with the closest distance. The first dot-line pair and the second dot-line pair with the closest distance are used as the matching dot-line pairs.

[0102] The parking space detection system can also verify whether the distance value between the first dot-line pair and the second dot-line pair with the closest distance exceeds a preset distance value. When the distance value between the first dot-line pair and the second dot-line pair with the closest distance exceeds the preset distance value, the first dot-line pair and the second dot-line pair with the closest distance are used as the matching dot-line pairs. In the embodiments of the present application, the distance value between the first dot-line pair and the second dot-line pair with the closest distance can be obtained in the following way: calculate the first distance from the first entrance corner point in the first dot-line pair to the second inner along-line in the second dot-line pair; calculate the second distance from the second entrance corner point in the second dot-line pair to the first inner along-line in the first dot-line pair; calculate the average value of the first distance and the second distance, and use this average value as the distance value between the first dot-line pair and the second dot-line pair with the closest distance. However, the embodiments of the present application are not limited to this. In addition, the above preset distance value can be set according to the size of a conventional mechanical parking space. For example, it can be within the range greater than or equal to 1.8 meters and less than or equal to 2.4 m. However, the embodiments of the present application are not limited to this.

[0103] The parking space detection system can perform rectangularization processing on the first dot-line pair and the second dot-line pair in each matching dot-line pair to obtain the parking space lines of the mechanical parking space corresponding to each matching dot-line pair.

[0104] In the embodiments of the present application, the matching dot-line pair is composed of the first dot-line pair and the second dot-line pair of the same mechanical parking space, and is used to identify the position and boundary information of the mechanical parking space.

[0105] As described above, by searching for the nearest second point line pair in the direction towards the inside of the mechanical parking space (e.g., to the right) for each first point line pair, and searching for the nearest first point line pair in the direction towards the inside of the mechanical parking space (e.g., to the left) for each second point line pair, and using the nearest first point line pair and second point line pair as the matching point line pair, mismatches caused by factors such as noise, occlusion, or changes in viewing angle can be reduced. By performing rectangular processing on the first point line pair and the second point line pair in each matching point line pair to obtain the parking space line corresponding to the matching point line pair, it can be ensured that each mechanical parking space is completely and accurately detected.

[0106] In one embodiment of this application, please refer to Figure 7, which shows a schematic diagram of the rectangular processing of point-line pairs. The parking space detection system can obtain the average angle between the first point-line pair and the second point-line pair that make up the same mechanical parking space, and use the direction of the average angle as the parking space direction of the mechanical parking space. In this embodiment of the application, the direction of the average angle can refer to the extension direction of the angle bisector of the acute angle between the first inner edge of the first point-line pair and the second inner edge of the second point-line pair.

[0107] Replace the directions of the first and second point-line pairs with the direction of the parking space. Using the entrance corner point of the first point-line pair as a reference point, rotate the first point-line pair to obtain a left boundary line parallel to the parking space direction. Using the entrance corner point of the second point-line pair as a reference point, rotate the second point-line pair to obtain a right boundary line parallel to the parking space direction.

[0108] Project the first entrance corner point of the first point-line pair onto the parking space direction to obtain the left projection point 71. Project the second entrance corner point of the second point-line pair onto the parking space direction to obtain the right projection point 72. Take the midpoint between the left and right projection points as the projection midpoint 73.

[0109] The front boundary line is constructed based on the projection midpoint, the left boundary line, and the right boundary line. In this embodiment, the front boundary line can be constructed as follows: the projection point of the projection midpoint 73 onto the left boundary line (or its extension) is taken as the final left entrance corner point; the projection point of the projection midpoint 73 onto the right boundary line (or its extension) is taken as the final right entrance corner point; and the line segment between the final left and right entrance corner points is taken as the front boundary line. In other words, by drawing perpendicular lines from the projection midpoint 73 to the left and right boundary lines respectively, and taking the feet of these perpendiculars on the left and right boundary lines as the final left and right entrance corner points respectively, the line segment between the final left and right entrance corner points is taken as the front boundary line.

[0110] In this embodiment, the mean angle is the mean of the angles formed by the first and second point-line pairs. The projection midpoint is the midpoint between the left and right projection points. Parking space lines may include: the front boundary line, left boundary line, and right boundary line of the mechanical parking space.

[0111] As described above, by taking the direction of the average angle formed by the first and second point-line pairs in the point-line pair as the parking direction of the mechanical parking space, the first and second point-line pairs are rotated respectively to obtain the left and right boundary lines parallel to the parking direction, reducing the recognition error caused by angle deviation. The first and second entrance corner points are projected onto the parking direction to obtain the left and right projection points. Based on the midpoint of the projection between the left and right projection points, the left boundary line, and the right boundary line, the front boundary line is constructed, providing an accurate reference point for constructing the front boundary line, thereby improving the detection accuracy of the mechanical parking space.

[0112] In one embodiment of this application, during the process of a vehicle driving into a mechanical parking space, the parking space detection system can use deep learning models, image processing and other methods to continuously detect the end corner points and wheel chock positions of the mechanical parking spaces in the latest multi-frame parking space images.

[0113] The rear boundary line is determined based on the end point and wheel chock position. For example, the rear boundary line can be constructed by connecting the end point and wheel chock position using linear interpolation or curve fitting.

[0114] In this embodiment, the end point is the intersection of the inner edge of the parking space and the rear boundary line of the mechanical parking space, used to represent the end point of the mechanical parking space in the length direction. The end point may include the left end point and the right end point of the mechanical parking space. The wheel chock position is the specific location of the wheel chock in the parking space image.

[0115] As described above, by detecting the end corner points in multiple frames of parking space images, and based on the end corner points and the wheel chock positions of the mechanical parking spaces, the rear boundary line of the mechanical parking spaces can be determined. The rear boundary is identified by using the end corner points, and combined with the wheel chock positions, the rear boundary line of the mechanical parking spaces can be determined more accurately.

[0116] To further illustrate the detection method for mechanical parking spaces, Figure 8 shows a flowchart of another detection method for mechanical parking spaces, which may include the following steps 802 to 820.

[0117] In step 802, based on the inner edge features in the multi-frame parking space images, a first heatmap and a first offset corresponding to the inner edge features are generated.

[0118] In this step, the parking space detection system inputs each frame of parking space image into the point-line detection model, and uses the point-line detection model to fuse multiple frames of parking space images and high-precision inner edge detection, extracts the inner edge features in the multiple frames of parking space images, and generates the first heat map and the first offset corresponding to the inner edge features.

[0119] In step 804, the first candidate points along the inner edge of the parking space are clustered and fitted to obtain the inner edge of the parking space.

[0120] In this step, the parking space detection system selects the first candidate point along the inner edge of the parking space in the first heat map, adjusts the first candidate point using the first offset, and performs clustering and fitting on the adjusted first candidate point to obtain the inner edge of the parking space.

[0121] In step 806, a second heatmap and a second offset corresponding to the point features are generated based on the point features in the multi-frame parking space images.

[0122] In this step, the parking space detection system uses a point-line detection model to fuse multiple frames of parking space images and high-precision corner point detection, extracts point features from the multiple frames of parking space images, and generates a second heatmap and a second offset corresponding to the point features.

[0123] In step 808, duplicate points in the second candidate points of the entry corner are deleted, and the second candidate point is used as the entry corner point.

[0124] In this step, the parking space detection system selects the second candidate point of the entrance corner in the second heat map, adjusts the second candidate point using the second offset, deletes duplicate points in the adjusted second candidate point, and uses the remaining second candidate point as the entrance corner point.

[0125] In step 810, if the maximum viewing angle difference is greater than a preset threshold, the entrance corner point and the inner edge of the parking space are retained.

[0126] In this step, the parking space detection system determines the three-dimensional position of the point and line information based on the vehicle's pose information and the extrinsic parameters of the monocular camera. Based on the three-dimensional position of the point and line information, the system determines the maximum viewing angle difference formed by the observation perspectives of multiple frames of parking space images.

[0127] Based on the maximum viewing angle difference, point and line information is filtered. When the maximum viewing angle difference is greater than a preset threshold, the entrance corner point and the inner edge of the parking space in multiple frames of parking space images are retained.

[0128] In step 812, if the first distance value is less than the distance threshold, the first entrance corner point and the first inner edge line are paired to form a point-line pair.

[0129] In this step, if the first distance between the first entrance corner point and the first inner edge is less than the distance threshold, the parking space detection system will form a point-line pair between the first entrance corner point and the first inner edge.

[0130] In step 814, if the second distance value is less than the distance threshold, the second entrance corner point and the second inner edge line are paired to form a point-line pair.

[0131] In this step, if the second distance value between the second entrance corner point and the second inner edge is less than the distance threshold, the parking space detection system will form a point-line pair between the second entrance corner point and the second inner edge.

[0132] In step 816, the closest first point-line pair and second point-line pair are selected as the matching point-line pair.

[0133] In this step, for each first point-line pair, the parking space detection system searches to the right for the nearest second point-line pair, and for each second point-line pair, searches to the left for the nearest first point-line pair. If the distance between the nearest first point-line pair and the nearest second point-line pair exceeds a preset distance value, the nearest first point-line pair and the nearest second point-line pair are selected as the matching point-line pair.

[0134] In step 818, the first and second point pairs in the matching point-line pairs are rectangularized to obtain the parking space lines corresponding to the matching point-line pairs.

[0135] In this step, the parking space detection system uses the direction of the average angle between the first and second point-line pairs in the matching point-line pair as the parking space orientation of the mechanical parking space. The first point-line pair is rotated to obtain a left boundary line parallel to the parking space orientation. The second point-line pair is rotated to obtain a right boundary line parallel to the parking space orientation.

[0136] Project the first entrance corner point of the first point line pair onto the parking space direction to obtain the left projection point. Project the second entrance corner point of the second point line pair onto the parking space direction to obtain the right projection point. Take the midpoint between the left and right projection points as the projection midpoint.

[0137] The projection point on the left boundary line from the midpoint of the projection is taken as the final left entrance corner point, and the projection point on the right boundary line from the midpoint of the projection is taken as the final right entrance corner point. The line segment between the final left entrance corner point and the right entrance corner point is taken as the front boundary line.

[0138] In step 820, the rear boundary line is determined based on the end corner point and the wheel stop position.

[0139] In this step, as the vehicle drives into the mechanical parking space, the parking space detection system continuously detects the end point and the wheel chock position of the mechanical parking space in the latest multi-frame parking space images, and determines the rear boundary line based on the end point and wheel chock position.

[0140] Figure 9 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this application. This electronic device may be, for example, a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, personal digital assistant, server, smart home appliance, in-vehicle system, etc. Referring to Figure 9, at the hardware level, the electronic device includes at least one processor 902, an internal bus 904, a network interface 906, at least one memory 908, and at least one non-volatile memory 910, and may also include other hardware required for business operations. The processor 902 reads the corresponding computer program from the non-volatile memory 910 into the memory 908 and then runs it, forming a mechanical parking detection device at the logical level. Of course, besides software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but may also be hardware or logic devices.

[0141] Figure 10 is a block diagram of a mechanical parking space detection device according to an exemplary embodiment of this application. Referring to Figure 10, the device may include: a detection module 1002, a matching module 1004, and a processing module 1006.

[0142] The detection module 1002 is configured to detect multiple frames of parking space images and obtain point and line information in the multiple frames of parking space images; wherein, the multiple frames of parking space images are obtained by taking pictures of mechanical parking spaces with a monocular camera, and the point and line information includes: the entrance corner point of the mechanical parking space and the inner edge of the parking space, and the direction of the inner edge of the parking space is from the entrance of the parking space to the end of the parking space.

[0143] The matching module 1004 is configured to match the entrance corner point and the inner edge of the parking space to obtain the point-line pair of the mechanical parking space.

[0144] The processing module 1006 is configured to perform rectangular processing on the point-line pair to obtain the parking line of the mechanical parking space.

[0145] In one example, before matching the entrance corner point and the inner line of the parking space to obtain the point-line pair of the mechanical parking space, the matching module 1004 is further configured to: determine the three-dimensional position of the point-line information based on the vehicle's pose information and the extrinsic parameters of the monocular camera; determine the maximum viewing angle difference of the point-line information based on the three-dimensional position, wherein the maximum viewing angle difference is the maximum angle difference formed by the observation viewing angles of multiple frames of parking space images; and retain the point-line information if the maximum viewing angle difference is greater than a preset threshold.

[0146] In one example, when the detection module 1002 detects multiple frames of parking space images and obtains point and line information in the multiple frames of parking space images, it includes: extracting inner edge features from the multiple frames of parking space images, generating a first heatmap and a first offset corresponding to the inner edge features; determining first candidate points of the inner edge of the parking space based on the first heatmap and the first offset; and clustering and fitting the candidate points to obtain the inner edge of the parking space.

[0147] In one example, when the detection module 1002 detects multiple frames of parking space images and obtains point and line information in the multiple frames of parking space images, it includes: extracting point features from the multiple frames of parking space images, generating a second heatmap and a second offset corresponding to the point features; determining a second candidate point for the entrance corner based on the second heatmap and the second offset; deleting duplicate points in the second candidate points, and using the second candidate points as the entrance corner points.

[0148] In one example, the entrance corner points include: a first entrance corner point and a second entrance corner point; the parking space inner edge includes: a first inner edge and a second inner edge, wherein the first inner edge is the parking space inner edge closest to the first entrance corner point, and the second inner edge is the parking space inner edge closest to the second entrance corner point; the matching module 1004, when matching the entrance corner points and the parking space inner edges to obtain point-line pairs for mechanical parking spaces, includes: if the first distance value is less than a distance threshold, forming a point-line pair between the first entrance corner point and the first inner edge; if the second distance value is less than a distance threshold, forming a point-line pair between the second entrance corner point and the second inner edge; wherein the first distance value is the distance between the first entrance corner point and the first inner edge, and the second distance value is the distance between the second entrance corner point and the second inner edge.

[0149] In one example, the point-line pair includes: multiple first point-line pairs and multiple second point-line pairs; before processing the point-line pairs to obtain the parking lines of the mechanical parking spaces, the processing module 1006 is further configured to: for each first point-line pair, search for the nearest second point-line pair in the direction towards the inside of the mechanical parking space; for each second point-line pair, search for the nearest first point-line pair in the direction towards the inside of the mechanical parking space; and take the nearest first point-line pair and second point-line pair as matching point-line pairs; when processing the point-line pairs to obtain the parking lines of the mechanical parking spaces, the processing module 1006 includes: processing the first point-line pairs and second point-line pairs in each matching point-line pair to obtain the parking lines corresponding to each matching point-line pair.

[0150] In one example, the processing module 1006 is also configured to detect the end corner point and the wheel chock position of the mechanical parking space in the multi-frame parking space image; the end corner point is the intersection of the inner edge of the parking space and the rear boundary line of the mechanical parking space; and the rear boundary line is determined based on the end corner point and the wheel chock position.

[0151] In one example, the parking space lines include: a front boundary line, a left boundary line, and a right boundary line. When processing the point-line pairs to obtain the parking space lines of the mechanical parking space, the processing module 1006 performs rectangular processing on the point-line pairs to obtain the parking space lines of the mechanical parking space, including: taking the direction of the mean angle as the parking space direction of the mechanical parking space; wherein, the mean angle is the mean of the angle formed by the first point-line pair and the second point-line pair in the point-line pair; rotating the first point-line pair to obtain a left boundary line parallel to the parking space direction; rotating the second point-line pair to obtain a right boundary line parallel to the parking space direction; projecting the first entrance corner point in the first point-line pair onto the parking space direction to obtain a left projection point; projecting the second entrance corner point in the second point-line pair onto the parking space direction to obtain a right projection point; constructing the front boundary line based on the projection midpoint, the left boundary line, and the right boundary line, wherein the projection midpoint is the midpoint between the left projection point and the right projection point.

[0152] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0153] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative, and the modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0154] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, is also provided, which can be executed by a processor of a mechanical parking detection device to implement the method as described in any of the above embodiments.

[0155] In the embodiments of this application, the non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a read-only optical disc (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc., and this application does not limit it to this.

[0156] In an exemplary embodiment of this application, a computer program product including a computer program / instructions is also provided, which can be executed by the processor of the detection device of the mechanical parking space to implement the method described in any of the above embodiments.

[0157] In an exemplary embodiment of this application, a vehicle is also provided, including a mechanical parking space detection device as described in the above embodiments, or a non-transitory computer-readable storage medium, or a computer program product, or an electronic device.

[0158] As can be seen from the above embodiments, by detecting multiple frames of parking space images, point and line information in the multiple frames of parking space images is obtained. The entrance corner point and the inner edge of the parking space in the point and line information are matched to obtain the point and line pairs of mechanical parking spaces. The point and line pairs are rectangularized to obtain the parking space lines of mechanical parking spaces. Through multi-frame image processing and point and line matching, the parking space lines of mechanical parking spaces can be accurately identified, thereby improving the accuracy of parking space detection.

[0159] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0160] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments described herein. This application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and alterations can be made without departing from its scope. The scope of this application is limited only by the appended claims.

[0161] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the scope of protection of this application.

Claims

1. A method for detecting mechanical parking spaces, comprising: Detection is performed on multiple frames of parking space images to obtain point and line information in the multiple frames of parking space images; wherein, the multiple frames of parking space images are obtained by capturing the mechanical parking space with a monocular camera, and the point and line information includes: the entrance corner point of the mechanical parking space and the inner edge of the parking space, wherein the direction of the inner edge of the parking space is from the entrance of the parking space to the end of the parking space; Match the entrance corner point with the inner edge of the parking space to obtain the point-line pair of the mechanical parking space; The point-line pairs are rectangularized to obtain the parking lines of the mechanical parking spaces.

2. The method according to claim 1, wherein, Before matching the entrance corner point and the inner line of the parking space to obtain the point-line pair of the mechanical parking space, the method further includes: The three-dimensional position of the point and line information is determined based on the vehicle's pose information and the extrinsic parameters of the monocular camera. Based on the three-dimensional position, the maximum viewing angle difference of the point and line information is determined. The maximum viewing angle difference is the maximum angle difference formed by the observation viewing angle of the multi-frame parking space image. If the maximum viewing angle difference is greater than a preset threshold, the dot and line information is retained.

3. The method according to claim 1 or 2, wherein, The step of detecting multiple frames of parking space images to obtain point and line information in the multiple frames of parking space images includes: Extract the inner edge features from the multi-frame parking space images, and generate a first heatmap and a first offset corresponding to the inner edge features; Based on the first heat map and the first offset, the first candidate point along the line inside the parking space is determined; Clustering and fitting are performed on the first candidate points to obtain the inner edge of the parking space.

4. The method according to any one of claims 1 to 3, wherein, The step of detecting multiple frames of parking space images to obtain point and line information in the multiple frames of parking space images includes: Extract point features from the multi-frame parking space images to generate a second heatmap and a second offset corresponding to the point features; Based on the second heatmap and the second offset, a second candidate point for the inlet corner point is determined; Delete duplicate points in the second candidate points, and use the remaining points in the second candidate points as the entry corner points.

5. The method according to any one of claims 1 to 4, wherein, The entrance corner points include: a first entrance corner point and a second entrance corner point; the inner edge of the parking space includes: a first inner edge and a second inner edge, wherein the first inner edge is the inner edge of the parking space that is closest to the first entrance corner point, and the second inner edge is the inner edge of the parking space that is closest to the second entrance corner point; The process of matching the entrance corner point and the inner edge of the parking space to obtain the point-line pair of the mechanical parking space includes: If the first distance value is less than the distance threshold, the first entrance corner point and the first inner edge line are combined to form the point-line pair, where the first distance value is the distance between the first entrance corner point and the first inner edge line. If the second distance value is less than the distance threshold, the second entrance corner point and the second inner edge line are combined to form the point-line pair, where the second distance value is the distance between the second entrance corner point and the second inner edge line.

6. The method according to any one of claims 1 to 5, wherein, The point-line pair includes: multiple first point-line pairs and multiple second point-line pairs; Before performing rectangularization on the point-line pairs to obtain the parking space lines of the mechanical parking spaces, the method further includes: For each of the plurality of first point line pairs, search for the nearest second point line pair in the direction toward the inside of the mechanical parking space; For each of the plurality of second point line pairs, search for the nearest first point line pair in the direction toward the inside of the mechanical parking space; The closest point-line pair and the closest point-line pair are used as the matching point-line pair; The process of rectangularizing the point-line pairs to obtain the parking space lines of the mechanical parking spaces includes: The first and second point pairs in each matching point-line pair are rectangularized to obtain the parking space lines corresponding to each matching point-line pair.

7. The method according to claim 6, wherein, The step of selecting the closest first and second point-line pairs as matching point-line pairs includes: Determine whether the distance between the closest first point line pair and the second point line pair is greater than a preset distance value; In response to determining that the distance between the nearest first point line pair and the nearest second point line pair is greater than the preset distance value, the nearest first point line pair and the nearest second point line pair are taken as the matching point line pair.

8. The method according to any one of claims 1 to 7, further comprising: Detect the end corner points and the wheel chock positions of the mechanical parking spaces in the multi-frame parking space images; The end point is the intersection of the inner edge of the parking space and the rear boundary line of the mechanical parking space; The rear boundary line is determined based on the end point and the wheel stop position.

9. The method according to any one of claims 1 to 8, wherein, The parking space lines include: the front boundary line, the left boundary line, and the right boundary line; The process of rectangularizing the point-line pairs to obtain the parking space lines of the mechanical parking spaces includes: The direction of the mean angle is taken as the parking direction of the mechanical parking space; wherein, the mean angle is the mean of the angle formed by the first point-line pair and the second point-line pair in the point-line pair; Rotate the first point line pair to obtain the left boundary line parallel to the parking space direction; Rotate the second point line pair to obtain the right boundary line parallel to the parking space direction; Project the first entrance corner point in the first point line pair onto the parking space direction to obtain the left projection point; Project the second entrance corner point in the second point line pair onto the parking space direction to obtain the right projection point; The front boundary line is constructed based on the projection midpoint, the left boundary line, and the right boundary line, wherein the projection midpoint is the midpoint between the left projection point and the right projection point.

10. The method according to claim 9, wherein, The construction of the front boundary line based on the projection midpoint, the left boundary line, and the right boundary line includes: The projection point on the left boundary line, which is orthographically projected from the midpoint of the projection, is taken as the left entrance corner point; The projection point on the right boundary line, which is orthographically projected from the midpoint of the projection, is taken as the right entrance corner point; The line segment between the left entrance corner point and the right entrance corner point is taken as the front boundary line.

11. A detection device for a mechanical parking space, comprising: The detection module is configured to detect multiple frames of parking space images and obtain point and line information in the multiple frames of parking space images; wherein, the multiple frames of parking space images are obtained by capturing the mechanical parking space with a monocular camera, and the point and line information includes: the entrance corner point of the mechanical parking space and the inner edge of the parking space, wherein the direction of the inner edge of the parking space is from the entrance of the parking space to the end of the parking space; The matching module is configured to match the entrance corner point and the inner edge of the parking space to obtain the point-line pair of the mechanical parking space; The processing module is configured to perform rectangular processing on the point-line pairs to obtain the parking lines of the mechanical parking spaces.

12. An electronic device, comprising: At least one processor; At least one memory, communicatively connected to the at least one processor, the at least one memory storing computer-executable instructions. The at least one processor is configured to read the computer-executable instructions from the at least one memory and execute the computer-executable instructions to implement the method as described in any one of claims 1 to 10.

13. A non-transitory computer-readable storage medium, wherein, The non-transitory computer-readable storage medium stores computer-executable instructions that, when executed by at least one processor, implement the method as described in any one of claims 1 to 10.

14. A computer program product comprising a computer program that, when executed by at least one processor, implements the method as described in any one of claims 1 to 10.

15. A vehicle comprising: The detection device for mechanical parking spaces as described in claim 11, or The electronic device as claimed in claim 12, or The non-transitory computer-readable storage medium as described in claim 13, or The computer program product as described in claim 14.