A parking space boundary detection method and device, electronic equipment and storage medium

CN116597414BActive Publication Date: 2026-08-11XINGHE ZHILIAN AUTOMOBILE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-04
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0005](1)精度问题:现有的自动泊车技术在车位检测和定位方面,存在精度不高的问题,特别是在夜晚、恶劣天气和复杂环境下,检测和定位的精度更是受到很大的影响;且为了保证精度势必要应用安装大量的传感器,成本较高

Benefits of technology

[0051]This invention acquires images of vehicle parking positions and binarizes them using an adaptive thresholding algorithm. Based on a preset edge strength threshold, the Sobel operator extracts parking space edge information from the preprocessed parking position image to obtain a first parking space outline. Then, geometric features of the outline are calculated for fitting, noise reduction, and other outline optimization processes. Template matching for the corresponding parking space shape is performed. Finally, the geometric features of the minimum bounding box of the parking space outline are calculated to determine the aspect ratio of the parking space and whether it is horizontally positioned, thus determining the validity of the parking space. This invention effectively improves the accuracy of parking space detection and positioning, and is applicable to different types and shapes of parking spaces, including vertical and horizontal parking lots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116597414B_ABST
    Figure CN116597414B_ABST
Patent Text Reader

Abstract

This invention acquires images of vehicle parking positions and binarizes them using an adaptive thresholding algorithm. Based on a preset edge strength threshold, the Sobel operator extracts parking space edge information from the preprocessed parking position image to obtain a first parking space outline. Then, geometric features of the outline are calculated for fitting, noise reduction, and other outline optimization processes. Template matching for the corresponding parking space shape is performed. Finally, the geometric features of the minimum bounding box of the parking space outline are calculated to determine the aspect ratio of the parking space and whether it is horizontally positioned, thus determining the validity of the parking space. This invention effectively improves the accuracy of parking space detection and positioning, and is applicable to different types and shapes of parking spaces, including vertical and horizontal parking lots.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to a parking space boundary detection method, device, electronic device, and storage medium. Background Technology

[0002] In today's increasingly congested urban traffic, finding a parking space has become a major headache for drivers. To alleviate this problem, many automakers have introduced automatic parking technology into their vehicles, enabling them to park without human intervention.

[0003] Currently, automatic parking technology is mainly divided into two types: sensor-based automatic parking and vision-based automatic parking. Sensor-based automatic parking relies on sensors such as radar, ultrasonic waves, or cameras around the vehicle to detect parking space boundaries; while vision-based automatic parking can achieve parking space boundary detection through visual sensors such as onboard cameras.

[0004] However, both of the above-mentioned existing technologies have the following drawbacks:

[0005] (1) Accuracy problem: The existing automatic parking technology has low accuracy in parking space detection and positioning, especially at night, in bad weather and in complex environments, the accuracy of detection and positioning is greatly affected; and in order to ensure accuracy, a large number of sensors must be installed, which is costly.

[0006] (2) Applicability issues: Existing automatic parking technologies are often only applicable to specific types of parking spaces, such as only applicable to perpendicular parking lots or only applicable to horizontal parking lots. Summary of the Invention

[0007] This invention provides a parking space boundary detection method, device, electronic device, and storage medium. By extracting the contour features of the parking space line and determining the type of parking space, the validity of the parking space is determined, ensuring detection accuracy and stability while reducing application costs.

[0008] In a first aspect, the present invention provides a parking space boundary detection method, comprising the following steps:

[0009] Acquire images of the vehicle's parking location;

[0010] Based on a preset edge strength threshold, the Sobel operator is used to extract parking space edge information from the parking position image to obtain the first parking space outline.

[0011] Based on the geometric features of the first parking space outline, the validity of the parking space corresponding to the first parking space outline is determined;

[0012] The validity judgment result is confirmed as the parking space boundary detection result.

[0013] Furthermore, after obtaining the outline of the first parking space, the following steps are also included:

[0014] The first parking space contour is subjected to morphological dilation and the straight line features of the first parking space contour are obtained by Hough transform.

[0015] Based on the straight line features, calculate the geometric features of the first parking space outline and confirm the shape classification of the parking space;

[0016] Based on the shape of the parking space, the outline of the first parking space is matched with a preset parking space template of the same shape, and the outline of the second parking space is obtained through an outline optimization algorithm.

