Parking space detection method and device, computer device and storage medium

CN115700814BActive Publication Date: 2026-09-29CHANGSHA INTELLIGENT DRIVING INST CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110802843.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-15
Publication Date
2026-09-29
Estimated Expiration
2041-07-15

AI Technical Summary

Technical Problem

但是,在图像处理过程中,常存在因摄像头采集或图像处理(如拼接)原因,导致会出现图像形变

Benefits of technology

[0042]上述停车位检测方法、装置、计算机设备和存储介质,该方法通过对停车位线提取线段,再进行分类的方式,使每条停车位线表示为一类线段集合,并进行直线拟合的方式还原停车位线,能够屏蔽线段端点集合中因形变出现的噪声点,保证大多数点集中在拟合直线周围,减少了形变带来的定位误差,以此为基础,根据各线段子集的最值端点和拟合直线的交点,确定停车位的关键点,提高了停车位的定位点检测的检测效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700814B_ABST
    Figure CN115700814B_ABST
Patent Text Reader

Abstract

The application relates to a parking space detection method and device, computer equipment and a storage medium. The method extracts a line segment from a parking space line, classifies the line segment, represents each parking space line as a line segment set, restores the parking space line through straight line fitting, shields noise points in a line segment endpoint set caused by deformation, ensures that most points are concentrated around the fitted straight line, reduces positioning errors caused by deformation, and determines key points of the parking space based on the intersection of the maximum and minimum endpoints of each line segment subset and the fitted straight line, thereby improving the detection effect of the positioning point detection of the parking space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of intelligent driving and image processing technology, and in particular to a parking space detection method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Precise parking space location is one of the key technologies in the field of intelligent driving. Currently, the main methods focus on using multiple sensors or high-precision maps for parking space location of small vehicles. However, multi-sensor methods are costly, and some parking spaces do not have high-precision maps, which limits the use of multi-sensor or high-precision map positioning methods.

[0003] Therefore, using cameras for parking space detection has become a trend. This method acquires images of parking spaces using a camera, detects the parking spaces, extracts the parking space lines, and then extracts the intersections on the parking space lines to determine the key points of the parking space. However, during image processing, image distortion often occurs due to camera acquisition or image processing (such as stitching). Once a distorted parking space appears, local lines and points may not be able to be separated, increasing the risk of losing parking space locations in complex environments such as distorted images, reducing the stability of key point extraction, and thus failing to effectively detect parking spaces. Summary of the Invention

[0004] Therefore, it is necessary to provide a parking space detection method, device, computer equipment, and storage medium that can improve the detection effect in response to the above-mentioned technical problems.

[0005] A parking space detection method, the method comprising:

[0006] Obtain the pixel image of the parking space line in the parking space image;

[0007] The parking space line pixel image is processed to extract the parking space lines;

[0008] Extract the set of line segments of the parking space lines and obtain the coordinates of the two endpoints of each line segment;

[0009] Based on the coordinates of the two endpoints of each line segment in the line segment set, each line segment is classified according to its slope and a first distance, resulting in a subset of line segments included in each category; wherein, the first distance is the distance from the midpoint of one line segment to the other line segment in any two line segments;

[0010] Based on the endpoint coordinates of each line segment in the line segment subset, a straight line is fitted to obtain the fitted straight line corresponding to each line segment subset;

[0011] Determine the intersection points of all the fitted lines;

[0012] Based on the intersection of the extreme endpoints of various line segment subsets and the fitted straight line, the key points of each parking space are determined, wherein the extreme endpoints include the maximum endpoint and / or the minimum endpoint.

[0013] In one embodiment, acquiring the parking space line pixel image of the parking space image includes:

[0014] Images of parking spaces were acquired;

[0015] The parking space image is input into a trained generative adversarial network (GAN), and the generator of the GAN generates a pixel image of the parking space lines in the parking space image; wherein the GAN is trained based on the parking space image and the pixel image of the parking space lines in the labeled parking space image.

[0016] In one embodiment, acquiring the parking space image includes:

[0017] Acquire images of parking space areas captured by multiple cameras;

[0018] The images of the parking space areas are matched and stitched together to obtain a panoramic parking space image.

[0019] In one embodiment, processing the parking space line pixel image to extract the parking space lines includes:

[0020] The parking space line pixel image is binarized to obtain the line region;

[0021] After performing morphological processing on the line region, the lines are extracted and then processed.

[0022] The parking space lines are obtained by skeletonization.

[0023] In one embodiment, the step of classifying each line segment according to its slope and a first distance based on the coordinates of the two endpoints of each line segment in the line segment set, to obtain a subset of line segments included in each category, includes:

[0024] Based on the coordinates of the endpoints of each line segment in the line segment set, the slope of each line segment and the first distance from the midpoint of one line segment to another line segment are obtained. Line segments whose slope difference and the average of the first distance between any two line segments are both less than the corresponding threshold are classified into one category, and a coarsely divided subset of line segments is obtained for each category.

[0025] In another embodiment, the method further includes:

[0026] For each coarsely segmented subset of line segments, the endpoints are sorted according to their endpoint coordinates to obtain an endpoint sequence. If there is no parking space line information in the intermediate interval point between adjacent endpoints in the endpoint sequence, the corresponding adjacent endpoints are divided into two different categories to obtain a subdivided subset of line segments. Each subdivided subset of line segments corresponds to a parking space line segment in the parking space image. The coarsely segmented subset of line segments is used for line fitting, and the subdivided subset of line segments is used to determine the extreme endpoints.

[0027] In one embodiment, key points for each parking space are determined based on the intersection of the extreme endpoints of various subsets of line segments and the fitted straight line, including:

[0028] Obtain the extreme value endpoint pairs of each of the subdivided line segment subsets, wherein the extreme value endpoint pairs include the maximum endpoint and the minimum endpoint;

[0029] Based on the intersection of the fitted straight lines and the coordinates of the extreme endpoint pairs of each subdivided segment subset, the intersection of each parking space and the extreme endpoints within the range of adjacent intersections of each parking space are determined to obtain candidate endpoints, where the intersection points represent the boundary vertices of the parking spaces.

