A parking space detection method based on a TOF camera

Through the TOF camera, parking space detection has been solved, and parking space detection and installation problems in the existing technology are inconvenient, high prices or large-scale lighting dependence, achieving low-cost and reliable parking space detection.

CN114638892BActive Publication Date: 2025-07-04FORYOU GENERAL ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210193664.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2025-07-04
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

The existing parking space detection methods have problems such as inconvenient installation, expensive or heavy impact on light, making it difficult to achieve low-cost and reliable parking space detection.

Method used

The parking space detection is performed using the TOF camera. By establishing the parking space detection coordinate system, initializing the preset parameters of the target parking space, obtaining the point cloud map of the obstacle, extracting the preset feature points of the obstacle, determining the length and width of the target parking space, and making parking space judgments.

Benefits of technology

It realizes low-cost and reliable parking space inspection, reduces blind spot range, and reduces dependence on light.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638892B_ABST
    Figure CN114638892B_ABST
Patent Text Reader

Abstract

The present invention provides a parking space detection method based on a TOF camera, including: Step 1, establishing a parking space detection coordinate system; Step 2, initializing preset parameters of a target parking space, where the preset parameters of the target parking space include: the preset length and width of a target vertical parking space, and the preset length and width of a target horizontal parking space; Step 3, obtaining a point cloud map of an obstacle and extracting preset feature points of the obstacle; Step 4, determining the length and width of the target parking space according to the preset feature points of the obstacle; Step 5, performing parking space determination according to the length and width of the target parking space and the preset parameters of the target parking space. The present invention realizes reliable parking space detection at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic parking, and particularly relates to a parking space detection method based on a TOF camera. Background Art

[0002] At present, autonomous driving technology is developing rapidly, and automatic parking is an important function in autonomous driving. A key point of automatic parking is the accurate detection of parking spaces. Only by accurately detecting the parking spaces can the subsequent parking route planning be executed.

[0003] The existing mainstream parking space detection schemes are as follows: ① Parking space detection based on ultrasonic radars, whose main defect is that it is greatly affected by the environment and the detection blind area is also relatively large; ② Parking space detection based on lidars, whose main defect is high cost and inconvenient installation; ③ Parking space detection based on surround-view cameras, whose main defect is that it is greatly affected by the illumination intensity.

[0004] Therefore, there is an urgent need for a parking space detection method that is convenient to install, inexpensive, less affected by light, and has a relatively small blind area. Summary of the Invention

[0005] The present invention provides a parking space detection method based on a TOF camera, aiming to solve the defects in the prior art and achieve reliable parking space detection at low cost.

[0006] To achieve the above object, the technical solution adopted by the present invention is as follows:

[0007] The present invention provides a parking space detection method based on a TOF camera, including:

[0008] Step 1, establish a parking space detection coordinate system;

[0009] Step 2, initialize the preset parameters of the target parking space, where the preset parameters of the target parking space include: the preset length and width of the target vertical parking space, and the preset length and width of the target horizontal parking space;

[0010] Step 3, obtain the point cloud map of the obstacle and extract the preset feature points of the obstacle;

[0011] Step 4, determine the length and width of the target parking space according to the preset feature points of the obstacle;

[0012] Step 5, perform parking space determination according to the length and width of the target parking space and the preset parameters of the target parking space.

[0013] Specifically, the Step 3 includes:

[0014] Step 31, read the original point cloud data set obtained by the TOF camera;

[0015] Step 32: Denoise the original point cloud dataset to obtain a denoised point cloud dataset;

[0016] Step 33: Detect the characteristic straight line segments of obstacles based on the denoised point cloud dataset;

[0017] Step 34: Extract preset obstacle characteristic points from the characteristic straight line segments of the obstacles.

[0018] Specifically, the step 32 includes:

[0019] Step 321: Traverse the original point cloud dataset, calculate the first adjacent parameter, the second adjacent parameter, the third adjacent parameter, and the fourth adjacent parameter of the current pixel point. The first adjacent parameter, the second adjacent parameter, the third adjacent parameter, and the fourth adjacent parameter are the sum of the absolute values of the differences between the distance value of the current pixel point and the distance values of the pixels adjacent to the four vertices of the current pixel point;

[0020] Step 322: Obtain the minimum adjacent parameter, where the minimum adjacent parameter is the smallest of the first adjacent parameter, the second adjacent parameter, the third adjacent parameter, and the fourth adjacent parameter;

