Parking space orientation detection method and apparatus, device, medium, product, and vehicle

By using a monocular camera to detect the inner edge of the parking space, first and second planes are constructed. The direction of the mechanical parking space is determined by the intersecting straight lines of the planes, which solves the detection error problem caused by the ground plane assumption and realizes accurate detection of the direction of the mechanical parking space.

WO2026149544A1PCT 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

Existing parking space orientation detection methods are usually based on the ground plane assumption, which cannot accurately estimate the orientation of mechanical parking spaces, resulting in large detection errors.

Method used

By detecting the inner edge of the parking space in the parking space image using a monocular camera, first and second planes are constructed. The direction of the mechanical parking space is determined by the straight line intersecting these two planes, eliminating the limitation of the ground plane assumption.

Benefits of technology

It achieves accurate detection of the orientation of mechanical parking spaces, reduces errors caused by factors such as image perspective and camera angle, and improves the accuracy and real-time performance of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026071693_16072026_PF_FP_ABST
    Figure CN2026071693_16072026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a parking space orientation detection method and apparatus for a mechanical parking space, a device, a medium, a product, and a vehicle. The method comprises: detecting parking space inner edge lines in a parking space image, wherein the parking space image is obtained by photographing a mechanical parking space by means of a monocular camera, the direction of the parking space inner edge lines is a direction from a parking space entrance to the end of the parking space, and the parking space inner edge lines comprise: a first inner edge line and a second inner edge line; constructing a first plane on the basis of the first inner edge line and the optical center position of the monocular camera; constructing a second plane on the basis of the second inner edge line and the optical center position; and determining a parking space orientation of the mechanical parking space on the basis of a straight line where the first plane and the second plane intersect.
Need to check novelty before this filing date? Find Prior Art

Description

Parking space orientation detection methods, devices, equipment, media, products and vehicles Cross-references to related applications

[0001] This disclosure claims priority to Chinese patent application No. 202510034886.X, 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, equipment, medium, product, and vehicle for detecting the parking direction of a mechanical parking space. Background Technology

[0003] With the continuous increase in the number of vehicles, the problem of parking difficulties in cities is becoming increasingly prominent. Mechanical parking spaces, as a parking method that efficiently utilizes space resources, are being used more and more widely.

[0004] Current parking space orientation detection methods are usually based on the ground plane assumption, which assumes that the parking space plane and the plane where the vehicle is located are the same plane, and then estimate the position and angle of the parking space. Summary of the Invention

[0005] 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.

[0006] This application provides a method, apparatus, equipment, medium, product, and vehicle for detecting the parking direction of a mechanical parking space.

[0007] According to a first aspect of any embodiment of this application, a method for detecting the parking direction of a mechanical parking space is provided. The method includes: detecting the inner edge of a parking space in a parking space image; wherein the parking space image is obtained by capturing the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is along the direction from the parking space entrance to the end of the parking space, and the inner edge of the parking space includes: a first inner edge and a second inner edge; constructing a first plane based on the first inner edge and the optical center position of the monocular camera; constructing a second plane based on the second inner edge and the optical center position; and determining the parking direction of the mechanical parking space according to the straight line intersecting the first plane and the second plane.

[0008] According to a second aspect of any embodiment of this application, a parking space orientation detection device for mechanical parking spaces is provided. The device includes: an inner edge detection module configured to detect the inner edge of a parking space in a parking space image; wherein the parking space image is obtained by capturing the mechanical parking space with a monocular camera, and the direction of the inner edge of the parking space is along the direction from the parking space entrance to the end of the parking space, and the inner edge of the parking space includes: a first inner edge and a second inner edge; a first plane construction module configured to construct a first plane based on the first inner edge and the optical center position of the monocular camera; a second plane construction module configured to construct a second plane based on the second inner edge and the optical center position; and a direction determination module configured to determine the parking space orientation of the mechanical parking space based on the straight line intersecting the first plane and the second plane.

[0009] 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.

[0010] 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.