[0030] Based on the distance between the candidate endpoint and the intersection point, the candidate endpoint that is far away from the intersection point is determined as the target endpoint, and the target endpoint represents the location point of the parking space entrance or the location point of the obscured parking space line;

[0031] Based on the intersection point and the target endpoint, the key points of the parking space are obtained.

[0032] A parking space detection device, the device comprising:

[0033] The image acquisition module is used to acquire the pixel image of the parking space line in the parking space image;

[0034] The image processing module is used to process the pixel image of the parking space line and extract the parking space line.

[0035] The line segment extraction module is used to extract the set of line segments of the parking space line and obtain the coordinates of the two endpoints of each line segment.

[0036] The classification module is used to classify each line segment according to its slope and a first distance based on the coordinates of the two endpoints of each line segment in the line segment set, so as to obtain a subset of line segments included in each category; wherein, the first distance is the distance from the midpoint of one line segment to the other line segment in any two line segments;

[0037] The line fitting module is used to perform line fitting based on the endpoint coordinates of each line segment in the line segment subset to obtain the fitted line corresponding to each line segment subset.

[0038] The intersection point determination module is used to determine the intersection points of the fitted lines.

[0039] The key point acquisition module is used to determine the key points of each parking space based on the intersection of the extreme endpoints of various line segment subsets and the fitted straight line, wherein the extreme endpoints include the maximum endpoint and / or the minimum endpoint.

[0040] A computer device includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of the methods described in the above embodiments.

[0041] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the methods described in the above embodiments.

[0042] The aforementioned parking space detection method, device, computer equipment, and storage medium extract line segments from the parking space lines and classify them to represent each parking space line as a set of line segments. The method then reconstructs the parking space lines by fitting straight lines, which can shield noise points caused by deformation in the set of line segment endpoints. This ensures that most points are concentrated around the fitted straight line, reducing positioning errors caused by deformation. Based on this, the key points of the parking space are determined according to the intersection of the extreme endpoints of each line segment subset and the fitted straight line, thus improving the detection effect of parking space positioning points. Attached Figure Description

[0043] Figure 1 This is a diagram illustrating the application environment of a parking space detection method in one embodiment.

[0044] Figure 2 This is a flowchart illustrating a parking space detection method in one embodiment;

[0045] Figure 3 This is a panoramic view of parking spaces in one embodiment;

[0046] Figure 4 for Figure 3 The parking space image is a pixel image of the parking space lines;

[0047] Figure 5 for Figure 4 A binary image of the parking space line pixel image;

[0048] Figure 6 According to Figure 5 The skeleton diagram of parking lines extracted from the binary image;

[0049] Figure 7 A schematic diagram of one area of ​​the parking space line skeleton diagram;

[0050] Figure 8 for Figure 7 A schematic diagram of the line segments corresponding to the area;

[0051] Figure 9 A skeleton diagram of parking space lines where the lines are obstructed;

[0052] Figure 10 This is a schematic diagram of a coarsely divided line segment set as an example;

[0053] Figure 11 To Figure 10 A schematic diagram of the subdivision results obtained by further subdividing the coarse line segment set;

[0054] Figure 12 This is a schematic diagram of the fitted straight line for a parking space in one embodiment;

[0055] Figure 13 This is a schematic diagram of key points of a parking space in one embodiment;

[0056] Figure 14 This is a schematic diagram illustrating the coordinate range between the first and second intersection points in one embodiment, including the extreme value endpoint pairs.

[0057] Figure 15 This is a schematic diagram illustrating the intersection of the coordinate range between the first and second intersection points and the extreme endpoints in one embodiment.

[0058] Figure 16 This is a schematic diagram of key points of a parking space in yet another embodiment;

[0059] Figure 17 A schematic diagram of key points of a parking space in another embodiment;

[0060] Figure 18 This is a structural block diagram of a parking space detection device in one embodiment;

[0061] Figure 19 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0063] The parking space detection method provided in this application can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1As shown, the vehicle is equipped with a camera 102 and a vehicle controller 103, which is communicatively connected to an edge computing server 105. The camera 102 can be mounted on the top front, top rear, or top side of the vehicle. When the vehicle triggers a parking command, the camera captures images of the surrounding area to obtain a parking space image, which is then sent to the vehicle controller or edge computing server. The vehicle controller or edge computing server then implements a parking space detection method to obtain key information about the parking space. The parking space is not limited to parallel parking spaces or reverse parking spaces.

[0064] In one embodiment, such as Figure 2 As shown, a parking method is provided, which is applied to Figure 1 Taking an edge computing server or vehicle controller as an example, the following steps are included:

[0065] Step 202: Obtain the parking space line pixel image of the parking space image.

[0066] The parking space image is taken by the vehicle's camera and further processed into a pixel image of the parking space lines. This pixel image contains only the pixel information of the parking space lines, removing other pixel information irrelevant to the parking space, such as information about the surrounding environment.

[0067] Specifically, acquiring the parking space line pixel image of a parking space image includes: acquiring a parking space image, inputting the parking space image into a trained generative adversarial network (GAN), and generating the parking space line pixel image of the parking space image through the generator of the GAN; wherein the GAN is trained based on the parking space image and the parking space line pixel image of the labeled parking space image.

[0068] When a parking command is triggered, a data acquisition command is sent to the vehicle's camera, which then captures an image of the parking space. The parking space can be a parallel parking space or a reverse parking space.

[0069] In practical applications, especially in the field of intelligent driving, vehicles are typically equipped with multiple cameras to broaden the field of view. This is particularly true for large vehicles, where the increased size of the vehicle and parking spaces necessitates a wider field of view. Therefore, multiple cameras are usually installed to achieve a better field of view. Thus, acquiring a parking space image (including the pixel images of the parking space lines) involves: acquiring parking space area images from multiple cameras; matching and stitching the parking space area images to obtain a panoramic parking space image.

[0070] Each camera captures an image of a parking space area within its line of sight. Then, image matching is used to match adjacent parking space area images to determine matching points. These matching points are then stitched together to obtain a panoramic parking space image. An example of a panoramic parking space image is shown below. Figure 3 As shown.