[0021] Step 323: Calculate the fifth parameter of the current pixel point, where the fifth parameter is the sum of the absolute values of the differences between the distance value of the current pixel point and the distance values of its 8 adjacent pixels;

[0022] Step 324: If the minimum adjacent parameter is less than the first preset threshold and the fifth parameter is greater than the second preset threshold, then retain the point cloud data of the current pixel point; otherwise, delete the point cloud data of the current pixel point.

[0023] Specifically, the step 33 includes:

[0024] Step 331: Detect characteristic planes from the denoised point cloud dataset;

[0025] Step 332: Obtain a set of preselected points for line detection from the characteristic planes;

[0026] Step 333: Detect the characteristic straight line segments from the set of preselected points for line detection.

[0027] Specifically, the step 331 includes:

[0028] Step 3311: Arbitrarily select the first point cloud data, the second point cloud data, and the third point cloud data in the denoised point cloud dataset to construct an initial plane, and calculate the first normal vector, the second normal vector, the third normal vector, and the fourth normal vector. The first normal vector, the second normal vector, and the third normal vector are the normal vectors corresponding to the first point cloud data, the second point cloud data, and the third point cloud data respectively, and the fourth normal vector is the normal vector of the initial plane;

[0029] Step 3312: Determine whether the initial plane meets the preset included angle condition. If yes, proceed to the next step; otherwise, return to the previous step. The preset included angle condition is that the included angles between the first normal vector, the second normal vector, the third normal vector, and the fourth normal vector are all less than the preset included angle threshold;

[0030] Step 3313: Calculate the first distance and the first included angle between other point cloud data in the denoised point cloud dataset and the initial plane, and record the first quantity of the point cloud data that meets the first preset condition. The first preset condition is that the first distance is less than the first preset distance threshold and the first included angle is less than the preset included angle threshold;

[0031] Step 3314: Determine whether the first quantity is greater than the first preset quantity threshold. If yes, proceed to the next step; otherwise, determine that the initial plane does not meet the requirements and return to Step 3311;

[0032] Step 3315: Repeat the above steps for the first preset number of times, and determine the initial plane corresponding to the largest value among the first quantities as the optimal plane;

[0033] Step 3316: After deleting the point cloud data included in the optimal plane from the denoised point cloud dataset, use it as the new denoised point cloud dataset, and return to Step 3311 until the second preset condition is satisfied and then end. The second preset condition is that a plane with a first quantity greater than the first preset quantity threshold cannot be detected from the denoised point cloud dataset.

[0034] Specifically, the step 332 includes:

[0035] Step 3321: Project the point cloud included in the optimal plane onto the optimal plane;

[0036] Step 3322: Determine the minimum external rectangle R of all the projection points, record the pixel point numbers of the minimum external rectangle, and mark the pixel points with projection points in the minimum external rectangle as feature pixel points;

[0037] Step 3323: Use the pixel points in the minimum external rectangle that meet the third preset condition as the straight line detection preselection point set. The third preset condition is that the pixel point has no eight-neighboring pixel points and is a feature pixel point, or the pixel point has eight-neighboring pixel points and the number of feature pixel points among the eight-neighboring pixel points is less than the preset number.

[0038] Specifically, the step 333 includes:

[0039] Step 3331: Arbitrarily select a first preselection point and a second preselection point in the straight line detection preselection point set to determine the initial straight line;

[0040] Step 3332: Calculate the second distance from each of the remaining points in the set of preselected points for line detection to the initial line, and record the second quantity of the preselected points that meet the fourth preset condition, where the fourth preset condition is that the second distance is less than the second preset distance threshold;

[0041] Step 3333: Determine whether the second quantity is greater than the second preset quantity threshold. If yes, proceed to the next step; otherwise, determine that the initial line does not meet the requirements and return to Step 3331;

[0042] Step 3334: Repeat the above steps for the second preset number of times, and determine the initial line corresponding to the largest of the second quantities as the optimal line;

[0043] Step 3335: After deleting the preselected points included in the optimal line from the set of preselected points for line detection, use it as the new set of preselected points for line detection, and return to Step 3331 until the fifth preset condition is satisfied and then end. The fifth preset condition is that a line with a second quantity greater than the second preset quantity threshold cannot be obtained from the set of preselected points for line detection.

[0044] Specifically, Step 34 includes:

[0045] Step 341: Determine whether there are feature line segments in both the left FOV and the right FOV of the TOF camera. If yes, proceed to the next step; otherwise, proceed to Step 344;

[0046] Step 342: Traverse the pixel points on the feature line segment in the left FOV, and determine the pixel points that meet the first preset judgment condition as the first feature points, and the pixel points that meet the second preset judgment condition as the second feature points;

[0047] Step 343: Traverse the pixel points on the feature line segment in the right FOV, and determine the pixel points that meet the third preset judgment condition as the third feature points, and the pixel points that meet the fourth preset judgment condition as the fourth feature points;

[0048] Step 344: Traverse the pixel points on the feature line segment in the left FOV, and determine the pixel points that meet the first preset judgment condition as the first feature points, and the pixel points that meet the second preset judgment condition as the second feature points;

[0049] Step 345: Project the first feature points and the second feature points onto the FOV center line respectively to obtain the first projection points and the second projection points;

[0050] Step 346: Control the vehicle to travel in a straight line at a first speed uniformly. After a preset duration, use the third projection points and the fourth projection points of the first projection points and the second projection points on the FOV center line as the virtual points of the third feature points and the virtual points of the fourth feature points.

[0051] Specifically, step 4 includes:

[0052] 1) When there are obstacles on both sides:

[0053] L0 = min{(d OB *cosα - d OA *cosβ), (d OD *cosδ - d OC *cosγ)},

[0054] W0 = min{(d OA *sinβ + d OC *sinγ), (d OB *sinα + d OD *sinδ)};

[0055] 2) When there is an obstacle on one side:

[0056] L0 = d OB *cosα - d OA *cosβ,

[0057] W0 = min{d OA *sinβ, d OB *sinα} + V0t1;

[0058] Among them, L0 represents the length of the target parking space, W0 represents the width of the target parking space, d OA and d OB respectively represent the distances from the first feature point A and the second feature point B to the TOF camera, β represents the angle between the line connecting the first feature point A and the origin O and the Y-axis, α represents the angle between the line connecting the second feature point B and the origin O and the Y-axis, V0 represents the current vehicle speed of the vehicle, t1 represents the preset duration, and min{} represents taking the minimum value.

[0059] Specifically, step 5 includes:

[0060] Step 51, determine whether the length of the target parking space is less than the preset length of the target horizontal parking space. If so, it is determined as an invalid parking space; otherwise, proceed to the next step;

[0061] Step 52, determine whether the length of the target parking space is equal to or greater than the preset length of the vertical parking space. If so, proceed to the next step; otherwise, proceed to step 54;

[0062] Step 53, determine whether the width of the target parking space is equal to or greater than the preset width of the vertical parking space. If so, it is determined as a vertical parking space; otherwise, proceed to the next step;

[0063] Step 54: Determine whether the width of the target parking space is equal to or greater than the preset width of the target horizontal parking space. If so, it is determined as a horizontal parking space; otherwise, it is determined as an invalid parking space.

[0064] The beneficial effects of the present invention are as follows: By establishing a parking space detection coordinate system, initializing the preset parameters of the target parking space, obtaining the point cloud map of the obstacle, and extracting the preset feature points of the obstacle, the length and width of the target parking space are determined. Then, based on the length, width of the target parking space and the preset parameters of the target parking space, parking space determination is carried out, realizing reliable parking space detection at low cost. Brief Description of the Drawings

[0065] Figure 1 is a schematic flow chart of the parking space detection method based on a TOF camera of the present invention;

[0066] Figure 2 is a schematic diagram of the obstacle feature points of the present invention;

[0067] Figure 3 is a schematic diagram of the vertical parking space and horizontal parking space of the present invention. Detailed Embodiment

[0068] The following specifically clarifies the implementation manner of the present invention in conjunction with the drawings. The drawings are only for reference and illustration, and do not constitute a limitation on the protection scope of the patent of the present invention.

[0069] As Figure 1 shown, this embodiment provides a parking space detection method based on a TOF camera, including:

[0070] Step 1: Establish a parking space detection coordinate system XOY.

[0071] In this embodiment, the TOF camera is installed on both sides of the vehicle head. This embodiment takes the detection of the parking space on the right side of the vehicle's forward direction as an example for illustration. It should be understood that the method for detecting the parking space on the right side of the vehicle's forward direction is the same.