[0017] The validity of the parking space corresponding to the second parking space contour is determined, and the validity determination result corresponding to the second parking space contour is confirmed as the parking space boundary detection result.

[0018] Furthermore, the validity of the parking space corresponding to the first parking space outline is determined, specifically including the following steps:

[0019] Calculate the minimum bounding box of the first parking space outline, and obtain the length, width and parking space angle of the bounding box;

[0020] Based on the length, width and angle of the enclosing frame, the aspect ratio of the parking space is obtained and it is determined whether the parking space is placed horizontally.

[0021] A parking space is considered valid if its length-to-width ratio is within a preset threshold range and it is horizontally positioned.

[0022] Furthermore, after acquiring the parking position image of the vehicle, the following method steps are also included:

[0023] The parking location image is processed into grayscale to obtain grayscale image I;

[0024] The grayscale image I is subjected to Gaussian filtering and then binarized using an adaptive thresholding algorithm to obtain the preprocessed parking position image. The adaptive thresholding formula is as follows:

[0025]

[0026] in, For pixels Adaptive threshold, For the pixel point The average value of surrounding pixels, For the pixel point The standard deviation of surrounding pixels, This is the adjustment coefficient.

[0027] Further, the outline of the first parking space is obtained, specifically including the following steps:

[0028] The gradient of the grayscale image I in the x-direction is calculated using the Sobel operator. gradient in the y direction And calculate each of the pixels. The gradient strength and gradient direction;

[0029] For each pixel Non-maximum suppression processing is performed, wherein the non-maximum suppression processing is performed by comparing the pixel points. The gradient intensity of two adjacent pixels along its gradient direction, if the pixel If the gradient strength is the largest, then the pixel is retained. If the gradient strength is set to 0, then the gradient strength is set to 0.

[0030] The pixels after nonmaximum suppression processing are subjected to dual thresholding. The pixels are classified and marked if their gradient intensity is higher than a preset high threshold. The pixels at the edge of the parking space are those whose gradient intensity is lower than the preset high threshold but higher than the preset low threshold. The adjacent parking space edge points are merged;

[0031] Obtain all the edge points of the parking spaces to generate the outline of the first parking space.

[0032] Secondly, the present invention provides a parking space boundary detection device, comprising:

[0033] The image acquisition module is used to acquire images of the vehicle's parking position.

[0034] The first parking space contour acquisition module is used to extract parking space edge information from the parking position image using the Sobel operator based on a preset edge strength threshold, and to obtain the first parking space contour.

[0035] The validity judgment module is used to judge the validity of the parking space corresponding to the first parking space outline based on the geometric features of the first parking space outline.

[0036] The detection result confirmation module confirms that the validity judgment result is the parking space boundary detection result.

[0037] Furthermore, the first parking space outline acquisition module also includes:

[0038] The straight line feature acquisition unit is used to perform morphological dilation processing on the first parking space contour and obtain the straight line features of the first parking space contour through Hough transform.

[0039] A shape classification confirmation unit is used to calculate the geometric features of the first parking space outline based on the straight line features, and to confirm the shape classification of the parking space.

[0040] The second parking space outline acquisition unit is used to match the first parking space outline with a preset parking space template of the same shape according to the shape of the parking space, and obtain the second parking space outline through an outline optimization algorithm.

[0041] The second detection result confirmation unit is used to determine the validity of the parking space corresponding to the second parking space outline and confirm the validity determination result corresponding to the second parking space outline as the parking space boundary detection result.

[0042] Furthermore, the recognition result acquisition module also includes:

[0043] The bounding box information acquisition unit is used to calculate the minimum rectangular bounding box of the first parking space outline and obtain the length, width and parking space angle of the bounding box;

[0044] The parking space information acquisition unit is used to obtain the aspect ratio of the parking space and determine whether the parking space is placed horizontally based on the length, width and angle of the enclosing frame.

[0045] The parking space validity confirmation unit is used to confirm that the parking space whose length-to-width ratio is within a preset threshold range and which is horizontally placed is a valid parking space.

[0046] Thirdly, the present invention provides an electronic device, comprising:

[0047] At least one memory and at least one processor;

[0048] The memory is used to store one or more programs;

[0049] When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of a parking space boundary detection method as described in the first aspect.

[0050] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a parking space boundary detection method as described in the first aspect.