[0071] In practical applications, the stitched surround-view parking space image has a wider field of vision, resulting in a corresponding increase in storage space and image processing time. This leads to increased time consumption in segmenting the surround-view parking space image to obtain the rectangular region of the parking space. Furthermore, using traditional image recognition techniques to segment parking space lines from the image is susceptible to noise and exhibits instability.

[0072] To address this issue, this application uses a pre-trained generative adversarial network (GAN) to extract parking space pixel images from parking space images. Specifically, the parking space image is input into the pre-trained GAN, and the generator of the GAN generates parking space line pixel images from the parking space image; wherein the GAN is trained based on the parking space image and the parking space line pixel images of the labeled parking space images.

[0073] Specifically, a generative adversarial network (GAN) model mainly consists of two parts: a generator and a discriminator. The generator generates images from input data based on the task and through model training. The discriminator determines whether the generated image is a real image. After the training phase, a generator capable of accurately extracting image information is obtained, and this generator is used to extract image information. One embodiment utilizes the generator of a GAN to extract... Figure 3 The parking space image contains pixel images of the parking space lines, such as... Figure 4 As shown.

[0074] Specifically, in this application, the sample set includes parking space images and the corresponding parking space pixel images of the labeled parking space images. During the training phase, the generator generates parking space line pixel images of the parking space images, and the discriminator determines whether the generated parking space line pixel images are the same as the parking space pixel images of the labeled parking space images.

[0075] Specifically, a training set is obtained, which includes parking space images and the pixel images of the parking space lines of the labeled parking space images; the parking space images in the training set are input into the generator of the generative adversarial network to obtain the pixel images of the parking space lines of the predicted parking space images; the generative adversarial network is used to compare the predicted pixel images of the parking space lines with the labeled pixel images of the parking space lines; the generative adversarial network is trained based on the comparison results, and the goal of the training is to make the predicted pixel images of the parking space lines close to the labeled pixel images.

[0076] First, a generator and discriminator are trained using a generative adversarial network (GAN) and a set of parking space images. Since the geometry of the parking space lines is relatively simple, a general encoder-decoder network generator suffices. The discriminator is a binary classifier that compares pixel distribution differences, comparing the generated parking space pixel images with the labeled parking space pixel images. During training, it continuously monitors whether the randomly generated images from each weight of the generator are the labeled parking space pixel images. Because this discriminator compares pixel distribution, it ensures that the generated images approximate the pixel distribution of real images rather than fixed label images, increasing the diversity of the generated data and ensuring that the generated parking space pixel images are close to the real parking space pixel images. In actual parking space detection, only the GAN generator is needed to segment the parking space pixel images, further reducing the time required for GAN segmentation and improving the stability of the GAN segmentation of unknown parking space lines of interest.

[0077] Step 204: Process the pixel image of the parking space lines to extract the parking space lines.

[0078] Specifically, the parking space line pixel image is binarized to obtain the parking space line.

[0079] Furthermore, the parking space lines are the skeleton of the parking space lines obtained after image thinning. Image thinning refers to the process of reducing the width of lines in a binary image from multiple pixels to a single pixel. Through image thinning, the main features of the parking space lines can be preserved while removing redundant pixels, reducing the amount of computation.

[0080] Specifically, the parking space line pixel image is processed to extract the parking space lines, including: binarizing the parking space line pixel image to obtain the line region; performing morphological processing on the line region, extracting the lines, and performing skeletonization processing on the lines to obtain the parking space lines.

[0081] Binarization refers to setting the grayscale value of pixels in an image to 0 or 255, thus giving the entire image a distinct black and white effect. Binary images play a crucial role in digital image processing; binarization significantly reduces the amount of data in an image, thereby highlighting the contours of the target. Figure 4 After binarizing the pixel image of the parking space line shown, the resulting binary image is as follows: Figure 5 As shown, pixels with a grayscale value of 255 in the binary image correspond to parking space lines, i.e., the line region.

[0082] After binarization, noise may exist at the edges of the line region. In this application, morphological methods are used to denoise the line region. Specifically, morphological erosion is used to remove noise at the edges of the region, then the line region is smoothed by dilation and the holes in the line region are filled. Next, the maximum connected region of the line region is calculated, and then the connected region is contoured to remove small contours with a perimeter less than a threshold. Finally, the denoising of the parking space line is completed, and the corresponding line is obtained.

[0083] The parking space lines undergo skeletonization processing. Specifically, a kernel function is used to refine the binarized lines obtained in the previous step, removing redundant pixels and retaining the main features of the parking space lines as thin, elongated lines. The parking space lines comprise the main skeleton point set of the parking space pixel image; this step reduces the computational load of keypoint detection by reducing the number of keypoints. Figure 5 The parking space line area shown is processed into a skeleton, and the resulting parking space line skeleton is as follows: Figure 6 As shown.

[0084] Step 206: Extract the set of parking space line segments and obtain the coordinates of the two endpoints of each line segment.

[0085] Specifically, the parking space line skeleton is extracted into multiple line segments using the cumulative probability Hough transform. This set of line segments provides the key point set for ultimately obtaining a parking space. Where, L i Let i be the i-th line segment, and n be the total number of line segments. For L i The coordinates of the left and right endpoints of the line segment. Specifically, the parameters of the cumulative probability Hough transform can be set for line segment extraction. These parameters may include the number of surrounding connected points and the data of points in the middle interval. Based on the set parameters, the cumulative probability Hough transform is performed to extract the set of line segments forming the parking space line skeleton. Each line segment has two endpoints, left and right, and the coordinates of these endpoints are obtained. In practical applications, the Hough transform may overlap, leading to overlapping of the found line segments, i.e., errors exist. Figure 7 A region of the parking space line skeleton diagram in the image is subjected to a Hough transform, as shown below. Figure 8 As shown, multiple line segments are superimposed to represent the parking space line at this location.

[0086] Step 208: Based on the coordinates of the two endpoints of each line segment in the line segment set, classify each line segment according to its slope and a first distance to obtain a subset of line segments included in each category; the first distance is the distance from the midpoint of one line segment to the other line segment in any two line segments.

[0087] Specifically, line segments with similar slopes and first distances are grouped into the same category, thus obtaining a subset of line segments included in each category.