[0011] 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.

[0012] According to a sixth aspect of any embodiment of this application, a vehicle is provided, including a parking space orientation detection device for a mechanical parking space 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.

[0013] 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

[0014] 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 disclosed herein.

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

[0016] Figure 2 is a schematic diagram of the inner edge of a parking space in a parking space image according to an exemplary embodiment of this application.

[0017] Figure 3 is a schematic diagram of a normalized plane according to an exemplary embodiment of this application.

[0018] Figure 4 is a schematic diagram of a first plane and a second plane according to an exemplary embodiment of this application.

[0019] Figure 5 is a flowchart illustrating a method for detecting the inner edge of a parking space according to an exemplary embodiment of this application.

[0020] Figure 6 is a flowchart illustrating another mechanical parking space orientation detection method according to an exemplary embodiment of this application.

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

[0022] Figure 8 is a block diagram of a parking space orientation detection device for a mechanical parking space according to an exemplary embodiment of this application. Detailed Implementation

[0023] 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.

[0024] 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.

[0025] 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."

[0026] In an optional implementation, the parking space orientation detection method is typically based on the ground plane assumption, that is, assuming that the parking space plane and the plane where the vehicle is located are the same plane, and estimating the position and angle of the parking space.

[0027] However, due to the special structure and operation of mechanical parking spaces, they often do not meet the ground plane assumption. Mechanical parking spaces are often located at different heights or tilt angles, resulting in a large difference between the parking space plane and the plane where the vehicle is located, making it impossible to accurately estimate the parking space orientation.

[0028] In view of this, this application proposes a parking space orientation detection method for 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 parking space orientation detection method for a mechanical parking space according to an exemplary embodiment of this application. This parking space orientation detection method can be executed by a parking space detection system, which can be applied to vehicles or cloud servers.

[0030] The parking space orientation detection method may include the following steps 102 to 108.

[0031] In step 102, the inner edge of the parking space in the parking space image is detected; wherein, the parking space image is obtained by taking pictures of the mechanical parking space with a monocular camera, and the direction of the inner edge of the parking space is along the direction from the entrance of the parking space to the end of the parking space, and the inner edge of the parking space includes: a first inner edge and a second inner edge.

[0032] In this step, the parking space detection system uses the vehicle's monocular camera to capture images of the mechanical parking spaces, obtaining images that include the inner edges of the spaces. The parking space detection system can utilize edge detection algorithms such as Canny and Sobel to highlight edge information in the parking space images.

[0033] The parking space detection system can use a deep learning model to detect parking space images and obtain the inner edge of the parking space in the image.

[0034] The parking space detection system can also use line detection algorithms such as Hough Transform and Line Segment Detector (LSD) to detect line segments in the parking space image. Based on the geometric characteristics and relative positional relationship of the mechanical parking space, line segments of the first inner edge and the second inner edge are selected. This application embodiment does not limit this.

[0035] In this embodiment, a monocular camera refers to a camera system that captures image information using only one lens, and captures light and generates a two-dimensional image using an image sensor. A monocular camera can be a single-lens camera, a pinhole camera, etc.

[0036] The parking space image is obtained by taking a picture of the mechanical parking space with a monocular camera; it is a single-frame image. The parking space image may include the inner edge of the parking space.

[0037] The inner edge of a parking space is a line that defines the left and right boundaries of the mechanical parking space. The direction of the inner edge of the parking space is from the entrance to the end of the parking space. The inner edge of the parking space may include: a first inner edge and a second inner edge.

[0038] The first inner edge line is the line inside the mechanical parking space near one side boundary. The direction of the first inner edge line is along the parking space entrance to the end of the parking space. The first inner edge line can be the left inner edge line of the mechanical parking space.

[0039] The second inner edge is the line inside the mechanical parking space that is close to the other side boundary. The direction of the second inner edge is along the parking space entrance to the end of the parking space. The second inner edge can be the right inner edge of the mechanical parking space.