[0051] This invention acquires images of vehicle parking positions and binarizes them using an adaptive thresholding algorithm. Based on a preset edge strength threshold, the Sobel operator extracts parking space edge information from the preprocessed parking position image to obtain a first parking space outline. Then, geometric features of the outline are calculated for fitting, noise reduction, and other outline optimization processes. Template matching for the corresponding parking space shape is performed. Finally, the geometric features of the minimum bounding box of the parking space outline are calculated to determine the aspect ratio of the parking space and whether it is horizontally positioned, thus determining the validity of the parking space. This invention effectively improves the accuracy of parking space detection and positioning, and is applicable to different types and shapes of parking spaces, including vertical and horizontal parking lots.

[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Attached Figure Description

[0053] Figure 1 This is a flowchart illustrating the steps of a parking space boundary detection method provided in an exemplary embodiment.

[0054] Figure 2 This is a schematic diagram of a parking space boundary detection device provided in an exemplary embodiment;

[0055] Figure 3 This is a schematic diagram of an electronic device provided in one exemplary embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0057] It should be understood that the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.

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

[0059] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0060] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0061] like Figure 1 As shown in the figure, this application provides a parking space boundary detection method, which specifically includes the following method steps:

[0062] S201: Obtain the parking position image of the vehicle.

[0063] Parking location images are acquired by in-vehicle camera or video recording devices, such as dashcams. In other cases, they can be smart devices with camera or video recording capabilities, such as smartphones, smartwatches, and tablets. Parking location images are generally road images that include parking space line information.

[0064] In a preferred example, after acquiring the parking position image of the vehicle, the acquired image needs to be preprocessed, specifically including: performing grayscale processing on the parking position image to obtain a grayscale image I; and performing Gaussian filtering on the grayscale image I to remove noise and details from the image, making the edge detection results more stable and accurate. The Gaussian filtering formula used is:

[0065]

[0066] in, For Gaussian kernel, The standard deviation is used; then, the grayscale image I is binarized using an adaptive thresholding algorithm to obtain the preprocessed parking position image. The adaptive thresholding formula is:

[0067]

[0068] in, For pixels Adaptive threshold, For the pixel point The average value of surrounding pixels, For the pixel point The standard deviation of surrounding pixels, This is the adjustment coefficient.

[0069] S202: Based on a preset edge strength threshold, the parking space edge information is extracted from the parking position image using the Sobel operator to obtain the first parking space outline.

[0070] In a preferred embodiment, obtaining the outline of the first parking space specifically includes the following steps:

[0071] The gradient of the grayscale image I in the x-direction is calculated using the Sobel operator. gradient in the y direction And calculate each of the pixels. The gradient strength and gradient direction;

[0072] For each pixel Non-maximum suppression processing is performed, wherein the non-maximum suppression processing is performed by comparing the pixel points. The gradient intensity of two adjacent pixels along its gradient direction, if the pixel If the gradient strength is the largest, then the pixel is retained. If the gradient strength is set to 0, then the gradient strength is set to 0.

[0073] The pixels after nonmaximum suppression processing are subjected to dual thresholding. The pixels are classified and marked if their gradient intensity is higher than a preset high threshold. The pixels at the edge of the parking space are those whose gradient intensity is lower than the preset high threshold but higher than the preset low threshold. Merge the adjacent parking space edge points; obtain all parking space edge points to generate the first parking space outline.

[0074] In a preferred embodiment, after obtaining the first parking space outline, noise still exists in the pixels identified as edges. Therefore, the first parking space outline is filtered and matched through the following steps:

[0075] The first parking space contour is subjected to morphological dilation and the straight line features of the first parking space contour are obtained by Hough transform.

[0076] Based on the straight line features, calculate the geometric features of the first parking space outline and confirm the shape classification of the parking space;

[0077] Based on the shape of the parking space, the outline of the first parking space is matched with a preset parking space template of the same shape, and the outline of the second parking space is obtained through an outline optimization algorithm.

[0078] The validity of the parking space corresponding to the second parking space contour is determined, and the validity determination result corresponding to the second parking space contour is confirmed as the parking space boundary detection result.