[0072] In this embodiment, the parking space detection coordinate system XOY takes the TOF camera as the coordinate origin O, the direction parallel to the vehicle's forward direction as the X-axis, and the direction perpendicular to the vehicle's forward direction as the Y-axis, as Figure 2 shown.

[0073] Figure 2 The vehicle where the midpoints A, B, C, and D are located is only a schematic representation of two adjacent obstacles, and is not necessarily a vehicle, and may also be other obstacles, such as walls, accumulations, etc.

[0074] Step 2: Initialize the preset parameters of the target parking space. The preset parameters of the target parking space include: the preset length L1 and preset width W1 of the target vertical parking space, and the preset length L2 and preset width W2 of the target horizontal parking space.

[0075] In this embodiment, the preset lengths and preset widths of the target vertical parking space and the target horizontal parking space satisfy the following relationships: L1 > L2, W1 < W2, as Figure 3 shown.

[0076] In specific implementation, the preset parameters of the target parking space can be set according to the length and width parameters of the vehicle itself.

[0077] Step 3: Obtain the point cloud map of the obstacle and extract the preset feature points of the obstacle.

[0078] In specific implementation, when the vehicle travels horizontally and an obstacle is detected in the left and / or right FOV regions of the TOF camera at time t0, the parking space detection is started.

[0079] In this embodiment, Step 3 includes:

[0080] Step 31: Read the original point cloud data set C0 obtained by the TOF camera.

[0081] In this embodiment, the original point cloud data set C0 is a matrix of m × n × 3, where m × n represents the resolution of the TOF camera, and 3 represents that each point cloud data contains the XYZ three-dimensional coordinate values of the current pixel point, and Z is the distance value of the obstacle measured by the TOF camera.

[0082] Step 32: Denoise the original point cloud data set C0 to obtain a denoised point cloud data set C.

[0083] In this embodiment, Step 32 includes:

[0084] Step 321: Traverse the original point cloud data set C0 and calculate the first adjacent parameter S1, the second adjacent parameter S2, the third adjacent parameter S3, and the fourth adjacent parameter S4 of the current pixel point c i,j The first adjacent parameter S1, the second adjacent parameter S2, the third adjacent parameter S3, and the fourth adjacent parameter S4 are the sum of the absolute values of the differences in the distance values d i,j of the current pixel point c i,j and the distance values of the pixels adjacent to the four vertices of the current pixel point c i,j .

[0085] That is, in this embodiment:

[0086]

[0087]

[0088]

[0089]

[0090] Step 322: Obtain the minimum adjacent parameter Smin, where the minimum adjacent parameter Smin is the minimum value among the first adjacent parameter S1, the second adjacent parameter S2, the third adjacent parameter S3, and the fourth adjacent parameter S4.

[0091] Step 323: Calculate the fifth parameter S5 of the current pixel point c i,j , where the fifth parameter S5 is the sum of the absolute values of the differences between the distance value d i,j of the current pixel point c i,j and the distance values of its 8 adjacent pixels.

[0092] That is, in this embodiment:

[0093]

[0094] Step 324: If the minimum adjacent parameter Smin is less than the first preset threshold S t1 , and the fifth parameter S5 is greater than the second preset threshold S t2 , then retain the point cloud data of the current pixel point; otherwise, delete the point cloud data of the current pixel point.

[0095] Among them, the first preset threshold S t1 and S t2 can be determined by experimental results.

[0096] Step 33: Detect the feature straight line segments of obstacles based on the denoised point cloud data set C.

[0097] In this embodiment, the step 33 includes:

[0098] Step 331: Detect a feature plane from the denoised point cloud data set C.

[0099] Step 332: Obtain a set Q of straight line detection preselected points from the feature plane.

[0100] Step 333: Detect the feature straight line segments from the set Q of straight line detection preselected points.

[0101] In this embodiment, the step 331 includes:

[0102] Step 3311: Arbitrarily select the first point cloud data c 1r , the second point cloud data c 2r , and the third point cloud data c 3r in the denoised point cloud data set C to construct an initial plane P r , and calculate the first normal vector v 1r , the second normal vector v 2r, the third normal vector v 3r , the fourth normal vector v pr , the first normal vector v 1r , the second normal vector v 2r , the third normal vector v 3r is the normal vector corresponding to the first point cloud data c 1r , the second point cloud data c 2r , the third point cloud data c 3r , the fourth normal vector v pr is the normal vector of the initial plane P r .