[0040] The first inner edge line and the second inner edge line are relatively parallel and together define the internal space of the mechanical parking space.

[0041] Please refer to Figure 2, which shows a schematic diagram of the inner edge of a parking space in a parking space image. Taking the first inner edge as the left inner edge 21 and the second inner edge as the right inner edge 22 as an example, the parking space detection system can obtain a parking space image by taking a picture of the mechanical parking space with a monocular camera, and detect the left inner edge 21 and the right inner edge 22 in the parking space image.

[0042] It is understandable that the first and second inner edges shown in Figure 2 are just examples. The inner edge of the parking space is not limited to the line segment connecting the entrance of the parking space to the end of the parking space. The inner edge of the parking space can form a plane with the optical center position of the monocular camera.

[0043] In one embodiment of this application, the parking space detection system can use the distortion parameters of a monocular camera to perform distortion correction on the inner edge of the parking space, and map each pixel on the inner edge of the parking space in the distorted parking space image to the distortion-free image through geometric transformation.

[0044] Calculate the corresponding position of each pixel in the distortion-free image to obtain the corrected inner edge line. The set of coordinates of these pixels in the distortion-free image constitutes the corrected inner edge line. Based on the intrinsic parameter matrix of the monocular camera, calculate the inverse matrix of the intrinsic parameter matrix using a matrix inversion algorithm.

[0045] The parking space detection system is based on an inverse matrix. It uses the inverse matrix of the intrinsic parameter matrix to transform each pixel on the calibration inner edge from the image coordinate system to the camera coordinate system. The image coordinates of the calibration inner edge are projected onto the normalization plane to obtain the normalized first inner edge and second inner edge. The system obtains the first inner edge and second inner edge that are normalized relative to the camera optical center and are not affected by camera intrinsic parameters and distortion.

[0046] In this embodiment, the distortion parameters are obtained during the calibration process of the monocular camera. These distortion parameters may include intrinsic parameters such as the camera's focal length and optical center, as well as distortion coefficients such as radial distortion coefficient and tangential distortion coefficient. The corrected inner edge line is the inner edge line of the parking space after removing distortion caused by the monocular camera.

[0047] The intrinsic parameter matrix describes the internal optical characteristics and geometric relationships of the camera. It can include information such as the focal length, optical center position, image scaling factor, and tilt factor of the monocular camera. The inverse of the intrinsic parameter matrix is ​​used to remove the influence of camera intrinsic parameters from the image coordinates.

[0048] The normalized plane is a virtual plane whose origin is located at the camera's optical center, and all coordinates are normalized to the same scale. The normalized plane is usually defined as the plane with z=1 in the camera coordinate system.

[0049] Please refer to Figure 3, which shows a schematic diagram of a normalized plane. The camera coordinate system Oc-XcYcZc shown in Figure 3 is established based on the optical center position of the monocular camera, with the Zc axis pointing directly in front of the camera. The parking space detection system projects the image coordinates of the corrected inner edge onto the normalized plane 31 to obtain the normalized first and second inner edges.

[0050] As described above, by using the distortion parameters of a monocular camera to correct the distortion of the inner edge of the parking space, a corrected inner edge can be obtained, which can eliminate or reduce the influence of distortion on the inner edge of the parking space. Based on the intrinsic parameter matrix of the monocular camera, the inverse matrix of the intrinsic parameter matrix is ​​calculated. Based on the inverse matrix, the image coordinates of the corrected inner edge are projected onto the normalized plane to obtain the normalized first and second inner edges, reducing computational complexity and error sources, making subsequent plane construction simpler and more accurate.

[0051] In step 104, a first plane is constructed based on the first inner edge line and the optical center position of the monocular camera.

[0052] In this step, the parking space detection system acquires the optical center position of the monocular camera during the monocular camera calibration process. The first inner edge is transformed into three-dimensional space, and a first plane is constructed based on the first inner edge and the optical center position of the monocular camera.

[0053] The parking space detection system can select any two points on the first inner edge of the three-dimensional space, and construct a first plane based on the two points on the first inner edge and the optical center position of the monocular camera.