[0079] Specifically, straight-line features include the edge lines of the parking space and the dividing lines inside the parking space, while geometric features include aspect ratio, area, and perimeter. Taking the calculation of the aspect ratio of a parking space as an example, unlike the traditional method of obtaining the aspect ratio by calculating the length and width of the parking space, this embodiment calculates the aspect ratio by calculating the perimeter and area of ​​the parking space, as shown in the following formula:

[0080]

[0081] in, This indicates the area of ​​the parking space. This represents the perimeter of the parking space. This calculation method remains robust even when the parking space shape is irregular or edge detection is inaccurate, providing a more accurate aspect ratio and improving the accuracy of contour matching. The parking spaces are categorized into rectangular, parallelogram, and intersecting shapes, each with its corresponding contour shape template.

[0082] In a preferred embodiment, a contour optimization algorithm is used to denoise the first parking space contour: the parking space contour is segmented into several small segments; curve fitting is then performed on each segment to obtain a smoother curve; simultaneously, the fitted curve is sampled to obtain a certain number of points; the sampled points are filtered to remove points that differ significantly from the average value; and then the filtered points are matched according to the parking space shape template to obtain the denoised parking space contour. Specifically, curve fitting can employ methods such as polynomial fitting, spline fitting, and B-spline fitting, and point filtering algorithms can employ methods such as mean filtering, median filtering, and Gaussian filtering.

[0083] S203: Based on the geometric features of the first parking space outline, determine the validity of the parking space corresponding to the first parking space outline.

[0084] In a preferred embodiment, the validity of parking spaces is determined by the following method:

[0085] Calculate the minimum bounding box of the first parking space outline, and obtain the length, width and parking space angle of the bounding box;

[0086] Based on the length, width and angle of the enclosing frame, the aspect ratio of the parking space is obtained and it is determined whether the parking space is placed horizontally.

[0087] A parking space is considered valid if its length-to-width ratio is within a preset threshold range and it is horizontally positioned.

[0088] The length and width of the smallest rectangular bounding box of the parking space outline are the length and width of the parking space; by calculating the center point of the smallest rectangular bounding box and the center point of the outline, the angle of the parking space can be calculated using the coordinate difference between the two points.

[0089] Specifically, the minimum bounding rectangle is a rectangle whose shape is characterized by one side being parallel to another side of the outline, while the remaining two sides are parallel to each other, and its area is the smallest among all the bounding rectangles of the parking space outline. When calculating the minimum bounding rectangle, the minimum bounding rectangle of the outline points can be used to speed up the calculation. The minimum bounding rectangle is a rectangle with one side parallel to the x-axis and the other side parallel to the y-axis, and this rectangle has the smallest area. Therefore, we can first calculate the minimum bounding rectangle, and then rotate within the minimum bounding rectangle to find the smallest minimum bounding rectangle.

[0090] In a specific example, by calculating the length, width, and angle of the smallest bounding rectangle, it can be determined whether the outline represents a valid parking space. First, the aspect ratio of the parking space needs to be determined. This ratio can be determined by the type of parking space, such as sedan, SUV, or van. For a valid parking space outline, its aspect ratio should be within a certain range, which can be achieved by setting upper and lower bounds. Second, it is necessary to determine whether the parking space is horizontally placed. If the angle of the parking space deviates too much from horizontal, the parking space should be considered unusable.

[0091] Specifically, the length-to-width ratio of a parking space can be expressed as:

[0092]

[0093] in, Indicates the length of the parking space. This indicates the width of the parking space. You can determine if a parking space is valid by setting the upper and lower bounds of the aspect ratio.

[0094] The angle of a parking space can be expressed as:

[0095] )

[0096] in, and These represent the x and y coordinates of the center point of the parking space outline, respectively. and These represent the x and y coordinates of the center point of the smallest rectangular bounding box, respectively. It is the arctangent function, which can be used to calculate the angle of a parking space by measuring the ratio of the coordinates of two points. If the angle deviates too much from the horizontal angle, the parking space should be considered unusable.

[0097] S204: Confirm that the validity judgment result is the parking space boundary detection result.

[0098] In a specific example, the output section needs to display parking space information to the user, typically using a graphical interface. This can be done by displaying the scene captured by a camera in real time, marking available and unavailable parking spaces. Different colors or shapes can be used to distinguish different parking space statuses; for example, available parking spaces are marked with green rectangles, unavailable spaces with red rectangles, and waiting vehicles with yellow rectangles.