[0103] Step 3312, determine whether the initial plane P r meets the preset angle condition. If so, proceed to the next step; otherwise, return to the previous step. The preset angle condition is that the angles between the first normal vector v 1r , the second normal vector v 2r , the third normal vector v 3r and the fourth normal vector v pr are all less than the preset angle threshold ω0.

[0104] Step 3313, calculate the first distance h r between other point cloud data in the denoised point cloud dataset C and the initial plane P r1 and the first angle ω r , record the first quantity a of the point cloud data that meets the first preset condition. The first preset condition is that the first distance h r1 is less than the first preset distance threshold h1, and the first angle ω r is less than the preset angle threshold ω0.

[0105] Step 3314, determine whether the first quantity a is greater than the first preset quantity threshold a0. If so, proceed to the next step; otherwise, determine that the initial plane P r does not meet the requirements and return to Step 3311.

[0106] Step 3315, repeat the above steps for the first preset number of times, and determine the initial plane P r_max corresponding to the largest value among the first quantity a as the optimal plane P best .

[0107] Step 3316, delete the point cloud data included in the optimal plane P best from the denoised point cloud dataset C to obtain a new denoised point cloud dataset C, and return to Step 3311 until the second preset condition is satisfied and then end. The second preset condition is that no plane with the first quantity a greater than the first preset quantity threshold a0 can be detected from the denoised point cloud dataset C.

[0108] In this embodiment, step 332 includes:

[0109] Step 3321: Project the point cloud included in the optimal plane P best onto the optimal plane P best .

[0110] Step 3322: Determine the minimum bounding rectangle R of all the projected points, record the pixel point numbers of the minimum bounding rectangle R, and mark the pixel points with projected points in the minimum bounding rectangle R as feature pixel points.

[0111] Step 3323: Use the pixel points in the minimum bounding rectangle R that meet the third preset condition as the set Q of preselected points for line detection. The third preset condition is that the pixel point has no eight-connected adjacent pixel points and is a feature pixel point, or the pixel point has eight-connected adjacent pixel points and the number of feature pixel points among the eight-connected adjacent pixel points is less than a preset number.

[0112] In this embodiment, the preset number is 6.

[0113] In this embodiment, step 333 includes:

[0114] Step 3331: Arbitrarily select a first preselected point q 1r and a second preselected point q 2r in the set Q of preselected points for line detection to determine an initial line L r .

[0115] Step 3332: Calculate the second distance h r from each of the remaining points in the set Q of preselected points for line detection to the initial line L r2 , record the second number b of preselected points that meet the fourth preset condition. The fourth preset condition is that the second distance h r2 is less than a second preset distance threshold h2.

[0116] Step 3333: Determine whether the second number b is greater than a second preset number threshold b0. If yes, proceed to the next step; otherwise, determine that the initial line L r does not meet the requirements and return to step 3331.

[0117] Step 3334: Repeat the above steps for a second preset number of times, and determine the initial line L corresponding to the largest value among the second numbers b as the optimal line L b_max . best

[0118] Step 3335: Delete the optimal line L from the set Q of preselected points for line detection bestAfter including the preselected points, use them as the new set Q of preselected points for line detection, and return to step 3331 until the fifth preset condition is satisfied and then end. The fifth preset condition is that a line with the second quantity b greater than the second preset quantity threshold b0 cannot be obtained from the set Q of preselected points for line detection.

[0119] Step 34: Extract preset obstacle feature points from the characteristic straight line segments of the obstacle.

[0120] In this embodiment, step 34 includes:

[0121] Step 341: Determine whether there are characteristic straight line segments in both the left FOV and the right FOV of the TOF camera. If so, proceed to the next step; otherwise, go to step 344.

[0122] Step 342: Traverse the pixel points on the characteristic straight line segments in the left FOV, and determine the pixel points that meet the first preset judgment condition as the first feature point A, and determine the pixel points that meet the second preset judgment condition as the second feature point B.

[0123] In this embodiment, the first preset judgment condition is:

[0124]

[0125] The second preset judgment condition is:

[0126]

[0127] Where i and j represent the row and column numbers of the pixel points on the characteristic straight line segment.

[0128] Step 343: Traverse the pixel points on the characteristic straight line segments in the right FOV, and determine the pixel points that meet the third preset judgment condition as the third feature point C, and determine the pixel points that meet the fourth preset judgment condition as the fourth feature point D.