[0054] The parking space detection system can also determine the direction vector of the first inner edge, and construct the first plane based on the optical center position and the direction vector of the first inner edge.

[0055] In this embodiment, the optical center position is the location of the camera's optical center in the world coordinate system. The first plane is a three-dimensional plane constructed based on the first inner edge and the optical center position.

[0056] Please refer to Figure 4, which shows a schematic diagram of a first plane and a second plane. For example, the parking space detection system can select two endpoints in the left inner edge 21 and construct the first plane 42 based on the two endpoints in the left inner edge 21 and the optical center position 41 of the monocular camera.

[0057] In step 106, a second plane is constructed based on the second inner edge and the optical center position.

[0058] In this step, the parking space detection system can transform the second inner edge line into three-dimensional space and construct a second plane based on the second inner edge line and the optical center position.

[0059] The parking space detection system can select any two points on the second inner edge of the three-dimensional space, and construct a second plane based on the two points on the second inner edge and the optical center position of the monocular camera.

[0060] The parking space detection system can also determine the direction vector of the second inner edge, and construct a second plane based on the optical center position and the direction vector of the second inner edge.

[0061] In the embodiments of this application, the second plane is a three-dimensional plane constructed based on the second inner edge and the optical center position.

[0062] Please refer to Figure 4. For example, the parking space detection system can select two endpoints in the right inner edge 22 and construct a second plane 43 based on the two endpoints in the right inner edge 22 and the optical center position 41 of the monocular camera.

[0063] In step 108, the parking direction of the mechanical parking space is determined based on the straight line where the first plane and the second plane intersect.

[0064] In this step, the parking space detection system can use methods such as projection and angle calculation to determine the parking space direction of the mechanical parking space based on the straight line intersecting the first and second planes.

[0065] For example, intersecting straight lines are projected onto a horizontal plane parallel to the ground, and the direction vector of the projected lines is calculated. This direction vector is then used as the parking direction of the mechanical parking space.

[0066] For example, the parking direction of a mechanical parking space can be determined based on the angle between the projection vectors of the first inner edge line and the second inner edge line onto the horizontal plane.

[0067] Please refer to Figure 4. The parking space detection system can determine the parking direction of the mechanical parking space based on the straight line 44 where the first plane 42 and the second plane 43 intersect.

[0068] In this embodiment of the application, the parking space direction refers to the direction from the parking space entrance to the end of the parking space, which is used to guide vehicles to accurately find and park in the mechanical parking space.

[0069] The mechanical parking space orientation detection method of this application embodiment detects the inner edge of the parking space in the parking space image, constructs a first plane based on the first inner edge and the optical center position of the monocular camera, constructs a second plane based on the second inner edge and the optical center position, and determines the orientation of the mechanical parking space according to the straight line intersecting the first plane and the second plane. By calculating the intersection line between the plane containing the inner edge of the parking space and the optical center position, the actual orientation and angle of the mechanical parking space in three-dimensional space can be accurately reflected, avoiding the limitation of the ground plane assumption, thereby accurately detecting the orientation of the mechanical parking space.

[0070] In addition, the parking direction of a mechanical parking space can be detected by a single frame of parking space image detected by a monocular camera, thereby realizing real-time detection of parking space direction.

[0071] In the foregoing embodiments, a first plane and a second plane were constructed based on the inner edge of the parking space and the optical center position. The parking direction of the mechanical parking space was detected in real time using the straight line intersecting the first and second planes. In the following embodiments, the process of determining the parking direction will be described in more detail, and it can be applied to any of the embodiments above.

[0072] In one embodiment of this application, the parking space detection system can obtain the direction vector of a straight line and use the vector component of the direction vector on the horizontal plane as the parking space direction.

[0073] The direction vector (x, y, z) of a straight line represents a direction in three-dimensional space, and the parking space direction is the vector component (x, y) of the direction vector on the horizontal plane.