[0088] Specifically, based on the coordinates of the endpoints of each line segment in the line segment set, the slope of each line segment and the first distance from the midpoint of one line segment to another line segment are obtained. Line segments in any two line segments whose slope difference and the average of the first distance are both less than the corresponding threshold are classified into one category, and a coarsely divided subset of line segments corresponding to each category is obtained.

[0089] Specifically, the method for coarsely classifying line segments is as follows: based on the coordinates of the two endpoints of each line segment, the slope of the line segment is obtained; based on the slope, the straight line representation of the line segment is obtained; based on the straight line representation of the line segment and the coordinates of the two endpoints, the first distance from the midpoint of one line segment to the other line segment is calculated; based on the slope and the first distance of the two line segments, it is determined whether the two line segments are close; if they are, they are classified as the same category; if not, they are classified as two different categories; this process is repeated until all line segments have a category.

[0090] Specifically, density-based clustering is used to cluster any two line segments. The classification is performed iteratively for i,j≤n, where i and j are the line segment indices. This includes the following steps:

[0091] 1. Calculate the length L of any two line segments respectively. i ,L j Corresponding slope k i k j The linear expression for the line segment is y = kx + b.

[0092] 2. Using the formula for distance from a point to a line Find the first distance d from the midpoint of one line segment to another line segment. i d j The slope k of the two line segments i k j Similar and the first distance d between them i d j If the slopes of two line segments are similar, they are considered close and belong to the same category; otherwise, they are classified as two different categories. Specifically, the difference in slopes between the two line segments can be compared to a slope threshold to determine if their slopes are similar. If the difference in slopes is less than the slope threshold, the slopes of the two line segments are considered similar. Alternatively, the average first distance between the two line segments can be compared to a distance threshold to determine if their distances are similar. If the average first distance is less than the distance threshold, the distances of the two line segments are considered similar.

[0093] 3. Repeat the above steps until all line segments have a category.

[0094] Through the above steps, the slope and distance of line segments can be considered, and line segments with similar slopes and distances can be grouped into the same category. Thus, using this method, a coarse subset of line segments {(x_i)} corresponding to different parking space locations is obtained through clustering. 1 ,y 1),.......,(x j ,y j )} m,c m≥0, c≤N, where x j Let x be the x-coordinate of the j-th endpoint, and y be the y-coordinate of the j-th endpoint. j Let y be the y-axis coordinate of the j-th endpoint, m be the number of bus segments of the c-th type of line segment, and N be the total number of coarse classifications.

[0095] Understandably, by setting reasonable slope and distance thresholds, parking space lines with significant differences in slope and distance can be distinguished. It should be noted that a single parking space line segment in a parking space image does not represent the actual parking space line. Due to factors such as camera obstruction, if a parking space line is obscured by an object, the parking space line skeleton will appear as shown below. Figure 9 As shown in the middle parking space image, there are six parking space line segments for that parking space. Therefore, the parking space line segments in the parking space image include complete parking space line segments, parking space line segments that are segmented due to obstruction or other reasons, and parking space line segments at the parking space entrance (parking space entrance markers are usually two unconnected line segments used to indicate the entrance).

[0096] In practical applications, when an image contains multiple parking spaces, parking space entrance markers, or obstructions on parking space lines, the segmentation may be inaccurate due to the short initial distance between two line segments. For example, a parking space line segmented due to obstruction might be grouped into two parking space segments and classified as the same category, or two parking space line segments with the parking space entrance as an entrance marker might be classified as the same category. Figure 10 As shown in the parking space map, there are three parking spaces within the image area. By setting a reasonable threshold, the parking space segments with large differences in slope and distance can be distinguished into different categories. However, segments that are close together cannot be accurately distinguished. For example, parking space segments that are segmented due to occlusion are classified into the same category. Figure 10 The lowest parking space has a parking line that is obscured by an object, splitting into two segments. Parking line identification requires determining the endpoints of these segments as key points for the parking space. If the two segments, due to obstruction, belong to the same category, the endpoints cannot be identified, making it impossible to accurately determine the key points of the parking space. Figure 10 The parking spaces shown are categorized as follows: the bottommost parking space is classified as Category 1 (segmented due to obstruction), the two parking space segments at the left entrance are classified as Category 2, the upper parking space segments are classified as Category 3, and the right parking space segments are classified as Category 4. This classification does not achieve accurate categorization.

[0097] To address this, in order to classify each parking space line segment in the parking space image, the coarse segment set is further subdivided. The endpoints of each line segment in each coarse segment subset are sorted according to their endpoint coordinates to obtain an endpoint sequence. If there is no parking space line information at the intermediate point between adjacent endpoints in the endpoint sequence, the corresponding adjacent endpoints are divided into two different categories to obtain subdivided line segment subsets. Each subdivided line segment subset corresponds to one parking space line segment. The coarse segment subset is used for line fitting, and the subdivided line segment subset is used to determine the extreme endpoints.

[0098] It is understandable that the parking space lines in the parking space image specifically correspond to the parking space line segments of each parking space shown in the parking space image, including the case of complete boundary line segments of each parking space, the case of parking space line segments being divided into multiple parking space line segments due to obstruction, and the case of entrance mark line segments at the entrance of the parking space.

[0099] The presence of parking space information at intermediate interval points can be determined by checking if the corresponding binary image pixel value is zero. If the pixel value is zero, it indicates that the point is not on a parking space line and is considered blank—the empty area between two parking spaces. To improve classification accuracy, after determining the intermediate interval point, a predetermined number of points around it are traversed, and it is determined whether the area centered on the intermediate interval point is entirely zero. If so, the intermediate interval point is determined not to be on a parking space line, meaning no parking space information exists. Specifically, for each category of coarsely segmented line segments, the endpoint set {(x 1 ,y 1 ),.......,(x j ,y j )} m,c Sort the sequence according to m≥0 and c≤N. Calculate the intermediate gap point between adjacent endpoints in the sequence. Check if the pixel corresponding to the gap point in the binary image is zero. If it is zero, it means that the intermediate gap point is not a parking space pixel (such as the gap between adjacent parking spaces, the obscured part of the parking space line, or the parking space entrance). Then, classify the two adjacent endpoints corresponding to the intermediate gap point into two categories on the endpoint sequence. Finally, the subdivided line segment subset is obtained. c * To further subdivide the categories, M represents the total number of subcategories, where M > N.