[0129] In this embodiment, the third preset judgment condition is:

[0130]

[0131] The fourth preset judgment condition is:

[0132]

[0133] Where i and j represent the row and column numbers of the pixel points on the characteristic straight line segment, and k and l are any pixel point other than the pixel point (i, j), and i, k < m, j, l < n.

[0134] Step 344: Traverse the pixel points on the feature straight line segment within the left FOV, determine the pixel points that meet the first preset judgment condition as the first feature point A, and determine the pixel points that meet the second preset judgment condition as the second feature point B.

[0135] Step 345: Project the first feature point A and the second feature point B onto the FOV center line respectively to obtain the first projection point M and the second projection point N.

[0136] Step 346: Control the vehicle to travel in a straight line at a constant speed of the first speed V0. After a preset time period t1, use the third projection point and the fourth projection point of the first projection point M and the second projection point N on the FOV center line as the virtual points of the third feature point C and the virtual points of the fourth feature point D.

[0137] In this embodiment, the preset time period t1 is preset according to the maximum parking space width (the width of a parallel parking space).

[0138] Step 4: Determine the length L0 and width W0 of the target parking space according to the preset feature points of the obstacle.

[0139] In this embodiment, Step 4 includes:

[0140] 1) When there are obstacles on both sides:

[0141] The length L0 of the target parking space = min{(d OB *cosα - d OA *cosβ), (d OD *cosδ - d OC *cosγ)}

[0142] The width W0 of the target parking space = min{(d OA *sinβ + d OC *sinγ), (d OB *sinα + d OD *sinδ)}

[0143] Where d OA , d OB , d OC , d OD respectively represent the distances from the first feature point A, the second feature point B, the third feature point C, and the fourth feature point D to the TOF camera, β represents the angle between the line connecting the first feature point A and the origin O and the Y-axis, α represents the angle between the line connecting the second feature point B and the origin O and the Y-axis, γ represents the angle between the line connecting the third feature point C and the origin O and the Y-axis, δ represents the angle between the line connecting the fourth feature point D and the origin O and the Y-axis, and min{} represents taking the minimum value.

[0144] 2) When there is an obstacle on one side:

[0145] The length L0 of the target parking space is L0 = d OB *cosα - d OA *cosβ;

[0146] The width W0 of the target parking space is W0 = min{d OA *sinβ, d OB *sinα} + V0t1

[0147] where d OA , d OB respectively represent the distances from the first feature point A and the second feature point B to the TOF camera, β represents the angle between the line connecting the first feature point A and the origin O and the Y-axis, α represents the angle between the line connecting the second feature point B and the origin O and the Y-axis, V0 represents the current vehicle speed, t1 represents the preset duration, and min{} represents taking the minimum value.

[0148] In this embodiment, d OA , d OB , d OC , d OD , α, β, γ, δ can be directly obtained from the point cloud data according to the pixel position where the point is located.

[0149] Step 5: Determine the parking space according to the length L0, width W0 of the target parking space and the preset parameters of the target parking space.

[0150] In this embodiment, step 5 includes:

[0151] Step 51: Determine whether the length L0 of the target parking space is less than the preset length L2 of the target horizontal parking space. If so, it is determined as an invalid parking space; otherwise, proceed to the next step.

[0152] Step 52: Determine whether the length L0 of the target parking space is equal to or greater than the preset length L1 of the vertical parking space. If so, proceed to the next step; otherwise, proceed to step 54.

[0153] Step 53: Determine whether the width W0 of the target parking space is equal to or greater than the preset width W1 of the vertical parking space. If so, it is determined as a vertical parking space; otherwise, proceed to the next step.

[0154] Step 54: Determine whether the width W0 of the target parking space is equal to or greater than the preset width W2 of the target horizontal parking space. If so, it is determined as a horizontal parking space; otherwise, it is determined as an invalid parking space.

[0155] The above-disclosed are only the preferred embodiments of the present invention, and the scope of the rights of the present invention cannot be limited thereby. Therefore, equivalent changes made according to the scope of the patent application of the present invention still fall within the scope covered by the present invention.

Claims