[0074] In the embodiments of this application, the x component represents the direction along the x-axis on the horizontal plane, the y component represents the direction along the y-axis on the horizontal plane, and the z component represents the height direction.

[0075] The horizontal plane is parallel to the ground, and the height direction is perpendicular to the horizontal plane. The direction vector is used to represent the three-dimensional direction from the parking space entrance to the end of the parking space, while the vector components on the horizontal plane are used to represent the parking direction of the mechanical parking space on the horizontal plane.

[0076] As described above, by obtaining the direction vector of the straight line, the vector component of the direction vector on the horizontal plane is taken as the parking space direction. Since the horizontal plane is parallel to the ground, the vector component of the direction vector of the straight line on the horizontal plane can directly reflect the direction of the parking space on the ground, reducing errors caused by factors such as image perspective and camera angle, and improving the accuracy of parking space direction detection.

[0077] In one embodiment of this application, the parking space detection system can obtain the absolute value of the component of the direction vector of a straight line in the height direction, and use the absolute value as a quality assessment index for detecting the parking space direction. If the absolute value is less than a preset threshold, the straight line can be considered sufficiently close to the horizontal plane, and the vector component can be used as the parking space direction.

[0078] In this embodiment, the absolute value is used to reflect the distance between the straight line and the horizontal plane, that is, the absolute value of the z-component of the direction vector (x, y, z). The preset threshold can be set and adjusted according to the actual application scenario.

[0079] As described above, by obtaining the absolute value of the component of the direction vector of the straight line in the height direction, if the absolute value is less than a preset threshold, it indicates that the straight line is mainly located in the horizontal plane. By using the vector component as the parking space direction, straight lines with large deviations can be filtered out, thereby significantly improving the accuracy of parking space direction detection.

[0080] In the foregoing embodiments, a simpler method for processing and detecting parking space orientation was described by extracting the vector components of the straight line on the horizontal plane. The following embodiments will provide a more detailed description of the detection process along the line within the parking space, and this method can be applied to any of the embodiments described above.

[0081] In one embodiment of this application, Figure 5 shows a flowchart of detecting the inner edge of a parking space. As shown in Figure 5, the parking space detection system can input the parking space image into the inner edge detection model, and use the backbone networks such as ResNet (Residual Network) and MobileNet in the inner edge detection model to perform convolution and pooling operations on the parking space image to extract the inner edge features in the parking space image.

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

[0083] In the heatmap, candidate points are selected along the lines within the parking spaces. A threshold is applied to the heatmap, typically a value between 0 and 1 (e.g., 0.5), and pixels with values ​​higher than this threshold are selected as candidate points. The number of candidate points can be further reduced using methods such as non-maximum suppression to eliminate redundant and overlapping points in the heatmap.

[0084] Clustering algorithms such as K-means clustering and density-based clustering of applications with noise (DBSCAN) are used to group candidate points into a first inner edge point set and a second inner edge point set.

[0085] Multinomial fitting and least squares fitting algorithms were used to fit the first inner edge point set and the second inner edge point set, respectively. Fitting the first inner edge point set yielded a two-dimensional first inner edge line; fitting the second inner edge point set yielded a two-dimensional second inner edge line.

[0086] In this embodiment, the inner edge feature is the feature information of the inner edge of the parking space, used for subsequent inner edge detection. The first inner edge point set is separated from the candidate points and used to form a straight line or curve on one side of the parking space's interior edge. The second inner edge point set is separated from the candidate points and used to form a straight line or curve on the other side of the parking space's interior edge.

[0087] The inner edge detection model can be a deep learning model that has been trained in advance using a large number of labeled parking space images.

[0088] As described above, by extracting the inner edge features from the parking space image and generating a heatmap corresponding to the inner edge features, important inner edge information in the parking space image can be highlighted, reducing the impact of distortion on the recognition results. In the heatmap, candidate points of the parking space inner edge are selected, and a clustering algorithm is used to group the candidate points into a first inner edge point set and a second inner edge point set. The first inner edge point set is fitted to obtain the first inner edge, and the second inner edge point set is fitted to obtain the second inner edge. This reduces the influence of various factors such as lighting changes, shadows, and occlusion, and allows for more accurate positioning of the first and second inner edges.