[0100] The subdivided line segment subset is the set of line segments for each parking space line segment in the parking space image. For example... Figure 11 As shown, the line segments of each parking space are grouped into a separate category, providing a set of line segments for later determination of the relative positions of parking spaces, such as... Figure 11The labels show the endpoints of the line segments in each category. The coarsely divided subset of line segments is used for line fitting, meaning the direct fitting is obtained based on the coarsely divided subset. The finely divided subset of line segments is used to determine the endpoints of the extreme values.

[0101] Step 210: Perform line fitting based on the endpoint coordinates of each line segment in the line segment subset to obtain the fitted line corresponding to each line segment subset.

[0102] Specifically, for the set of endpoints of each line segment in the same coarse subset, {(x 1 ,y 1 ),.......,(x j ,y j )} m,c For all m ≥ 0 and c ≤ N, perform linear least squares fitting to obtain the linear equation A of the c-th type of parking space line. c x c +B c y c +C c =0, A c B c C c The coefficients of the equations ultimately yield N linear equations {A}. c x c +B c y c +C c =0} c If c ≤ N, the fitted line is as follows: Figure 12 As shown. For the deformation that occurs when looking around a parking space for large vehicles, a straight line fitting method is used to shield the noise points caused by deformation in the set of endpoints of the line segments, ensuring that most points are concentrated around the fitted straight line, thus reducing the positioning error caused by deformation.

[0103] Step 212: Determine the intersection points of the fitted lines.

[0104] Specifically, {A c x c +B c y c +C c =0} c Given N linear equations with c ≤ N, perform pairwise intersection operations on each equation to obtain the set of corresponding intersection points {(x... 1 ,y 1 ),.......,(x s ,y s )} L , L>0, where L is the total number of intersections.

[0105] Step 214: Determine the key points of each parking space based on the intersection of the extreme endpoints of various line segment subsets and the fitted straight line. The extreme endpoints include the maximum endpoint and / or the minimum endpoint.

[0106] The goal of parking space detection is to extract key points of the parking space. These key points are used to determine the relative position of the parking space and the vehicle, providing guidance for vehicle control during parking. Key points can be used for reversing guidance of ordinary vehicles and reversing control of autonomous vehicles. Typically, parking space key points include the boundary vertices of the parking space (i.e., the intersection of the four parking space lines), the location of the parking space entrance, and the location of any obstructed parking space lines. The location of obstructed parking space lines is the intersection of the obstruction and the parking space line. The location of the parking space entrance and the location of any obstructed parking space lines can be determined by identifying the maximum and minimum endpoints of each segment in a subdivided subset of line segments. These maximum and minimum endpoints are specifically the largest and / or smallest endpoints in each subdivided subset of line segments. The largest and / or smallest endpoints can be determined by coordinates, referring to the endpoints with the largest and / or smallest coordinate positions in each subdivided subset of line segments.

[0107] The intersection points of the fitted lines are determined based on the coarsely divided subset of line segments, and these intersection points can represent the intersection points of each parking space. However, the coarsely divided subset of line segments may contain errors, so it is necessary to further combine the extreme endpoints of the finer subset of line segments to determine the parking space corresponding to the intersection point, that is, to assign the intersection point to each parking space.

[0108] Specifically, the key points of each parking space are determined based on the extreme endpoints of various line segment subsets and the intersection points of the fitted lines, including: obtaining the extreme endpoint pairs of each subdivided line segment subset, the extreme endpoint pairs including the maximum endpoint and the minimum endpoint; determining the intersection points of each parking space and the extreme endpoints within the adjacent intersection range of each parking space based on the coordinates of the intersection points of the fitted lines and the extreme endpoint pairs of each subdivided line segment subset, obtaining candidate endpoints, the intersection points representing the boundary vertices of the parking spaces; determining the candidate endpoints far from the intersection points as target endpoints based on the distance between each candidate endpoint and the intersection points, the target endpoints representing the location points of the parking space entrance or the location points of the obscured parking space lines; and obtaining the key points of the parking spaces based on the intersection points and the target endpoints.

[0109] Specifically, for each subdivided subset of line segments, the maximum and minimum endpoints of the line segments within each subset are obtained, resulting in pairs of maximum and minimum endpoints P1 and P2. These pairs represent the maximum and minimum endpoints of the subdivided subset. For example, if there are M subdivided subsets of line segments, there are M pairs of maximum and minimum endpoints, each corresponding to a subdivided subset. A subdivided subset of line segments includes multiple line segments, each with two endpoints. The maximum endpoint is the endpoint with the largest coordinate value in the subdivided subset, and the minimum endpoint is the endpoint with the smallest coordinate value in the subdivided subset.

[0110] Specifically, based on the intersection points of the fitted straight lines and the coordinates of the extreme endpoint pairs of each subdivided segment subset, the intersection points of each parking space and the extreme endpoints within the adjacent intersection point range of each parking space are determined to obtain candidate endpoints. This includes: sorting the intersection points of the fitted straight lines according to their horizontal or vertical coordinates, grouping intersection points belonging to the same horizontal or vertical coordinate into the same intersection point set; finding the closest candidate intersection point pair within a set of intersection points, and determining whether an extreme endpoint pair exists within the coordinate range of the candidate intersection point pair, or whether an extreme endpoint pair does not exist but the coordinate range of the candidate intersection point pair is similar to the coordinates of the extreme endpoint pair. If the ranges intersect, the candidate intersection point pairs are determined as the first intersection point of the parking space and the second intersection point adjacent to the first intersection point. Candidate endpoints are obtained within the coordinate range between the first and second intersection points. These candidate endpoints are either the maximum / minimum endpoint pairs existing within the coordinate range between the first and second intersection points, or the maximum / minimum endpoints within the coordinate range between the first and second intersection points that intersect with the coordinate range between them. For the first intersection point, it is determined whether there are maximum / minimum endpoint pairs within the coordinate range between the first intersection point and the intersection points in the remaining intersection point sets. If such a point exists, the corresponding intersection point is designated as the third intersection point adjacent to the first intersection point. Candidate endpoints within the coordinate range between the first and third intersection points are obtained; these candidate endpoints are pairs of extreme values ​​within the coordinate range between the first and third intersection points. For the second intersection point, it is determined whether pairs of extreme values ​​exist within the coordinate range between the second intersection point and the remaining intersection point set. If such pairs exist, the corresponding intersection point is designated as the fourth intersection point adjacent to the second intersection point. Candidate endpoints within the coordinate range between the second and fourth intersection points are obtained; these candidate endpoints are pairs of extreme values ​​within the coordinate range between the second and fourth intersection points. Endpoint pairs; obtain candidate endpoints within the coordinate range between the third and fourth intersection points. The candidate endpoints are either the extreme endpoint pairs existing within the coordinate range between the third and fourth intersection points, or the extreme endpoints within the coordinate range between the third and fourth intersection points among the extreme endpoint pairs that intersect with the coordinate range between the third and fourth intersection points. The third and fourth intersection points are adjacent. Based on the first, second, third, and fourth intersection points and the candidate endpoints within the range of each adjacent intersection point, determine the intersection point of the parking space and the candidate endpoints within the range of each parking space's adjacent intersection points.