[0099] This application embodiment acquires a parking position image of a vehicle and performs binarization processing on the image using an adaptive threshold algorithm. Based on a preset edge strength threshold, the Sobel operator is used to extract parking space edge information from the preprocessed parking position image to obtain a first parking space contour. Then, the geometric features of the parking space contour are calculated for contour optimization processing such as fitting and noise reduction, and template matching for the corresponding parking space shape is performed. Finally, the geometric features of the minimum rectangular bounding box of the parking space contour are calculated to determine the aspect ratio of the parking space and whether it is horizontally placed, thus determining the validity of the parking space. This application embodiment can effectively improve the accuracy of parking space detection and positioning, and is applicable to different types and shapes of parking spaces, including vertical and horizontal parking lots.

[0100] This application also provides a parking space boundary detection device 300, such as... Figure 2 As shown, it includes:

[0101] Image acquisition module 301 is used to acquire images of the vehicle's parking position;

[0102] The first parking space contour acquisition module 302 is used to extract parking space edge information from the parking position image using the Sobel operator according to a preset edge strength threshold, and to acquire the first parking space contour.

[0103] The validity judgment module 303 is used to judge the validity of the parking space corresponding to the first parking space outline based on the geometric features of the first parking space outline.

[0104] The detection result confirmation module 304 is used to confirm that the validity judgment result is the parking space boundary detection result.

[0105] In one exemplary example, the first parking space outline acquisition module 302 further includes:

[0106] The straight line feature acquisition unit is used to perform morphological dilation processing on the first parking space contour and obtain the straight line features of the first parking space contour through Hough transform.

[0107] A shape classification confirmation unit is used to calculate the geometric features of the first parking space outline based on the straight line features, and to confirm the shape classification of the parking space.

[0108] The second parking space outline acquisition unit is used to match the first parking space outline with a preset parking space template of the same shape according to the shape of the parking space, and obtain the second parking space outline through an outline optimization algorithm.

[0109] The second detection result confirmation unit is used to determine the validity of the parking space corresponding to the second parking space outline and confirm the validity determination result corresponding to the second parking space outline as the parking space boundary detection result.

[0110] In one exemplary example, the recognition result acquisition module 303 further includes:

[0111] The bounding box information acquisition unit is used to calculate the minimum rectangular bounding box of the first parking space outline and obtain the length, width and parking space angle of the bounding box;

[0112] The parking space information acquisition unit is used to obtain the aspect ratio of the parking space and determine whether the parking space is placed horizontally based on the length, width and angle of the enclosing frame.

[0113] The parking space validity confirmation unit is used to confirm that the parking space whose length-to-width ratio is within a preset threshold range and which is horizontally placed is a valid parking space.

[0114] It should be noted that the parking space boundary detection device and the parking space boundary detection method provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0115] like Figure 3 As shown, Figure 3 This is a structural block diagram of an electronic device according to an exemplary embodiment of this application.

[0116] The electronic device includes a processor 910 and a memory 920. The main control chip may contain one or more processors 910. Figure 3 Taking a processor 910 as an example, the main control chip can contain one or more memory modules 920. Figure 3 Take a memory chip 920 as an example.

[0117] The memory 920, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the parking space boundary detection method program described in any embodiment of this application, and the corresponding program instructions / modules for the parking space boundary detection method described in any embodiment of this application. The memory 920 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 920 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 920 may further include memory remotely located relative to the processor 910, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0118] The processor 910 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 920, thereby implementing a parking space boundary detection method described in any of the above embodiments.

[0119] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a parking space boundary detection method as described in any of the above embodiments.

[0120] This invention can take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0121] It should be understood that the embodiments of this application are not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from their scope. The scope of the embodiments of this application is limited only by the appended claims.

[0122] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed, but 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 several modifications and improvements without departing from the concept of the embodiments of this application, and these all fall within the protection scope of the embodiments of this application.

Claims