[0089] In one embodiment of this application, please continue to refer to Figure 5. The parking space detection system can also use the inner edge detection model to generate the offset corresponding to the inner edge features based on the inner edge features. The offset represents the small adjustment from the peak position of the heat map to the actual inner edge position. These offsets can be two-dimensional, corresponding to the horizontal and vertical directions in the parking space image, respectively.

[0090] For candidate points in the heatmap, the predicted position of the candidate point is adjusted using an offset. The offset is added to the original predicted position to obtain the adjusted candidate point. For each candidate point, fine-tuning is performed based on its corresponding offset to more closely approximate the actual inner edge position.

[0091] In this embodiment, the offset is used to indicate the amount of fine-tuning of the predicted position of a candidate point relative to its true position. The predicted position is the location of the candidate point on the heatmap.

[0092] As described above, by generating the offset corresponding to the inner edge feature, and using the offset of the predicted position of the candidate point relative to the real position, the predicted position is adjusted to obtain the adjusted candidate point. This allows for more accurate localization of the candidate point's real position, thereby improving the overall accuracy of parking space orientation detection.

[0093] To further illustrate the parking space orientation detection method for mechanical parking spaces, Figure 6 shows a flowchart of another mechanical parking space orientation detection method, which may include the following steps 602 to 618.

[0094] In step 602, the inner edge features of the parking space image are extracted, and the heat map and offset corresponding to the inner edge features are generated.

[0095] In this step, the parking space detection system uses the inner edge detection model to extract the inner edge features in the parking space image and generate the heat map and offset corresponding to the inner edge features.

[0096] In step 604, the predicted position of the candidate point in the heat map is adjusted using the offset.

[0097] In this step, the parking space detection system uses threshold processing and non-maximum suppression on the heat map to select candidate points. Using the offset corresponding to each candidate point, the predicted position of the candidate point on the heat map is adjusted to obtain the adjusted candidate point.

[0098] In step 606, a clustering algorithm is used to group the adjusted candidate points into a first inner edge point set and a second inner edge point set.

[0099] In this step, the parking space detection system uses a clustering algorithm to group the candidate points into a first inner edge point set and a second inner edge point set.

[0100] In step 608, the first inner edge point set and the second inner edge point set are fitted respectively to obtain the first inner edge line and the second inner edge line.

[0101] In this step, the parking space detection system uses a fitting algorithm to fit the first inner edge point set to obtain the first inner edge, and then fits the second inner edge point set to obtain the second inner edge.

[0102] In step 610, distortion correction is performed on the first inner edge and the second inner edge, camera intrinsic parameters are removed, and the images are projected onto the normalized plane.

[0103] In this step, the parking space detection system uses the distortion parameters of a monocular camera to correct the distortion of the first and second inner edges, obtaining the corrected first and second inner edges. Based on the intrinsic parameter matrix of the monocular camera, the inverse matrix of the intrinsic parameter matrix is ​​calculated.

[0104] Based on the inverse matrix, the image coordinates of the corrected first inner edge and second inner edge are projected onto the normalized plane to obtain the normalized first inner edge and second inner edge.

[0105] In step 612, the parking space detection system constructs a first plane based on the first inner edge and the optical center position.

[0106] In step 614, the parking space detection system constructs a second plane based on the second inner edge and the optical center position.

[0107] In step 616, the parking space detection system obtains the direction vector of the straight line where the first plane and the second plane intersect.

[0108] In step 618, if the absolute value of the component of the direction vector of the straight line in the height direction is less than a preset threshold, the vector component on the horizontal plane is taken as the parking space direction.

[0109] In this step, the parking space detection system obtains the absolute value of the component of the direction vector of the straight line in the height direction. If the absolute value is less than a preset threshold, the vector component on the horizontal plane is taken as the parking direction of the mechanical parking space.