[0111] Specifically, taking advantage of the characteristic that the intersection points of the fitted straight lines of parking space lines have similar (theoretically the same) x-coordinate or y-coordinate values ​​in the same direction, the intersection points can be sorted according to their coordinates. The sorting method can be by x-coordinate or by y-coordinate, grouping intersection points belonging to the same x-coordinate or y-coordinate into the same set of intersection points. Taking sorting by x-coordinate as an example, sorting all intersection points by x-coordinate results in: Figure 13 As shown, intersection points M1-M6 belong to the first intersection point set, and intersection points M9-M... 20 Belongs to the second intersection set. Based on the horizontal coordinate sorting, find any nearest intersection set in the first intersection set. Take two intersection points that are consecutive and contain a pair of extreme endpoints as candidate intersection pairs M1 and M2. If there is an extreme endpoint pair within the coordinate range between candidate intersection pairs M1 and M2, or if there is no extreme endpoint pair but the coordinate range between the candidate intersection pairs intersects with the coordinate range of the extreme endpoint pair, then the candidate intersection pairs are respectively taken as the first intersection point M1 and the second intersection point M2 adjacent to the first intersection point M1. Obtain the corresponding candidate endpoints within the coordinate range between the first intersection point and the second intersection point M1 and M2. The candidate endpoints are the extreme endpoints within the coordinate range between M1 and M2 that exist within the coordinate range between M1 and M2, or among the extreme endpoint pairs that intersect with the coordinate range of M1 and M2. For the extreme endpoint pairs that exist within the coordinate range between M1 and M2, that is, the extreme endpoint pairs (maximum endpoint and minimum endpoint) of a subdivided segment subset within the coordinate range between M1 and M2, such as Figure 14 As shown, it can effectively extract occluded locations as candidate endpoints for subsequent extraction of key points for parking spaces.

[0112] For the pair of extreme endpoints that intersect with the coordinate range between M1 and M2, where the extreme endpoint lies within the range of M1 and M2, that is, where the coordinate range between M1 and M2 intersects with the coordinate range of the extreme endpoint pair, one of the extreme endpoints of the subdivided segment subset lies within the coordinate range between M1 and M2, such as... Figure 15 As shown, if one of the extreme endpoints of the subdivided line segment subset A is within the coordinate range between M1 and M2, and the coordinate range between the extreme endpoints of the subdivided line segment subset A intersects with the coordinate range between M1 and M2, and one of the extreme endpoints M0 is within the coordinate range between M1 and M2, then M0 is selected as a candidate endpoint. Figure 15 The scenario shown is where parking spaces are connected, and there is a parking space entrance between M1 and M2. This method can effectively extract the location points of the parking space entrances as candidate endpoints, so as to extract the key points of the parking spaces in the future.

[0113] It should be noted that the intersection points are determined based on the fitted line, which is obtained by fitting a line to the endpoint coordinates of each line segment in the coarse segment subset. Therefore, the intersection points may also be the extreme endpoints, meaning that the candidate endpoints found may include the intersection points. For the first intersection point M1, find the intersection points between M1 and the remaining intersection point set (e.g., ...). Figure 13 In the second set of intersection points shown, find the third intersection point M9 whose coordinate range between intersection points contains pairs of extreme endpoints. Obtain candidate endpoints (intersection points coincide with the extreme endpoints of the subdivided segment subset; candidate endpoints are the intersection points themselves) within the coordinate range between intersection points M1 and M9. For the second intersection point M2, find the fourth intersection point M2 whose coordinate range between intersection points in the remaining set of intersection points (the second set of intersection points) contains pairs of extreme endpoints. 12 Obtain the intersection point M2 M 12 Candidate endpoints within the coordinate range, at this point, can the intersection points M1 M2 M9 M 12 It is assigned to one parking space. Then, find the third and fourth intersections, M9 and M. 12 Candidate endpoints contained within the coordinate range, with candidate endpoint M9M 12 The extreme endpoints existing within the coordinate range or with M9 M 12 The coordinate ranges between the intersection points have a set of extreme endpoints, in M9 M 12 The extreme endpoints within the coordinate range between the intersection points, such as Figure 13 M9 M shown 12 Candidate endpoints between intersections include the intersection itself and M. 10 M 11 .