1. A parking space boundary detection method characterized by, The method includes the following steps: Acquire images of the vehicle's parking location; Based on a preset edge strength threshold, the Sobel operator is used to extract parking space edge information from the parking position image to obtain the first parking space outline. Based on the geometric features of the first parking space outline, the validity of the parking space corresponding to the first parking space outline is determined; The validity judgment result is confirmed as the parking space boundary detection result; The method further includes, after obtaining the outline of the first parking space: The first parking space contour is subjected to morphological dilation and the straight line features of the first parking space contour are obtained by Hough transform. Based on the straight line features, calculate the geometric features of the first parking space outline and confirm the shape classification of the parking space; Based on the shape of the parking space, the outline of the first parking space is matched with a parking space template of the corresponding preset shape, and the outline of the second parking space is obtained through an outline optimization algorithm. The validity of the parking space corresponding to the second parking space outline is determined, and the validity determination result corresponding to the second parking space outline is confirmed as the parking space boundary detection result. The step of matching the outline of the first parking space with a preset parking space template of a corresponding shape based on the shape of the parking space, and obtaining the outline of the second parking space through an outline optimization algorithm, includes: The outline of the first parking space is divided into several small segments; Perform curve fitting on each of the aforementioned segments to obtain the fitted curve; The fitted curve is sampled, and the sampled points are filtered. The filtered points are then matched with a pre-set parking space template of the corresponding shape to obtain the second parking space outline.

2. The method of claim 1, wherein, After obtaining the parking position image of the vehicle, the following method steps are also included: The parking location image is processed into grayscale to obtain grayscale image I; The grayscale image I is subjected to Gaussian filtering and then binarized using an adaptive thresholding algorithm to obtain the preprocessed parking position image. The adaptive thresholding formula is as follows: in, For pixels Adaptive threshold, For the pixel point The average value of surrounding pixels, For the pixel point The standard deviation of surrounding pixels, This is the adjustment coefficient.

3. The method of claim 2, wherein, Obtaining the outline of the first parking space involves the following steps: The gradient of the grayscale image I in the x-direction is calculated using the Sobel operator. gradient in the y-direction And calculate each of the pixels. The gradient strength and gradient direction; For each pixel Non-maximum suppression processing is performed, wherein the non-maximum suppression processing is performed by comparing the pixel points. The gradient intensity of two adjacent pixels along its gradient direction, if the pixel If the gradient strength is the largest, then the pixel is retained. If the gradient strength is set to 0, then the gradient strength is set to 0. The pixels after nonmaximum suppression processing are subjected to dual thresholding. The pixels are classified and marked if their gradient intensity is higher than a preset high threshold. The pixels at the edge of the parking space are those whose gradient intensity is lower than the preset high threshold but higher than the preset low threshold. The adjacent parking space edge points are merged; Obtain all the edge points of the parking spaces to generate the outline of the first parking space.

4. A parking space boundary detection device, characterized in that, include: The image acquisition module is used to acquire images of the vehicle's parking position. The first parking space contour acquisition module is used to extract parking space edge information from the parking position image using the Sobel operator based on a preset edge strength threshold, and to obtain the first parking space contour. The validity judgment module is used to judge the validity of the parking space corresponding to the first parking space outline based on the geometric features of the first parking space outline. The detection result confirmation module is used to confirm that the validity judgment result is the parking space boundary detection result; The first parking space outline acquisition module further includes: The straight line feature acquisition unit is used to perform morphological dilation processing on the first parking space contour and obtain the straight line features of the first parking space contour through Hough transform. A shape classification confirmation unit is used to calculate the geometric features of the first parking space outline based on the straight line features, and to confirm the shape classification of the parking space. The second parking space outline acquisition unit is used to match the first parking space outline with a preset parking space template of the corresponding shape according to the shape of the parking space, and obtain the second parking space outline through an outline optimization algorithm. The second detection result confirmation unit is used to make a validity judgment on the parking space corresponding to the second parking space outline, and confirm the validity judgment result corresponding to the second parking space outline as the parking space boundary detection result. The second parking space contour acquisition unit is specifically used for: The outline of the first parking space is divided into several small segments; Perform curve fitting on each of the aforementioned segments to obtain the fitted curve; The fitted curve is sampled, and the sampled points are filtered. The filtered points are then matched with a pre-set parking space template of the corresponding shape to obtain the second parking space outline.

5. An electronic device, characterized in that, include: At least one memory and at least one processor; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of a parking space boundary detection method as described in any one of claims 1 to 3.

6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of a parking space boundary detection method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • A target contour detection method in a linear array image

    CN109559324A

  • Vision-based right empty parking space and parking space line detection method in parking process

    CN110414355A

  • Visual detection method for robot to grab parts

    CN111126174A

  • Parking space detection method and device

    CN113705474A