[0110] Figure 7 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 7, at the hardware level, the electronic device includes at least one processor 702, an internal bus 704, a network interface 706, at least one memory 708, and at least one non-volatile memory 710, and may also include other hardware required for business operations. The processor 702 reads the corresponding computer program from the non-volatile memory 710 into the memory 708 and then runs it, forming a parking direction detection device for a mechanical parking space 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.

[0111] Figure 8 is a block diagram of a parking space orientation detection device for a mechanical parking space according to an exemplary embodiment of this application. Referring to Figure 8, the device may include: an inner edge detection module 802, a first plane construction module 804, a second plane construction module 806, and an orientation determination module 808.

[0112] The inner edge detection module 802 is configured to detect the inner edge of the parking space in the parking space image; wherein, the parking space image is obtained by taking pictures of the mechanical parking space with a monocular camera, and the direction of the inner edge of the parking space is along the direction from the entrance of the parking space to the end of the parking space, and the inner edge of the parking space includes: a first inner edge and a second inner edge.

[0113] The first plane construction module 804 is configured to construct the first plane based on the first inner edge and the optical center position of the monocular camera.

[0114] The second plane construction module 806 is configured to construct a second plane based on the second inner edge and the optical center position.

[0115] The direction determination module 808 is configured to determine the parking direction of the mechanical parking space based on the straight line intersecting the first plane and the second plane.

[0116] In one example, the direction determination module 808, when determining the parking direction of the mechanical parking space based on the straight line intersecting the first plane and the second plane, includes: obtaining the direction vector of the straight line; taking the vector component of the direction vector on the horizontal plane as the parking direction; wherein the horizontal plane is parallel to the ground.

[0117] In one example, the direction determination module 808, when using the vector component of the direction vector on the horizontal plane as the parking space direction, includes: obtaining the absolute value of the component of the direction vector of the straight line in the height direction; wherein the height direction is perpendicular to the horizontal plane, and the absolute value is used to reflect the distance between the straight line and the horizontal plane; if the absolute value is less than a preset threshold, the vector component is used as the parking space direction.

[0118] In one example, the inner edge detection module 802, when detecting the inner edge of a parking space in a parking space image, includes: extracting inner edge features from the parking space image and generating a heatmap corresponding to the inner edge features; selecting candidate points for the inner edge of the parking space in the heatmap; using a clustering algorithm to group the candidate points into a first inner edge point set and a second inner edge point set; fitting the first inner edge point set to obtain the first inner edge; and fitting the second inner edge point set to obtain the second inner edge.

[0119] In one example, before using a clustering algorithm to group candidate points into a first set of inner edge points and a second set of inner edge points, the inner edge detection module 802 is further configured to: generate an offset corresponding to the inner edge feature; wherein, the offset is used to identify the amount of fine adjustment of the predicted position of the candidate point relative to the true position, and the predicted position is the position of the candidate point in the heat map; using the offset, the predicted position is adjusted to obtain the adjusted candidate point.

[0120] In one example, after detecting the inner edge of the parking space in the parking space image, the inner edge detection module 802 is further configured to: use the distortion parameters of the monocular camera to perform distortion correction on the inner edge of the parking space to obtain the corrected inner edge; calculate the inverse matrix of the intrinsic parameter matrix according to the intrinsic parameter matrix of the monocular camera; and project the image coordinates of the corrected inner edge onto the normalized plane based on the inverse matrix to obtain the normalized first inner edge and second inner edge.

[0121] 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.

[0122] 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.

[0123] 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 parking space orientation detection device for a mechanical parking space to implement the method as described in any of the above embodiments.

[0124] 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.

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

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