[0114] After determining the intersection points of each parking space and the candidate endpoints of the parking spaces, the intersection points are the boundary vertices of the parking spaces. The target endpoints can be further determined using the candidate endpoints; these target endpoints are the location of the parking space entrance or the location of the obscured parking space line. Specifically, in some cases, the intersection point may also be the extreme endpoint, meaning that the determined candidate endpoints may include the intersection point. Therefore, the endpoints remaining after removing the intersection points are the target endpoints, corresponding to the location of the parking space entrance and the location of the obscured parking space line. Specifically, the candidate endpoints within the intersection point range are compared with the intersection point P. i P j Perform distance calculations to find the non-intersecting point P. i P j The target endpoints are those closest to the intersection (excluding the intersection itself). That is, candidate endpoints farthest from the intersection are considered target endpoints (endpoints closest to the intersection are considered the intersection itself, excluding the intersection). Figure 13 The determined target endpoint is M. 10 M 11 Ultimately, M1 M2 M9 M 12 With the identified target endpoint M 10M 11 Collectively referred to as key points of the same parking space, including M1, M2, M9, and M 12 The boundary of the parking space is defined by a point, with the target endpoint being the entrance inside the parking space. In other embodiments, the target endpoint may also include obstructed locations on the parking space line. Figure 16 As shown, the key points found include intersections and target endpoints, with the target endpoint being the location of the entrance inside the parking space. For example... Figure 17 As shown, the key points found include intersections and target endpoints. The targets include the location of the entrance inside the parking space and the location where there is obstruction.

[0115] The parking space key points obtained in this application are independent of the vehicle coordinates, and the parking status of the vehicle can be determined by the vehicle coordinates and the coordinates of the parking space key points.

[0116] The aforementioned parking space detection method extracts line segments from the parking space lines and classifies them, representing each parking space line as a set of line segments. It then reconstructs the parking space line by fitting a straight line, which can shield noise points caused by deformation in the set of line segment endpoints. This ensures that most points are concentrated around the fitted straight line, reducing positioning errors caused by deformation. Based on this, the key points of the parking space are determined according to the intersection of the extreme endpoints of each type of line segment subset and the fitted straight line, thus improving the detection effect of parking space positioning points.

[0117] The method of this application uses cumulative probability Hough transform to obtain the set of line segments of parking space lines, and then uses clustering method to divide the set of line segments of parking space lines into different categories of line segments and endpoints. Then, the equation of parking space lines is obtained by straight line fitting, and the intersection points are obtained from the straight line equation. Finally, the distance between the intersection points and the endpoints is determined by combining the intersection points and the endpoints to obtain a set of positioning key points containing the intersection points and endpoints. The method improves the real-time performance and stability of parking space key point detection.

[0118] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0119] In one embodiment, such as Figure 18 As shown, a parking space detection device is provided, comprising:

[0120] Image acquisition module 1502 is used to acquire the parking space line pixel image of the parking space image;

[0121] Image processing module 1504 is used to process the pixel image of parking space lines and extract the parking space lines;

[0122] The line segment extraction module 1506 is used to extract the set of line segments of the parking space line and obtain the coordinates of the two ends of each line segment.

[0123] The classification module 1508 is used to classify each line segment according to the coordinates of the two endpoints of each line segment in the line segment set, based on the slope and the first distance, to obtain a subset of line segments included in each category; wherein, the first distance is the distance from the midpoint of one line segment to the other line segment in any two line segments;

[0124] The line fitting module 1510 is used to perform line fitting based on the endpoint coordinates of each line segment in the line segment subset, and obtain the fitted line corresponding to each line segment subset.

[0125] The intersection point determination module 1512 is used to determine the intersection points of each fitted line;

[0126] The key point acquisition module 1514 is used to determine the key points of each parking space based on the intersection of the maximum and minimum endpoints of various line segment subsets and the fitted straight line. The maximum and minimum endpoints include the large endpoint and / or the minimum endpoint.

[0127] In another embodiment, the image acquisition module includes:

[0128] The acquisition module is used to acquire images of parking spaces.

[0129] The extraction module is used to input the parking space image into the trained generative adversarial network (GAN), and generate the parking space line pixel image of the parking space image through the generator of the GAN; wherein the GAN is trained based on the parking space image and the parking space line pixel image of the labeled parking space image.

[0130] In another embodiment, the acquisition module is used to acquire parking space area images captured by multiple cameras; the parking space area images are matched and stitched together to obtain a panoramic parking space image.

[0131] In another embodiment, the image processing module is used to binarize the pixel image of the parking space line to obtain the line region; after performing morphological processing on the line region, the lines are extracted and the lines are skeletonized to obtain the parking space line.

[0132] In another embodiment, the classification module is used to obtain the slope of each line segment and the first distance from the midpoint of the line segment to another line segment based on the coordinates of the endpoints of each line segment in the line segment set, and classify the line segments in any two line segments whose slope difference and the average of the first distance are both less than the corresponding threshold into one category, thereby obtaining a coarsely divided subset of line segments corresponding to each category.

[0133] In another embodiment, the classification module is further configured to sort the endpoints of each line segment in each coarsely divided subset of line segments according to the endpoint coordinates to obtain an endpoint sequence. If there is no parking space line information in the intermediate interval point between adjacent endpoints in the endpoint sequence, the corresponding adjacent endpoints are divided into two different categories to obtain a subdivided subset of line segments. Each subdivided subset of line segments corresponds to a parking space line segment in the parking space image. The coarsely divided subset of line segments is used for line fitting, and the subdivided subset of line segments is used to determine the extreme endpoints.

[0134] In another embodiment, the key point acquisition module is used to acquire the extreme endpoint pairs of each of the subdivided line segment subsets, the extreme endpoint pairs including the maximum endpoint and the minimum endpoint; based on the intersection of the fitted straight lines and the coordinates of the extreme endpoint pairs of each subdivided line segment subset, determine the intersection of each parking space and the extreme endpoints within the range of adjacent intersections of each parking space to obtain candidate endpoints, the intersections representing the boundary vertices of the parking spaces; based on the distance between the candidate endpoints and the intersections, determine the candidate endpoints far from the intersections as target endpoints, the target endpoints representing the location points of the parking space entrance or the location points of the obscured parking space lines; based on the intersections and target endpoints, obtain the key points of the parking spaces.

[0135] The aforementioned parking space detection device extracts line segments from parking space lines and classifies them, representing each parking space line as a set of line segments. It then reconstructs the parking space line using straight line fitting, effectively shielding noise points caused by deformation in the set of line segment endpoints. This ensures that most points are concentrated around the fitted straight line, reducing positioning errors caused by deformation. Based on this, the intersection points of the extreme endpoints of each subset of line segments and the fitted straight line determine the key points of the parking space, improving the detection effect of positioning points. Specific limitations of the parking space detection device can be found in the limitations of the parking space detection method described above, and will not be repeated here. Each module in the aforementioned parking space detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, allowing the processor to call and execute the corresponding operations of each module.