1. A parking space detection method based on a TOF camera, characterized in that, Including: Step 1: Establish a parking space detection coordinate system; Step 2: Initialize the preset parameters of the target parking space. The preset parameters of the target parking space include: the preset length and width of the target vertical parking space, and the preset length and width of the target horizontal parking space; Step 3: Obtain the point cloud map of the obstacle and extract the preset feature points of the obstacle; Step 4: Determine the length and width of the target parking space according to the preset feature points of the obstacle; Step 5: Perform parking space determination according to the length and width of the target parking space and the preset parameters of the target parking space; The said Step 3 includes: Step 31: Read the original point cloud data set obtained by the TOF camera; Step 32: Denoise the original point cloud data set to obtain a denoised point cloud data set; Step 33: Detect the feature straight line segments of the obstacle according to the denoised point cloud data set; Step 34: Extract the preset obstacle feature points from the feature straight line segments of the obstacle; The said Step 33 includes: Step 331: Detect the feature plane from the denoised point cloud data set; Step 332: Obtain the straight line detection preselection point set from the feature plane; Step 333: Detect the feature straight line segments from the straight line detection preselection point set; The said Step 331 includes: Step 3311: Arbitrarily select the first point cloud data, the second point cloud data, and the third point cloud data in the denoised point cloud data set to construct an initial plane, and calculate the first normal vector, the second normal vector, the third normal vector, and the fourth normal vector. The first normal vector, the second normal vector, and the third normal vector are the normal vectors corresponding to the first point cloud data, the second point cloud data, and the third point cloud data respectively, and the fourth normal vector is the normal vector of the initial plane; Step 3312: Judge whether the initial plane meets the preset angle condition. If so, go to the next step; otherwise, return to the previous step. The preset angle condition is that the angles between the first normal vector, the second normal vector, the third normal vector and the fourth normal vector are all less than the preset angle threshold; Step 3313: Calculate the first distance and the first angle between other point cloud data in the denoised point cloud data set and the initial plane, and record the first quantity of the point cloud data that meets the first preset condition. The first preset condition is that the first distance is less than the first preset distance threshold and the first angle is less than the preset angle threshold; Step 3314: Judge whether the first quantity is greater than the first preset quantity threshold. If so, go to the next step; otherwise, judge that the initial plane does not meet the requirements and return to Step 3311; Step 3315: Repeat the above steps for the first preset number of times, and determine the initial plane corresponding to the largest value in the first quantity as the optimal plane; Step 3316: Delete the point cloud data included in the optimal plane from the denoised point cloud data set as the new denoised point cloud data set, and return to Step 3311 until the second preset condition is satisfied and then end. The second preset condition is that no plane with the first quantity greater than the first preset quantity threshold can be detected from the denoised point cloud data set; The said Step 332 includes: Step 3321: Project the point cloud included in the optimal plane onto the optimal plane; Step 3322: Determine the minimum bounding rectangle R of all projection points, record the pixel point numbers of the minimum bounding rectangle, and mark the pixel points with projection points in the minimum bounding rectangle as feature pixel points; Step 3323: Use the pixel points in the minimum bounding rectangle that meet the third preset condition as the set of preselected points for line detection. The third preset condition is that the pixel point has no eight-connected pixel points and is a feature pixel point, or the pixel point has eight-connected pixel points and the number of feature pixel points among the eight-connected pixel points is less than the preset number; The said step 333 includes: Step 3331: Arbitrarily select a first preselected point and a second preselected point in the set of preselected points for line detection to determine an initial line; Step 3332: Calculate the second distance from each of the remaining points in the set of preselected points for line detection to the initial line, and record the second number of preselected points that meet the fourth preset condition. The fourth preset condition is that the second distance is less than the second preset distance threshold; Step 3333: Judge whether the second number is greater than the second preset number threshold. If so, proceed to the next step; otherwise, judge that the initial line does not meet the requirements and return to step 3331; Step 3334: Repeat the above steps for the second preset number of times, and determine the initial line corresponding to the largest second number as the optimal line; Step 3335: After deleting the preselected points included in the optimal line from the set of preselected points for line detection, use it as a new set of preselected points for line detection, and return to step 3331 until the fifth preset condition is met and then end. The fifth preset condition is that a line with a second number greater than the second preset number threshold cannot be obtained from the set of preselected points for line detection; The said step 34 includes: Step 341: Judge whether there are feature line segments in both the left FOV and the right FOV of the TOF camera. If so, proceed to the next step; otherwise, proceed to step 344; Step 342: Traverse the pixel points on the feature line segments in the left FOV, and determine the pixel points that meet the first preset judgment condition as the first feature points, and the pixel points that meet the second preset judgment condition as the second feature points; Step 343: Traverse the pixel points on the feature line segments in the right FOV, and determine the pixel points that meet the third preset judgment condition as the third feature points, and the pixel points that meet the fourth preset judgment condition as the fourth feature points; Step 344: Traverse the pixel points on the feature line segments in the left FOV, and determine the pixel points that meet the first preset judgment condition as the first feature points, and the pixel points that meet the second preset judgment condition as the second feature points; Step 345: Project the first feature point and the second feature point onto the FOV center line respectively to obtain the first projection point and the second projection point; Step 346: Control the vehicle to travel in a straight line at a first speed uniformly. After a preset time, use the third projection point and the fourth projection point of the first projection point and the second projection point on the FOV center line as the virtual points of the third feature point and the fourth feature point; The first preset judgment condition is: The second preset judgment condition is: The third preset judgment condition is: The fourth preset judgment condition is as follows: Where i and j represent the row and column numbers of the pixel points on the characteristic straight line segment, k and l are any pixel points except the pixel point (i, j), i, k < m, j, l < n; d represents the distance value of the pixel point.