[0127] In the technical solution provided in this application embodiment, by detecting the inner edge of the parking space in the parking space image, a first plane is constructed based on the first inner edge and the optical center position of the monocular camera, and a second plane is constructed based on the second inner edge and the optical center position. The parking direction of the mechanical parking space is determined according to the straight line intersecting the first and second planes. By calculating the intersection line between the plane containing the inner edge of the parking space and the optical center position, the actual direction and angle of the mechanical parking space in three-dimensional space can be accurately reflected, avoiding the limitation of the ground plane assumption, thereby accurately detecting the parking direction of the mechanical parking space.

[0128] 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.

[0129] 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.

[0130] 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 the parking direction of a mechanical parking space, comprising: Detect the inner edge of the parking space in the parking space image; wherein, the parking space image is obtained by taking a picture of the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is along the direction from the entrance of the parking space to the end of the parking space, and the inner edge of the parking space includes: a first inner edge and a second inner edge. A first plane is constructed based on the first inner edge line and the optical center position of the monocular camera; Based on the second inner edge and the optical center position, a second plane is constructed; The parking direction of the mechanical parking space is determined based on the straight line intersecting the first plane and the second plane.

2. The method according to claim 1, wherein, Determining the parking direction of the mechanical parking space based on the straight line intersecting the first plane and the second plane includes: Obtain the direction vector of the line; The vector component of the direction vector on the horizontal plane is taken as the parking space direction; wherein, the horizontal plane is parallel to the ground.

3. The method according to claim 2, wherein, The step of using the vector component of the direction vector on the horizontal plane as the parking space direction includes: Obtain the absolute value of the component of the direction vector of the straight line in the height direction; wherein the height direction is perpendicular to the horizontal plane, and the absolute value is configured to reflect the distance between the straight line and the horizontal plane; If the absolute value is less than a preset threshold, the vector component is taken as the parking space direction.

4. The method according to any one of claims 1 to 3, wherein, The detection of the inner edge of the parking space in the parking space image includes: Extract the inner edge features from the parking space image and generate a heat map corresponding to the inner edge features; In the heat map, candidate points are selected along the line inside the parking space; Using a clustering algorithm, the candidate points are grouped into a first inner edge point set and a second inner edge point set; Fit the first inner edge point set to obtain the first inner edge; The second inner edge line is obtained by fitting the set of points on the second inner edge line.

5. The method according to claim 4, wherein, Before using a clustering algorithm to group the candidate points into a first inner edge point set and a second inner edge point set, the method further includes: Generate the offset corresponding to the inner edge feature; wherein the offset is configured as a fine adjustment amount that identifies the predicted position of the candidate point relative to the true position, and the predicted position is the position of the candidate point in the heat map; The predicted position is adjusted using the offset to obtain the adjusted candidate point.

6. The method according to any one of claims 1 to 5, wherein, After detecting the inner edge of the parking space in the parking space image, the method further includes: Using the distortion parameters of the monocular camera, the distortion of the inner edge of the parking space is corrected to obtain the corrected inner edge. Calculate the inverse matrix of the intrinsic parameter matrix based on the intrinsic parameter matrix of the monocular camera; Based on the inverse matrix, the image coordinates of the corrected inner edge are projected onto the normalized plane to obtain the normalized first inner edge and second inner edge.

7. A parking space orientation detection device for a mechanical parking space, comprising: The inner edge detection module is configured to detect the inner edge of the parking space in the parking space image; wherein, the parking space image is obtained by taking a picture of the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is along the direction from the entrance of the parking space to the end of the parking space, and the inner edge of the parking space includes: a first inner edge and a second inner edge. The first plane construction module is configured to construct a first plane based on the first inner edge line and the optical center position of the monocular camera; The second plane construction module is configured to construct a second plane based on the second inner edge and the optical center position; The direction determination module is configured to determine the parking direction of the mechanical parking space based on the straight line intersecting the first plane and the second plane.

8. 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 6.

9. 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 6.

10. 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 6.

11. A vehicle comprising: The parking space orientation detection device for mechanical parking spaces as described in claim 7, or The electronic device as described in claim 8, or The non-transitory computer-readable storage medium as described in claim 9, or The computer program product as described in claim 10.