[0136] In one embodiment, a computer device is provided, which may be an edge computing server or a vehicle controller, and its internal structure diagram may be as follows: Figure 19 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a parking space detection method.

[0137] Those skilled in the art will understand that Figure 19 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0138] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the methods described in the above embodiments.

[0139] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the methods described in the above embodiments.

[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0141] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A parking space detection method, the method comprising: Obtain the pixel image of the parking space line in the parking space image; The parking space line pixel image is processed to extract the parking space lines; Extract the set of line segments of the parking space lines and obtain the coordinates of the two endpoints of each line segment; Based on the coordinates of the endpoints of each line segment in the line segment set, the slope of each line segment and the first distance from the midpoint of one line segment to another line segment are obtained. Line segments in any two line segments whose slope difference and the average of the first distance are both less than the corresponding threshold are classified into one category, and a coarsely divided subset of line segments is obtained for each category; wherein, the first distance is the distance from the midpoint of one line segment to the other line segment in any two line segments. The method further includes: sorting the endpoints of each line segment in each coarsely divided subset of line segments according to their endpoint coordinates to obtain an endpoint sequence; if there is no parking space line information in the intermediate interval point between adjacent endpoints in the endpoint sequence, then dividing the corresponding adjacent endpoints into two different categories to obtain a subdivided subset of line segments, each subdivided subset of line segments corresponding to a parking space line segment in the parking space image; wherein, the coarsely divided subset of line segments is used for line fitting, and the subdivided subset of line segments is used to determine the extreme endpoints. Based on the endpoint coordinates of each line segment in the line segment subset, a straight line is fitted to obtain the fitted straight line corresponding to each line segment subset; Determine the intersection points of all the fitted lines; Based on the intersection of the extreme endpoints of various line segment subsets and the fitted straight line, the key points of each parking space are determined, wherein the extreme endpoints include the maximum endpoint and / or the minimum endpoint.

2. The method according to claim 1, characterized in that, Obtain the pixel image of the parking space lines from the parking space image, including: Images of parking spaces were acquired; The parking space image is input into a trained generative adversarial network (GAN), and the generator of the GAN generates a pixel image of the parking space lines in the parking space image; wherein the GAN is trained based on the parking space image and the pixel image of the parking space lines in the labeled parking space image.

3. The method according to claim 2, characterized in that, The acquired parking space images include: Acquire images of parking space areas captured by multiple cameras; The images of the parking space areas are matched and stitched together to obtain a panoramic parking space image.

4. The method according to claim 1, characterized in that, The step of processing the parking space line pixel image to extract the parking space lines includes: The parking space line pixel image is binarized to obtain the line region; After performing morphological processing on the line region, the lines are extracted and then skeletonized to obtain the parking space lines.

5. The method according to claim 1, characterized in that, Based on the intersection of the extreme endpoints of various line segment subsets and the fitted straight line, the key points of each parking space are determined, including: Obtain the extreme value endpoint pairs of each of the subdivided line segment subsets, wherein the extreme value endpoint pairs include the maximum endpoint and the minimum endpoint; Based on the intersection of the fitted straight lines and the coordinates of the extreme endpoint pairs of each subdivided segment subset, the intersection of each parking space and the extreme endpoints within the range of adjacent intersections of each parking space are determined to obtain candidate endpoints, where the intersection points represent the boundary vertices of the parking spaces. Based on the distance between the candidate endpoint and the intersection point, the candidate endpoint that is far away from the intersection point is determined as the target endpoint, and the target endpoint represents the location point of the parking space entrance or the location point of the obscured parking space line; Based on the intersection point and the target endpoint, the key points of the parking space are obtained.

6. A parking space detection device, characterized in that, The device includes: The image acquisition module is used to acquire the pixel image of the parking space line in the parking space image; The image processing module is used to process the pixel image of the parking space line and extract the parking space line. The line segment extraction module is used to extract the set of line segments of the parking space line and obtain the coordinates of the two endpoints of each line segment. The classification module is used to obtain the slope of each line segment and the first distance from the midpoint of one line segment to another line segment based on the coordinates of the endpoints of each line segment in the line segment set. Line segments whose slope difference and the average of the first distance are both less than the corresponding threshold are classified into one category, and a coarse subset of line segments corresponding to each category is obtained; wherein, the first distance is the distance from the midpoint of one line segment to the other line segment in any two line segments. The classification module is further used to sort the endpoints of each line segment in the coarsely divided line segment subset by endpoint coordinates to obtain an endpoint sequence. If there is no parking space line information in the intermediate interval point between adjacent endpoints in the endpoint sequence, the corresponding adjacent endpoints are divided into two different categories to obtain a subdivided line segment subset. Each subdivided line segment subset corresponds to a parking space line segment in the parking space image. The coarsely divided line segment subset is used for line fitting, and the subdivided line segment subset is used to determine the extreme endpoints. The line fitting module is used to perform line fitting based on the endpoint coordinates of each line segment in the line segment subset to obtain the fitted line corresponding to each line segment subset. The intersection point determination module is used to determine the intersection points of the fitted lines. The key point acquisition module is used to determine the key points of each parking space based on the intersection of the extreme endpoints of various line segment subsets and the fitted straight line, wherein the extreme endpoints include the maximum endpoint and / or the minimum endpoint.

7. The apparatus according to claim 6, characterized in that, The image acquisition module is also used to acquire parking space images; input the parking space images into a trained generative adversarial network, and generate parking space line pixel images of the parking space images through the generator of the generative adversarial network; wherein the generative adversarial network is trained based on the parking space images and the labeled parking space line pixel images of the parking space images.

8. The apparatus according to claim 7, characterized in that, The image acquisition module is also used to acquire parking space area images captured by multiple cameras; and to match and stitch the parking space area images to obtain a panoramic parking space image.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Parking space identification method based on point and line features of panoramic image

    CN104933409A

  • Parking lot detection method and system, storage medium, and electronic device

    CN107491738A

  • Lane line detection method based on semi-supervised generative adversarial network

    CN111382686A