A parking space direction detection method, device, equipment and medium for mechanical parking space
By detecting the inner line in the mechanical parking space image and building corresponding planes, the parking space direction vector is obtained, and the problem of inaccurate detection of the mechanical parking space direction is solved, and the accurate detection of the mechanical parking space direction is achieved.
Patent Information
- Application Number
- CN202510034886.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Due to its special structure and operation method, mechanical parking spaces have a large difference between the parking space plane and the plane where the bicycle is located. The existing parking space direction detection methods cannot accurately detect the parking space direction of the mechanical parking space.
By detecting the inner line of the parking space in the parking space image, a first plane is constructed based on the optical center position of the first inner line and the monocular camera, and a second plane is constructed based on the second inner line and the optical center position, a direction vector of the straight line intersecting the first plane and the second plane are obtained, and the vector component of the direction vector on the horizontal plane is used as the parking space direction.
Accurate detection of the actual direction and angle of mechanical parking spaces in three-dimensional space is achieved, avoiding the limitation of ground plane assumptions, and ensuring the accuracy of parking space direction.
Smart Images

Figure CN119445057B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of assisted driving technology, and in particular to a parking direction detection method, device, equipment and medium for a mechanical parking space. Background Art
[0002] As the number of cars continues to increase, the problem of parking difficulties in cities has become increasingly prominent. Mechanical parking spaces, as a parking method that efficiently utilizes space resources, have been increasingly widely used.
[0003] Current parking space direction detection methods are usually based on the ground plane assumption, that is, assuming that the parking space plane and the plane where the vehicle is located are on the same plane, and estimating the position and angle of the parking space.
[0004] However, due to their special structure and operation mode, mechanical parking spaces often do not meet the ground plane assumption. Mechanical parking spaces are located at different heights or inclination angles, resulting in a large difference between the parking space plane and the plane where the vehicle is located, making it impossible to accurately detect the parking direction of the mechanical parking space. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present application provides a parking direction detection method, device, equipment and medium for a mechanical parking space.
[0006] According to a first aspect of any embodiment of the present application, a method for detecting a parking direction of a mechanical parking space is provided, the method comprising:
[0007] Detecting the inner edge of the parking space in the parking space image; wherein the parking space image is obtained by photographing the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is 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;
[0008] Constructing a first plane based on the first inner edge line and the optical center position of the monocular camera;
[0009] Constructing a second plane based on the second inner edge line and the optical center position;
[0010] Obtaining a direction vector of a straight line where the first plane and the second plane intersect;
[0011] The vector component of the direction vector on the horizontal plane is used as the parking space direction; wherein the horizontal plane is parallel to the ground.
[0012] According to a second aspect of any embodiment of the present application, a parking space direction detection device for a mechanical parking space is provided, the device comprising:
[0013] The inner edge detection module is used to detect the inner edge of the parking space in the parking space image; wherein the parking space image is obtained by photographing the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is 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;
[0014] A first plane construction module, used for constructing a first plane based on the first inner edge line and the optical center position of the monocular camera;
[0015] A second plane construction module, used to construct a second plane based on the second inner edge line and the optical center position;
[0016] The direction determination module is used to obtain the direction vector of the straight line where the first plane and the second plane intersect; and use the vector component of the direction vector on the horizontal plane as the parking space direction; wherein the horizontal plane is parallel to the ground.
[0017] According to a third aspect of any embodiment of the present application, there is provided an electronic device, including:
[0018] processor;
[0019] a memory for storing processor-executable instructions;
[0020] The processor implements the method described in any embodiment of the present application by running the executable instructions.
[0021] According to a fourth aspect of any embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the method described in any embodiment of the present application is implemented.
[0022] According to a fifth aspect of any embodiment of the present application, a computer program product is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the method described in any embodiment of the present application is implemented.
[0023] The technical solution provided by this application may have the following beneficial effects:
[0024] According to the above embodiments, by detecting the inner edge line of the parking space in the parking space image, a first plane is constructed based on the first inner edge line and the optical center position of the monocular camera, and a second plane is constructed based on the second inner edge line and the optical center position, and the direction vector of the straight line where the first plane and the second plane intersect is obtained. The vector component of the direction vector on the horizontal plane is used as the parking space direction. By calculating the intersection line of the plane where the inner edge line of the parking space is located and the optical center position, the actual direction and angle of the mechanical parking space in the 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.
[0025] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0027] Figure 1 is a flow chart of a parking direction detection method for a mechanical parking space according to an exemplary embodiment of the present application;
[0028] Figure 2 is a schematic diagram of an inner line of a parking space in a parking space image according to an exemplary embodiment of the present application;
[0029] Figure 3 is a schematic diagram of a normalized plane shown in the present application according to an exemplary embodiment;
[0030] Figure 4 is a schematic diagram of a first plane and a second plane according to an exemplary embodiment of the present application;
[0031] Figure 5 This is a flow chart of detecting a line inside a parking space according to an exemplary embodiment of the present application;
[0032] Figure 6 is a flow chart of another parking direction detection method for a mechanical parking space according to an exemplary embodiment of the present application;
[0033] Figure 7 is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present application;
[0034] Figure 8 It is a block diagram of a parking space direction detection device for a mechanical parking space according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0036] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0037] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0038] Due to the special structure and operation mode of mechanical parking spaces, mechanical parking spaces are often located at different heights or inclination angles, resulting in a large difference between the plane of the parking space and the plane where the own vehicle is located, making it impossible to accurately estimate the parking direction of the mechanical parking space.
[0039] In order to solve the above problems, the present application proposes a parking direction detection method for a mechanical parking space. To further illustrate the present application, the following embodiments are provided:
[0040] See also Figure 1 , Figure 1 This is a flow chart of a parking direction detection method for a mechanical parking space according to an exemplary embodiment of the present application. The parking direction detection method can be executed by a parking detection system, which can be applied to a vehicle or a cloud service end.
[0041] The parking space direction detection method may include the following steps:
[0042] Step 102: Detect the inner edge line of the parking space in the parking space image; wherein the parking space image is obtained by photographing the mechanical parking space with a monocular camera, the direction of the inner edge line of the parking space is from the parking space entrance to the end of the parking space, and the inner edge line of the parking space includes: a first inner edge line and a second inner edge line.
[0043] In this step, the parking space detection system uses the monocular camera of the vehicle to shoot the mechanical parking space to obtain a parking space image containing the inner edge of the parking space. The parking space detection system can use edge detection algorithms such as Canny and Sobel to highlight the edge information in the parking space image.
[0044] The parking space detection system can use a deep learning model to detect the parking space image and obtain the inner edge of the parking space in the parking space image.
[0045] The parking space detection system can also use straight line detection algorithms such as Hough Transform and Line Segment Detector (LSD) to detect straight line segments in the parking space image, and screen out the straight line segments of the first inner edge line and the second inner edge line according to the geometric characteristics and relative position relationship of the mechanical parking space. The embodiments of the present application do not limit this.
[0046] Among them, a monocular camera refers to a camera system that captures image information through only one lens, captures light through an image sensor and generates a two-dimensional image. A monocular camera can be a monocular camera, a pinhole camera, etc.
[0047] The parking space image is obtained by shooting the mechanical parking space with a monocular camera, which is a single-frame image. The parking space image can include the inner edge of the parking space.
[0048] The inner edge line of the parking space is a line defining the inner left and right boundaries of the mechanical parking space, and the direction of the inner edge line of the parking space is from the entrance of the parking space to the end of the parking space. The inner edge line of the parking space may include: a first inner edge line and a second inner edge line.
[0049] The first inner edge line is a line inside the mechanical parking space close to one side boundary. The direction of the first inner edge line is from the parking space entrance to the end of the parking space. The first inner edge line may be the left inner edge line of the mechanical parking space.
[0050] The second inner edge line is a line inside the mechanical parking space close to the other side boundary. The direction of the second inner edge line is from the parking space entrance to the end of the parking space. The second inner edge line can be the right inner edge line of the mechanical parking space.
[0051] The first inner edge line is relatively parallel to the second inner edge line, and together define the inner space of the mechanical parking space.
[0052] See also Figure 2 , Figure 2 A schematic diagram of the inner edge lines of a parking space in a parking space image is shown. Taking the first inner edge line as the left inner edge line 21 (green line) and the second inner edge line as the right inner edge line 22 (red line) as an example, the parking space detection system can obtain a parking space image by photographing the mechanical parking space with a monocular camera, and detect the left inner edge line 21 and the right inner edge line 22 in the parking space image.
[0053] Understandably, Figure 2 The first inner edge line and the second inner edge line shown are only examples. The inner edge line of the parking space is not limited to the line segment connecting the entrance to the end of the parking space. The inner edge line of the parking space can construct a plane with the optical center position of the monocular camera.
[0054] In one embodiment, the parking space detection system may use the distortion parameters of the monocular camera to perform distortion correction on the inner edge of the parking space, and map each pixel point on the inner edge of the parking space in the distorted parking space image to the undistorted image through geometric transformation.
[0055] Calculate the corresponding position of each pixel in the undistorted image to obtain the corrected inner edge line. The coordinate set of these pixel points in the undistorted image constitutes the corrected inner edge line. According to the intrinsic parameter matrix of the monocular camera, the inverse matrix of the intrinsic parameter matrix is calculated through the matrix inversion algorithm.
[0056] The parking space detection system is based on the inverse matrix. It uses the inverse matrix of the intrinsic parameter matrix to transform each pixel point on the calibration inner edge line from the image coordinate system to the camera coordinate system, and projects the image coordinates of the calibration inner edge line to the normalized plane to obtain the normalized first inner edge line and the second inner edge line, thereby obtaining the first inner edge line and the second inner edge line that are normalized relative to the camera optical center and are not affected by the camera intrinsic parameters and distortion.
[0057] The distortion parameters are obtained during the calibration of the monocular camera, and may include internal parameters such as the focal length and optical center of the camera and 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 from which the distortion caused by the monocular camera has been removed.
[0058] The intrinsic matrix is used to describe the optical characteristics and geometric relationships inside the camera. The intrinsic matrix can include information such as the focal length, optical center position, image scaling factor, and tilt factor of the monocular camera. The inverse matrix of the intrinsic matrix is used to remove the influence of the camera intrinsic parameters in the image coordinates.
[0059] The normalization plane is a virtual plane whose origin is at the camera optical center and all coordinates are normalized to the same scale. The normalization plane is usually defined as the plane with z=1 in the camera coordinate system.
[0060] See also Figure 3 , Figure 3 A schematic diagram of a normalized plane is shown. Figure 3 The camera coordinate system Oc-XcYcZc shown is established based on the optical center position of the monocular camera, with the Z axis pointing to the front of the camera. The parking space detection system projects the image coordinates of the corrected inner edge line onto the normalized plane 31 to obtain the normalized first inner edge line and the second inner edge line.
[0061] As described above, by using the distortion parameters of the monocular camera to perform distortion correction on the inner edge line of the parking space to obtain the corrected inner edge line, the influence of the distortion on the inner edge line of the parking space can be eliminated or reduced. According to 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 line are projected onto the normalized plane to obtain the normalized first inner edge line and the second inner edge line, thereby reducing the computational complexity and the source of errors, making the subsequent construction of the plane easier and more accurate.
[0062] Step 104: construct a first plane based on the first inner edge line and the optical center position of the monocular camera.
[0063] In this step, the parking space detection system obtains the optical center position of the monocular camera during the calibration process of the monocular camera, converts the first inner edge line into a three-dimensional space, and constructs a first plane based on the first inner edge line and the optical center position of the monocular camera.
[0064] The parking space detection system can select any two points in the first inner edge line of the three-dimensional space, and construct a first plane based on the two points in the first inner edge line and the optical center position of the monocular camera.
[0065] The parking space detection system may also determine the direction vector of the first inner edge line, and construct a first plane based on the optical center position and the direction vector of the first inner edge line.
[0066] The optical center position is the position of the optical center of the camera in the world coordinate system. The first plane is a three-dimensional plane constructed based on the first inner edge line and the optical center position.
[0067] See also Figure 4 , Figure 4 A schematic diagram of a first plane and a second plane is shown. Exemplarily, the parking space detection system can select two endpoints in the left inner line 21, and construct a first plane 42 based on the two endpoints in the left inner line 21 and the optical center position 41 of the monocular camera.
[0068] Step 106: construct a second plane based on the second inner edge line and the optical center position.
[0069] In this step, the parking space detection system can convert 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.
[0070] The parking space detection system can select any two points in the second inner edge line of the three-dimensional space, and construct a second plane based on the two points in the second inner edge line and the optical center position of the monocular camera.
[0071] The parking space detection system can also determine the direction vector of the second inner edge line, and construct a second plane based on the optical center position and the direction vector of the second inner edge line.
[0072] The second plane is a three-dimensional plane constructed based on the second inner edge line and the optical center position.
[0073] Please continue reading Figure 4 Exemplarily, the parking space detection system may select two endpoints of the right inner line 22, and construct a second plane 43 based on the two endpoints of the right inner line 22 and the optical center position 41 of the monocular camera.
[0074] Step 108: Obtain the direction vector of the straight line where the first plane and the second plane intersect, and use the vector component of the direction vector on the horizontal plane as the parking space direction; wherein the horizontal plane is parallel to the ground.
[0075] In this step, the parking space detection system may use a projection method, an angle calculation method, or the like to determine the parking space direction of the mechanical parking space according to a straight line intersecting the first plane and the second plane.
[0076] For example, the intersecting straight lines are projected onto a horizontal plane parallel to the ground, a direction vector is calculated for the projected straight lines, and the direction vector is used as the parking direction of the mechanical parking space.
[0077] For another example, the parking direction of the mechanical parking space is determined according to the angle between the projection vectors of the first inner edge line and the second inner edge line on the horizontal plane.
[0078] Please continue reading Figure 4 The parking space detection system can determine the parking space direction of the mechanical parking space according to the straight line 44 (blue line) where the first plane 42 and the second plane 43 intersect.
[0079] Among them, 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 the vehicle to accurately find and park in the mechanical parking space.
[0080] The parking direction detection method of the mechanical parking space of the present embodiment detects the inner edge line of the parking space in the parking space image, constructs a first plane based on the first inner edge line and the optical center position of the monocular camera, constructs a second plane based on the second inner edge line and the optical center position, obtains the direction vector of the straight line where the first plane and the second plane intersect, and uses the vector component of the direction vector on the horizontal plane as the parking space direction. By calculating the intersection line of the plane where the inner edge line of the parking space is located and the optical center position, the actual direction and angle of the mechanical parking space in the 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.
[0081] Moreover, the parking direction of the mechanical parking space can be detected with only a single-frame parking space image detected by a monocular camera, thereby realizing real-time detection of the parking space direction.
[0082] In the above-mentioned embodiment, it is introduced that the parking direction of the mechanical parking space is detected in real time by constructing the first plane and the second plane based on the inner edge line of the parking space and the optical center position, and using the straight line where the first plane and the second plane intersect. In the following embodiment, the process of determining the parking direction will be described in more detail, and can be applied to any of the above embodiments.
[0083] In one embodiment, the parking space detection system may obtain a direction vector of a straight line, and use a vector component of the direction vector on a horizontal plane as the parking space direction.
[0084] The direction vector (x, y, z) of a line represents a direction in a three-dimensional space, and the parking space direction is the vector component (x, y) on the horizontal plane.
[0085] Among them, 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.
[0086] 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 entrance to the end of the parking space, and the vector component on the horizontal plane is used to represent the parking direction of the mechanical parking space on the horizontal plane.
[0087] As mentioned above, by obtaining the direction vector of the straight line, the vector component of the direction vector on the horizontal plane is used 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.
[0088] In one embodiment, the parking space detection system can obtain the absolute value of the straight line in the height direction and use the absolute value as a quality assessment indicator for detecting the parking space direction. When the absolute value is less than a preset threshold, it can be determined that the straight line is close enough to the horizontal plane and the vector component is used as the parking space direction.
[0089] The absolute value is used to reflect the distance between the straight line and the horizontal plane, that is, the absolute value of the direction vector (x, y, z) on the z-axis. The preset threshold can be set and adjusted according to the actual application scenario.
[0090] As mentioned above, by obtaining the absolute value of the straight line in the height direction, when the absolute value is less than the preset threshold, it means that the straight line is mainly located in the horizontal plane. Using the vector component as the parking space direction can filter out straight lines with a large degree of deviation, thereby significantly improving the accuracy of parking space direction detection.
[0091] In the above-mentioned embodiment, it is introduced that the parking space direction is processed and detected more simply by extracting the vector component of the straight line on the horizontal plane. In the following embodiment, the detection process of the inner edge of the parking space will be described in more detail, and can be applied to any of the above embodiments.
[0092] In one embodiment, Figure 5 FIG. 4 shows a flow chart of detecting the inner edge of a parking space. Figure 5 As shown, the parking space detection system can input the parking space image into the inner edge line detection model, and use the backbone network (Backbone) such as ResNet and MobileNet in the inner edge line detection model to perform convolution and pooling operations on the parking space image to extract the inner edge line features in the parking space image.
[0093] One or more convolutional layers in the inner edge detection model are used to generate a heatmap corresponding to the inner edge features. Each pixel value on the heatmap represents the probability that the corresponding position is the inner edge of the parking space.
[0094] In the heat map, select candidate points along the line inside the parking space. Apply a threshold to the heat map, which is usually a value between 0 and 1 (such as 0.5), and use pixels above this threshold as candidate points. The number of candidate points can also be further reduced by methods such as non-maximum suppression to eliminate redundant and overlapping points in the heat map.
[0095] Clustering algorithms such as K-means and Density-Based Spatial Clustering of Applications with Noise (DBSCAN) are used to group the candidate points into a first inner line point set and a second inner line point set.
[0096] The first inner edge line point set and the second inner edge line point set are fitted respectively using fitting algorithms such as polynomial fitting and least square fitting. The first inner edge line point set is fitted to obtain a two-dimensional first inner edge line; the second inner edge line point set is fitted to obtain a two-dimensional second inner edge line.
[0097] Among them, the inner edge feature is the feature information of the inner edge of the parking space, which is used for subsequent inner edge detection. The first inner edge point set is the straight line or curve separated from the candidate points to form the edge of one side of the interior of the parking space. The second inner edge point set is the straight line or curve separated from the candidate points to form the edge of the other side of the interior of the parking space.
[0098] The inner edge line detection model may be a deep learning model that is pre-trained using a large number of labeled parking space images.
[0099] As described above, by extracting the inner line features in the parking space image and generating a heat map corresponding to the inner line features, the important inner line information in the parking space image can be highlighted and the influence of distortion on the recognition result can be reduced; in the heat map, candidate points of the inner edge of the parking space 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, and the first inner edge point set is fitted to obtain the first inner line, and the second inner edge point set is fitted to obtain the second inner line, thereby reducing the influence of various factors such as lighting changes, shadows, and occlusions, and the first inner edge line and the second inner edge line can be located more accurately.
[0100] In one embodiment, please continue to refer to Figure 5 The parking space detection system can also use the inner edge detection model to generate an offset corresponding to the inner edge feature based on the inner edge feature. The offset represents a slight 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.
[0101] For the candidate points in the heat map, the predicted position of the candidate points is adjusted using the offset, and the offset is added to the original predicted position to obtain the adjusted candidate points. For each candidate point, fine-tuning is performed according to its corresponding offset to get closer to the actual inner edge position.
[0102] The offset is used to identify the amount of fine-tuning of the predicted position of the candidate point relative to the true position. The predicted position is the position of the candidate point in the heat map.
[0103] As described above, by generating an offset corresponding to the inner line feature, using the offset of the predicted position of the candidate point relative to the actual position, adjusting the predicted position, and obtaining the adjusted candidate point, the actual position of the candidate point can be more accurately located, thereby improving the accuracy of the entire parking space direction detection.
[0104] In order to further introduce the parking direction detection method of mechanical parking spaces, Figure 6 A flow chart showing another method for detecting the parking direction of a mechanical parking space is shown. The method for detecting the parking direction may include the following steps:
[0105] Step 602: extract the inner edge line features in the parking space image, and generate a heat map and offset corresponding to the inner edge line features.
[0106] In this step, the parking space detection system uses the inner edge line detection model to extract the inner edge line features in the parking space image and generate a heat map and offset corresponding to the inner edge line features.
[0107] Step 604: Using the offset, adjust the predicted position of the candidate point in the heat map.
[0108] In this step, the parking space detection system applies threshold processing and non-maximum suppression on the heat map to select candidate points, and uses the offset corresponding to each candidate point to adjust the predicted position of the candidate point in the heat map to obtain the adjusted candidate point.
[0109] Step 606: Use a clustering algorithm to group the candidate points into a first inner-line point set and a second inner-line point set.
[0110] 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.
[0111] Step 608: Fit the first inner edge line point set and the second inner edge line point set respectively to obtain the first inner edge line and the second inner edge line.
[0112] In this step, the parking space detection system uses a fitting algorithm to fit the first inner edge line point set to obtain the first inner edge line, and fits the second inner edge line point set to obtain the second inner edge line.
[0113] Step 610: Perform distortion correction on the first inner edge line and the second inner edge line, remove camera intrinsic parameters, and project them onto a normalized plane.
[0114] In this step, the parking space detection system uses the distortion parameters of the monocular camera to perform distortion correction on the first inner edge line and the second inner edge line to obtain the corrected first inner edge line and the second inner edge line. According to the intrinsic parameter matrix of the monocular camera, the inverse matrix of the intrinsic parameter matrix is calculated.
[0115] Based on the inverse matrix, the image coordinates of the corrected first inner edge line and the second inner edge line are projected onto a normalized plane to obtain the normalized first inner edge line and the second inner edge line.
[0116] Step 612: The parking space detection system constructs a first plane based on the first inner edge line and the optical center position.
[0117] Step 614: The parking space detection system constructs a second plane based on the second inner edge line and the optical center position.
[0118] Step 616: The parking space detection system obtains a direction vector of a straight line where the first plane and the second plane intersect.
[0119] Step 618: When it is determined that the absolute value of the straight line in the height direction is less than a preset threshold, the vector component on the horizontal plane is used as the parking space direction.
[0120] In this step, the parking space detection system obtains the absolute value of the straight line in the height direction, and when it is determined that the absolute value is less than a preset threshold, the vector component on the horizontal plane is used as the parking space direction of the mechanical parking space.
[0121] Figure 7 1 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present application. The electronic device may be, for example, a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a personal digital assistant, a server, a smart home appliance, a car computer, etc. Figure 7 At the hardware level, the electronic device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include hardware required for other services. 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, in addition to the software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0122] Figure 8 is a block diagram of a parking direction detection device for a mechanical parking space according to an exemplary embodiment of the present application. Figure 8 The device may include: an inner line detection module 802, a first plane construction module 804, a second plane construction module 806 and a direction determination module 808, wherein:
[0123] The inner edge detection module 802 is used to detect the inner edge of the parking space in the parking space image; wherein the parking space image is obtained by photographing the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is 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;
[0124] The first plane construction module 804 is used to construct a first plane based on the first inner edge line and the optical center position of the monocular camera;
[0125] The second plane construction module 806 is used to construct a second plane based on the second inner edge line and the optical center position;
[0126] The direction determination module 808 is used to obtain a direction vector of a straight line where the first plane and the second plane intersect each other; and use a vector component of the direction vector on a horizontal plane as the parking space direction; wherein the horizontal plane is parallel to the ground.
[0127] In one example, the direction determination module 808, when used to use the vector component of the direction vector on the horizontal plane as the parking space direction, includes: obtaining the absolute value 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; when the absolute value is less than a preset threshold, using the vector component as the parking space direction.
[0128] In one example, the inner edge line detection module 802, when used to detect the inner edge line of a parking space in a parking space image, includes: extracting inner edge line features in the parking space image, and generating a heat map corresponding to the inner edge line features; in the heat map, selecting candidate points of the inner edge line of the parking space; using a clustering algorithm, grouping the candidate points into a first inner edge line point set and a second inner edge line point set; fitting the first inner edge line point set to obtain the first inner edge line; fitting the second inner edge line point set to obtain the second inner edge line.
[0129] In one example, the inner edge detection module 802, before being used to use a clustering algorithm to group the candidate points into a first inner edge point set and a second inner edge point set, further includes: generating an offset corresponding to the inner edge feature; wherein the offset is used to identify the fine-tuning amount of the predicted position of the candidate point relative to the actual position, and the predicted position is the position of the candidate point in the heat map; using the offset, adjusting the predicted position to obtain an adjusted candidate point.
[0130] In one example, the inner edge detection module 802, after being used to detect the inner edge of the parking space in the parking space image, further includes:
[0131] Using the distortion parameters of the monocular camera, the inner edge line of the parking space is subjected to distortion correction to obtain the corrected inner edge line; according to 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 line are projected onto a normalized plane to obtain the normalized first inner edge line and the second inner edge line.
[0132] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0133] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0134] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions. The above instructions can be executed by a processor of a parking space direction detection device for a mechanical parking space to implement a method as described in any of the above embodiments.
[0135] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and the present application does not limit this.
[0136] In an exemplary embodiment, a computer program product including a computer program / instruction is further provided. The computer program / instruction can be executed by a processor of a parking space direction detection device for a mechanical parking space to implement any of the methods described in the above embodiments.
[0137] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0138] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions claimed herein. The present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0139] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A parking space direction detection method for a mechanical parking space, characterized in that: The method comprises: Detecting the inner edge of the parking space in the parking space image; wherein the parking space image is obtained by photographing the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is 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 line and the optical center position of the monocular camera; Constructing a second plane based on the second inner edge line and the optical center position; Obtaining a direction vector of a straight line where the first plane and the second plane intersect; The vector component of the direction vector on the horizontal plane is used as the parking space direction; wherein the horizontal plane is parallel to the ground.
2. The method according to claim 1, characterized in that The step of taking the vector component of the direction vector on the horizontal plane as the parking space direction includes: Obtaining an absolute value of the straight line in a 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; When the absolute value is smaller than a preset threshold, the vector component is used as the parking space direction.
3. The method according to claim 1, characterized in that The detecting the inner edge of the parking space in the parking space image includes: Extracting inner edge line features in the parking space image, and generating a heat map corresponding to the inner edge line features; In the heat map, selecting candidate points along the line in the parking space; Using a clustering algorithm, grouping the candidate points into a first inner-line point set and a second inner-line point set; Fitting the first inner edge line point set to obtain the first inner edge line; The second inner edge line point set is fitted to obtain the second inner edge line.
4. The method according to claim 3, characterized in that Before using the clustering algorithm to group the candidate points into a first inner line point set and a second inner line point set, the method further includes: Generate an offset corresponding to the inner edge feature; wherein the offset is used to identify the fine-tuning amount of the predicted position of the candidate point relative to the actual 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 an adjusted candidate point.
5. The method according to claim 1, characterized in that: 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, performing distortion correction on the inner edge of the parking space to obtain a corrected inner edge; According to the intrinsic parameter matrix of the monocular camera, calculating the inverse matrix of the intrinsic parameter matrix; Based on the inverse matrix, the image coordinates of the corrected inner edge line are projected onto a normalized plane to obtain the normalized first inner edge line and the second inner edge line.
6. A parking space direction detection device for a mechanical parking space, characterized in that: The device comprises: The inner edge detection module is used to detect the inner edge of the parking space in the parking space image; wherein the parking space image is obtained by photographing the mechanical parking space with a monocular camera, the direction of the inner edge of the parking space is 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, used for constructing a first plane based on the first inner edge line and the optical center position of the monocular camera; A second plane construction module, used to construct a second plane based on the second inner edge line and the optical center position; A direction determination module is used to obtain a direction vector of a straight line where the first plane and the second plane intersect; and use a vector component of the direction vector on a horizontal plane as the parking space direction; wherein the horizontal plane is parallel to the ground.
7. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 5 by running the executable instructions.
8. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
9. A computer program product having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Monocular distance measurement-based narrow parking space reverse parking guidance method and system
CN110503683A
Camera angle calibration method and device
CN116128968A