2. The method for detecting a parking space based on a TOF camera according to claim 1, wherein The step 32 includes: Step 321: Traverse the original point cloud data set, and calculate the first adjacent parameter, the second adjacent parameter, the third adjacent parameter, and the fourth adjacent parameter of the current pixel point. The first adjacent parameter, the second adjacent parameter, the third adjacent parameter, and the fourth adjacent parameter are the sum of the absolute values of the differences between the distance value of the current pixel point and the distance values of the pixels adjacent to the four vertices of the current pixel point. Step 322: Obtain the minimum adjacent parameter, and the minimum adjacent parameter is the minimum of the first adjacent parameter, the second adjacent parameter, the third adjacent parameter, and the fourth adjacent parameter. Step 323: Calculate the fifth parameter of the current pixel point, and the fifth parameter is the sum of the absolute values of the differences between the distance value of the current pixel point and the distance values of its 8 adjacent pixels. Step 324: If the minimum adjacent parameter is less than the first preset threshold and the fifth parameter is greater than the second preset threshold, then retain the point cloud data of the current pixel point; otherwise, delete the point cloud data of the current pixel point.

3. The parking space detection method based on a TOF camera according to claim 1, wherein The step 4 includes: 1) When there are obstacles on both sides: L0 = min{(d OB * cosα - d OA * cosβ), (d OD * cosδ - d OC * cosγ)}, W0 = min{(d OA * sinβ + d OC * sinγ), (d OB * sinα + d OD * sinδ)}; 2) When there is an obstacle on one side: L0 = d OB *cosα - d OA *cosβ, W0 = min{d OA *sinβ, d OB *sinα} + V0t1; Among them, L0 represents the length of the target parking space, W0 represents the width of the target parking space, d OA , d OB , d OC , d OD respectively represent the distances between the first feature point A, the second feature point B, the third feature point C, the fourth feature point D and the TOF camera, β represents the angle between the line connecting the first feature point A and the origin O and the Y-axis, α represents the angle between the line connecting the second feature point B and the origin O and the Y-axis, β represents the angle between the line connecting the first feature point A and the origin O and the Y-axis, γ represents the angle between the line connecting the third feature point C and the origin O and the Y-axis, δ represents the angle between the line connecting the fourth feature point D and the origin O and the Y-axis, V0 represents the current vehicle speed of the vehicle, t1 represents the preset duration, and min{} represents taking the minimum value.

4. The parking space detection method based on a TOF camera according to claim 3, wherein The step 5 includes: Step 51: Judge whether the length of the target parking space is less than the preset length of the target horizontal parking space. If so, judge it as an invalid parking space; otherwise, go to the next step. Step 52: Judge whether the length of the target parking space is equal to or greater than the preset length of the vertical parking space. If so, go to the next step; otherwise, go to step 54. Step 53: Judge whether the width of the target parking space is equal to or greater than the preset width of the vertical parking space. If so, judge it as a vertical parking space; otherwise, go to the next step. Step 54: Judge whether the width of the target parking space is equal to or greater than the preset width of the target horizontal parking space. If so, judge it as a horizontal parking space; otherwise, judge it as an invalid parking space.

Citation Information

Patent Citations

  • Parking space recognition method and system based on data fusion

    CN114056324A

  • Parking position detecting system based on TOF camera

    CN205230369U