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

By extracting corner point information and color information in the image and determining the parking space line area, the problem of low accuracy of parking space detection in the prior art is solved, and higher detection accuracy and efficiency are achieved.

CN118675150BActive Publication Date: 2025-05-13BYD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411061552.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2025-05-13
Estimated Expiration
2044-08-05

AI Technical Summary

Technical Problem

In the existing parking space detection technology, the uncertainty of pixel values ​​in different color areas in the grayscale map fluctuates greatly and is easily disturbed by background interference, resulting in a low detection accuracy.

Method used

By extracting the corner point information in the image to be detected, and determining the target parking line area based on the corner point information and the color information of the image in the preset color space, the background part is removed and the parking line area is highlighted.

Benefits of technology

It improves the accuracy of parking space inspection, reduces the amount of data, significantly improves the detection efficiency, and is suitable for various scenarios and parking space types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675150B_ABST
    Figure CN118675150B_ABST
Patent Text Reader

Abstract

The present application relates to a parking space detection method, device, computer equipment and storage medium, wherein the method comprises: extracting corner point information in an image to be detected; determining a target parking space line area in the image to be detected based on the corner point information and color information of the image to be detected in a preset color space; and determining parking space information based on the target parking space line area. The solution of the embodiment of the present application is adopted to improve the efficiency and accuracy of parking space detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a parking space detection method, device, computer equipment and storage medium. Background Art

[0002] With the intelligentization of automobile functions, smart parking functions are increasingly widely used in actual scenarios. Parking space detection technology is one of the key technologies to achieve smart parking.

[0003] In the related art, grayscale threshold segmentation is usually used to separate the background and parking space lines in the image, so as to identify parking space information. However, there are differences in the uncertainty fluctuations of the pixel values ​​corresponding to different color areas in the grayscale image, and the grayscale values ​​are easily disturbed by the background with a color similar to the parking space line, so the accuracy of parking space detection is low. Summary of the invention

[0004] The embodiments of the present application provide a parking space detection method, apparatus, computer equipment and storage medium, which improve the accuracy of parking space detection and at least partially solve the above-mentioned technical problems.

[0005] In order to achieve the above objective, according to a first aspect of the present application, a parking space detection method is provided, the method comprising:

[0006] Extract corner point information from the image to be detected;

[0007] Determine a target parking space line area in the image to be detected based on the corner point information and color information of the image to be detected in a preset color space;

[0008] Based on the target parking space line area, parking space information is determined.

[0009] According to a second aspect of the present application, a parking space detection device is provided, the device comprising:

[0010] An extraction module, used to extract corner point information in the image to be detected;

[0011] A determination module, configured to determine a target parking space line area in the image to be detected based on the corner point information and color information of the image to be detected in a preset color space;

[0012] The determination module is further configured to determine parking space information based on the target parking space line area.

[0013] According to a third aspect of the present application, a computer device is provided, including a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the parking space detection method as described in the first aspect.

[0014] According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the steps of the parking space detection method as described in the first aspect.

[0015] According to a fifth aspect of the present application, a computer program product is provided, comprising a computer program or instructions, which implement the steps of the parking space detection method as described in the first aspect when the computer program or instructions are executed by a processor.

[0016] The parking space detection method, device, computer equipment and storage medium of the embodiments of the present application can accurately remove the background part outside the parking space line area and more significantly highlight the parking space line area by extracting the corner point information in the image to be detected and determining the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space. Furthermore, the parking space information can be determined based on the target parking space line area, which can realize accurate filtering of non-parking space lines, thereby greatly improving the accuracy while reducing the amount of data.

[0017] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0019] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same figure numbers represent the same parts in the following description.

[0020] Figure 1 is a schematic diagram of an application scenario of a parking space detection method provided in some embodiments of the present application;

[0021] Figure 2 is a flow chart of a parking space detection method provided in some embodiments of the present application;

[0022] Figure 3 is a simplified schematic diagram of a parking space provided in some embodiments of the present application;

[0023] Figure 4 is a schematic diagram of the effect of converting an RGB image into an HSV image provided in some embodiments of the present application;

[0024] Figure 5is a schematic diagram of the effect of parking space line extraction provided in some embodiments of the present application;

[0025] Figure 6 is a schematic diagram of parking space lines provided in some embodiments of the present application;

[0026] Figure 7 is a schematic diagram of a detection frame of a corner point and an entry line provided in some embodiments of the present application;

[0027] Figure 8 is a module schematic diagram of a parking space detection system provided in some embodiments of the present application;

[0028] Fig. 9 is a schematic diagram of a parking space detection process provided in some other embodiments of the present application;

[0029] Fig.10 is a schematic diagram of a parking space preprocessing process provided in some embodiments of the present application;

[0030] Fig.11 is a schematic diagram of the structure of a parking space detection device provided in some embodiments of the present application;

[0031] Fig.12 It is a schematic diagram of the structure of a computer device provided in some embodiments of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0033] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0034] In actual scenes, the color of parking spaces can be white, and there are also a certain number of parking spaces that are blue and yellow. This leads to uncertain fluctuations in the pixel values ​​corresponding to different color areas in the grayscale image, and requires multiple times of computing time to extract all color components. The efficiency and accuracy of parking line detection are difficult to meet the requirements. The parking space detection method based on deep learning usually requires the collection of a large number of parking space images, and the parking space content includes complex factors such as weather, lighting, parking space line color, and obstacle occlusion. The difficulty and investment of collection are often large, and its accuracy is affected by the deviation of manual labeling of samples. However, the detection of parking space lines by detecting line segments can easily lead to low accuracy of parking space detection due to the complex actual environment and the interference of other line segments near the parking space lines (such as cement markings, etc.).

[0035] In view of this, the embodiments of the present application provide a parking space detection method, device, system, equipment and storage medium, which can accurately remove the background part other than the parking space line and extract the parking space information; and can accurately filter out the line segments that are not parking space lines, neatly filter out the target parking space lines, and output complete parking space information through parking space reasoning. The embodiments of the present application provide a parking space detection method that is highly adaptable and can be applied to the detection of various scenes and various types of parking spaces, and can accurately detect parking spaces of any color and angle.

[0036] See also Figure 1 The embodiments of the present application can be applied to Figure 1 The application scenario shown includes a terminal device 102 and a server 104. The terminal device 102 may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. The terminal device 102 and the server 104 may perform bidirectional communication via a network.

[0037] Exemplarily, the terminal device 102 obtains an image captured by a camera device of the vehicle, and obtains an image to be detected by processing. The terminal device 102 can extract corner point information in the image to be detected, and determine the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space, and then determine the parking space information based on the target parking space line area. Alternatively, the above steps can also be performed by the server 104, the terminal device 102 is, for example, a vehicle-mounted terminal, the terminal device 102 receives the parking space information sent by the server 104, and performs assisted parking or automatic parking based on the parking space information. Alternatively, the above method is performed collaboratively by the terminal device 102 and the server 104, for example, the terminal device 102 can call the corner point detection model deployed by the server 104 to detect and extract the corner point information in the image to be detected, or the terminal device 102 can download the corner point detection model from the server 104 and store it in the local storage space, and so on.

[0038] The terminal device includes but is not limited to one or more of a mobile phone, a computer, an IoT device, a vehicle-mounted terminal, and a portable wearable device. The IoT device may be a smart vehicle-mounted device. The portable wearable device may be one or more of a smart watch, a smart bracelet, smart glasses, and a head-mounted device.

[0039] The server may be an independent server, or a server network, server cluster or distributed system consisting of multiple servers. The server includes but is not limited to a computer, a network host, a single network server, a set of multiple network servers or a cloud server consisting of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0040] The vehicle may be a fuel vehicle, a plug-in hybrid vehicle or a new energy vehicle, etc., and this application does not make any specific limitation on this.

[0041] The following is a detailed description of the embodiments in conjunction with the accompanying drawings. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0042] See also Figure 2 , provides a parking space detection method, which can be applied to a terminal device or a server. The following takes the method applied to a computer device as an example for explanation, and the method includes:

[0043] Step S201, extracting corner point information in the image to be detected.

[0044] The image to be detected is an Around View Monitor (AVM). Generally speaking, a computer device can capture images through multiple fisheye cameras or other camera devices of a vehicle, and perform distortion correction and other processing on the captured images to form a panoramic image around the vehicle, i.e., the image to be detected. The image to be detected can be an image frame in a video captured by a camera device on the vehicle, wherein the image frame can be subjected to image processing such as distortion correction.

[0045] In some embodiments, a computer device obtains initial images of multiple perspectives taken by a camera device of a vehicle, and splices the initial images of multiple perspectives according to a driving scene of the vehicle to obtain a spliced ​​image; and performs one or more of splicing seam processing, distortion correction processing, filtering processing, etc. on the spliced ​​image to obtain an image to be detected.

[0046] The ideal parking space line consists of four corner points and four line segments. Figure 3As shown in the figure, a parking space includes four corner points P1, P2, P3 and P4, and the line segment formed by P1P2 forms the parking space entrance line. However, in actual scenarios, due to the complex environment, it will consume a lot of computing power to fully detect all the line segments, and the detection results will also be affected by other line segments in the environment.

[0047] Specifically, the computer device first extracts corner point information in the image to be detected, and can quickly locate the area that may be a parking space. Exemplarily, the computer device extracts corner points representing the entrance line of the parking space, that is, the entrance line corner points, and obtains corresponding corner point information.

[0048] The corner point information includes but is not limited to one or more of the pixels located at the corner points, the pixel values ​​of the corner point pixels, the coordinate information of the corner point pixels in the image coordinate system, and the like.

[0049] It should be noted that the computer device may extract multiple corner point information, and the subsequent steps may be applied to the processing of any corner point. For the sake of simplicity of description, the examples are described using the processing process of a single corner point as an example. However, those skilled in the art should understand that when there are multiple corner points, the processing flow in the embodiment of the present application shall be applied to each corner point.

[0050] Step S202: determining a target parking space line region in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space.

[0051] Among them, the preset color space refers to the HSV color space. The HSV color space divides the color of the image into three main parameters: Hue, Saturation, and Value. Hue represents the basic type of color, such as red, green, blue, etc. Saturation represents the purity or intensity of the color, ranging from 0 to 1; when the saturation is 0, the color becomes grayscale; when the saturation is 1, the color is a pure color. Value represents the brightness of the color, ranging from 0 to 1; when the value is 0, the color is black; when the value is 1, the color is white.

[0052] If the RGB color image is directly converted into a grayscale image and the parking space line area is extracted, the color information of the parking space line is completely ignored, and it is easily affected by the background color and light intensity, resulting in more non-parking space line information being extracted and low parking space detection accuracy. In the embodiment of the present application, the RGB color space of the image is first converted into the HSV color space. Using prior knowledge, the color of the parking space line is within a certain color range, and the R, G, and B values ​​in the RGB space can be converted into H, S, and V values ​​according to the HSV color space, so that preliminary filtering of non-parking space related pixels can be achieved. Furthermore, based on the corner point information and color information, the target parking space line area in the image to be detected can be segmented and extracted.

[0053] Specifically, the computer device also obtains the color information of the image to be detected in a preset color space, that is, the H, S, and V values ​​of each pixel in the HSV color space converted from the image to be detected. Then, based on the extracted corner point information and color information, the computer device performs segmentation and extraction on the image to be detected, and preliminarily obtains possible parking space line areas. For these parking space line areas, the computer device further screens them to obtain the target parking space line area in the image to be detected.

[0054] Step S203: determining parking space information based on the target parking space line area.

[0055] After determining the target parking space line area, pixels or pixel blocks irrelevant to the parking space have been filtered out, and the computer device can determine the parking space information in the target parking space line area with high accuracy.

[0056] Specifically, the computer device can perform morphological processing on the image containing the target parking space line area output in the previous step, further remove the information irrelevant to the parking space in the target parking space line area, and then extract the parking space line information from it, and determine the parking space information accordingly. Then, the computer device can perform automatic parking, assisted parking, etc. according to the parking space information.

[0057] The parking space detection method of the embodiment of the present application can accurately remove the background part outside the parking space line area and more significantly highlight the parking space line area by extracting the corner point information in the image to be detected and determining the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space. The parking space information is determined based on the target parking space line area, which can realize accurate filtering of non-parking space lines, thereby greatly improving the accuracy while reducing the amount of data.

[0058] In some embodiments, based on corner point information and color information of the image to be detected in a preset color space, a target parking line area in the image to be detected is determined, including: obtaining color information of the image to be detected mapped to the preset color space; based on the corner point information and the color information, filtering pixels in the image to be detected that are outside the target threshold range to obtain an initial parking line area; screening the initial parking line area to obtain a target parking line area.

[0059] Specifically, Figure 4 As shown, the computer device first maps the image to be detected from the RGB color space to the HSV color space, thereby obtaining the color information of each pixel in the image to be detected in the HSV color space. For example, the computer device can calculate the H, S, and V values ​​of each pixel respectively through the following formulas (1) to (3):

[0060] (1)

[0061] (2)

[0062] (3)

[0063] Among them, R, G, and B are the R, G, and B values ​​of each pixel in the RGB color space, respectively.

[0064] The computer device can determine a target threshold range based on the extracted corner point information and the mapped color information, retain pixels with pixel values ​​within the target threshold range, and filter out pixels with pixel values ​​outside the target threshold range, thereby obtaining an initial parking space line area.

[0065] Among them, retaining pixels whose pixel values ​​are within the target threshold range means setting the pixel value of the pixel to a preset value, such as 255; filtering pixels whose pixel values ​​are outside the target threshold range means setting the pixel value of the pixel to another preset value, such as 0. In this way, most of the background parts irrelevant to the parking space in the image can be quickly removed, and the area where the parking space line is located can be significantly highlighted.

[0066] Thus, the computer device can screen the initial parking space line area, further filter the non-parking space line area, and obtain the target parking space line area.

[0067] In the above embodiment, by acquiring color information of the HSV color space, the parking line information can be better highlighted according to the color information, and then a target threshold range is set, and pixels outside the target threshold range are filtered, so that parts irrelevant to the parking line can be quickly removed, the processing efficiency is high, and the subsequent parking line detection can be made more accurate. In addition, the method of extracting parking information based on the HSV color space is more targeted in the selection of thresholds than the method of extracting parking information after direct binarization processing.

[0068] Among them, in some embodiments, based on the corner point information and color information, pixels outside the target threshold range in the image to be detected are filtered to obtain the initial parking line area, including: determining the target pixel value matching the corner point information, and determining the target threshold range based on the target pixel value; screening each pixel based on the target threshold range, filtering the pixels outside the target threshold range in the image to be detected, and obtaining the initial parking line area.

[0069] Specifically, the computer device calculates the corresponding pixel value in the HSV color space, i.e., the target pixel value that matches the corner point information, based on the corner point information, through interpolation algorithms such as nearest neighbor interpolation and cubic interpolation. In some embodiments, the computer device calculates the index of the pixel a mapped in the HSV color space based on the coordinate information P1(x1, y1) of the corner point P1, rounds the index, and determines the corresponding pixel a' in the RGB image (i.e., the image to be detected that has not been converted into an HSV image) based on the processed index, and assigns the pixel value of the pixel a' to the pixel a. This can improve the resolution of the image, thereby improving the accuracy of the parking space line extraction. Exemplarily, the computer device can traverse the image through the ROUND function to obtain each target pixel value.

[0070] Based on the target pixel value of each pixel, the computer device can construct a target threshold range [Lower, Upper] according to the maximum and minimum values ​​therein, wherein Lower refers to the minimum target pixel value and Upper refers to the maximum target pixel value.

[0071] Thus, the computer device can filter each pixel according to the target threshold range, thereby filtering out pixels whose pixel values ​​are outside the target threshold range, so that the retained pixels constitute the initial parking space line area. Exemplarily, filtering based on the target threshold range can be expressed by the following formula (4):

[0072] (4)

[0073] Among them, R, G, and B are the pixel values ​​of pixel i in the RGB color space.

[0074] Exemplarily, the computer device may perform filtering processing through the inRange() function, where pixel values ​​below Lower and above Upper become 0, and pixel values ​​between Lower and Upper become 255, thereby removing non-parking space line portions outside the target threshold range.

[0075] In the above embodiment, by determining the target threshold range based on the corner point information and filtering the pixels in the image to be detected according to the target threshold range, a preliminary screening of the image to be detected is achieved, and most of the background irrelevant to the parking space is quickly removed, thereby improving the accuracy of parking space detection, reducing the amount of data in subsequent steps, and improving the efficiency of parking space line detection.

[0076] After the initial parking space line area is preliminarily obtained, the computer device can optionally perform image processing to remove noise such as holes in the image, further improving the accuracy of subsequent parking space detection. In some embodiments, the computer device can perform morphological processing such as corrosion and expansion on the image (which is a binary image) containing the initial parking space line area, thereby filtering out smaller areas and noise pixels. Exemplarily, the computer device can set a convolution kernel of size 3×3 (for example, setting an elliptical convolution kernel through the cv2.MORPH_ELLIPSE function, etc.) to perform corrosion and expansion processing on the image containing the initial parking space line area.

[0077] In order to further remove the non-parking line information, the computer device needs to further filter the initial parking line area. To this end, in some embodiments, filtering the initial parking line area to obtain the target parking line area includes: in the initial parking line area, determining an image block composed of multiple adjacent pixels with equal pixel values ​​as a first connected domain to obtain multiple first connected domains; based on the multiple first connected domains, filtering the initial parking line area to obtain the target parking line area.

[0078] Specifically, the computer device determines a plurality of adjacent image blocks with equal pixel values ​​as the first connected domain in the initial parking space line region. The computer device obtains a plurality of first connected domains in the initial parking space line region by traversing the image.

[0079] Furthermore, the computer device screens the initial parking space line region based on the multiple first connected domains, thereby eliminating image blocks irrelevant to parking spaces, obtaining image blocks containing parking space information, and thereby obtaining a target parking space line region.

[0080] For example, the computer device can output information of multiple connected domains through the connectedComponentsWithStats() function, and the connection direction can be selected as 8-connected, that is, including the positions immediately adjacent to the pixel and the positions adjacent to the pixel in an oblique direction. The function can output the pixel label (label) and the area (stat) of the connected domain in the connected domain.

[0081] In the above embodiment, by determining the connected domain in the image and screening the target parking space line area based on it, the information of larger non-parking space lines can be excluded, thereby effectively reducing the amount of calculation and quickly highlighting the main features of the image.

[0082] In some embodiments, the initial parking space line area is screened based on the multiple first connected domains to obtain the target parking space line area, including: determining the area of ​​each first connected domain and obtaining a preset area threshold; for any first connected domain, when the area of ​​the targeted first connected domain is smaller than the area threshold, retaining the targeted first connected domain; and obtaining the target parking space line area based on the retained first connected domain.

[0083] Specifically, the computer device obtains the area of ​​each first connected domain. For example, the computer device outputs the area of ​​each connected domain through the connectedComponentsWithStats() function. Therefore, the computer device sets 20% of the area of ​​the maximum connected domain as the area threshold according to the area of ​​each first connected domain in the image, and traverses all first connected domains, and uses the unique label labels of each connected domain to retain the first connected domain within the 20% area threshold. That is, when the area of ​​the targeted first connected domain is less than the area threshold, the targeted first connected domain is retained; and when the area of ​​the targeted first connected domain is greater than or equal to the area threshold, the targeted first connected domain is eliminated, thereby filtering out the first connected domain with a larger area. In this way, it is possible to exclude the information of larger non-parking space lines and obtain the target parking space line area, thereby improving the accuracy of parking space detection.

[0084] In some embodiments, obtaining the target parking line area based on the retained first connected domain includes: obtaining a candidate parking line area based on the retained first connected domain; in the candidate parking line area, determining an image block consisting of multiple adjacent pixels with equal pixel values ​​as a second connected domain to obtain multiple second connected domains; based on the multiple second connected domains, screening the candidate parking line area to obtain the target parking line area.

[0085] The computer device can perform a secondary screening based on the target parking space line area obtained by the first screening, so as to more accurately extract the image blocks related to the parking space information. Specifically, the computer device uses the parking space line area obtained after screening based on the first connected domain as the candidate parking space line area, and traverses the image again to obtain each second connected domain in the candidate parking space line area. Thus, the computer device performs screening based on each second connected domain to obtain the target parking space line area.

[0086] The screening method may be similar to the above embodiment, for example, a smaller area threshold may be set to achieve more refined screening, etc. In other embodiments, the screening of the candidate parking space line regions based on the multiple second connected domains to obtain the target parking space line region includes: obtaining the contour range of each second connected domain; screening the candidate parking space line regions based on the contour range of each second connected domain and the corner point information to obtain the target parking space line region.

[0087] Specifically, when determining each second connected domain, the computer device also determines the contour range of each second connected domain. The contour range of the second connected domain can be determined by the circumscribed rectangle of the second connected domain. Exemplarily, the contour range of the second connected domain is the range of its circumscribed rectangular detection frame. Thus, the computer device screens the candidate parking space line area based on the contour range of each second connected domain and the corner point information to obtain the target parking space line area, so as to further remove the non-parking space line area.

[0088] In the above embodiment, the connected domains in the image are screened by the connected domain threshold, and the connected domains with larger areas are removed to exclude the information of larger non-parking space lines. This can effectively reduce the amount of calculation and quickly highlight the main features of the image. In particular, for application scenarios that require rapid processing of a large number of images, the calculation speed can be significantly improved and the detection efficiency of parking space lines can be improved.

[0089] In some embodiments, based on the contour range of each second connected domain and the corner point information, the candidate parking line area is screened to obtain a target parking line area, including: for any second connected domain, if the corner point coordinates are outside the contour range corresponding to the targeted second connected domain, filtering the contour pixels of the targeted second connected domain; based on the filtered second connected domain, obtaining the target parking line area.

[0090] Specifically, the computer device determines the contour range corresponding to each second connected domain in the candidate parking space line area. Exemplarily, the contour range corresponding to each second connected domain is a contour rectangular box, which has size information such as width (width) and height (height), as well as coordinate information (x, y) and the like.

[0091] Therefore, based on the corner point coordinate information, the computer device takes the coordinates (x1, y1) of the corner point P1 as an example to determine whether the corner point P1 is within the contour range of the second connected domain, that is, whether the coordinates (x1, y1) of the corner point P1 are located within the contour rectangular frame of the second connected domain. If so, the computer device retains the second connected domain, thereby retaining each pixel in the second connected domain, and these pixels constitute a binary image block. If not, the computer device fills the pixel values ​​of the contour pixels of the second connected domain with 0, thereby filtering out the second connected domains that are not related to the parking space. By traversing each second connected domain, the computer device can further remove the non-parking space related parts, and the retained second connected domains constitute the target parking space line area. Exemplarily, the image obtained after screening can be as follows Figure 5 As shown in Figure (a) in the figure, the white part is the target parking space line area.

[0092] In the above embodiment, by further screening the connected domain based on the corner point information, the non-parking space line portion can be removed more accurately, thereby improving the accuracy of subsequent parking space line detection.

[0093] In some embodiments, determining parking space information based on a target parking space line area includes: extracting target parking space line information from the target parking space line area; determining parking space information based on the target parking space line information.

[0094] Specifically, the computer device may obtain the target parking line information in the target parking line area by one or more image processing methods such as corrosion, expansion, opening operation, and union operation. The target parking line information includes but is not limited to relevant information of pixels constituting the target parking line, such as pixel coordinates, pixel values, etc., and one or more of the length and angle of the target parking line.

[0095] Thus, the computer device can finally determine the parking space information based on the target parking space line information and the parking space attribute information such as the length and / or width of the standard parking space, etc. The parking space information includes but is not limited to one or more of the location of the parking space, whether the parking space is vacant, and the size of the parking space.

[0096] In the above embodiment, by extracting the target parking space line information in the target parking space line area, further eliminating the part irrelevant to the parking space, and filtering out the line segment information constituting the parking space, the parking space information can be determined, thereby improving the accuracy of parking space detection.

[0097] In some embodiments, extracting target parking space line information in the target parking space line area includes: extracting parking space line skeleton information in the target parking space line area; performing Hough transform based on the parking space line skeleton information to obtain the target parking space line information.

[0098] Specifically, in the target parking space line area, the computer device first extracts the parking space line skeleton information. The computer device can extract the parking space line skeleton information in the target parking space line area by performing one or more morphological processing such as corrosion, expansion, and opening operations on the image.

[0099] Exemplarily, the computer device performs an opening operation on the image containing the target parking space line area output in the above embodiment, that is, performs a morphological process of first corroding and then dilating, and then calculates the pixel difference between the image before and after the morphological process, and performs a union operation with a preset image based on the pixel difference, so as to obtain the parking space line skeleton information. The preset image is, for example, an image with all zero pixel values ​​of the same size as the output image. The computer device can determine whether the image after corrosion is completely black through the cv2.countNonZero function. If not, the morphological process is repeated to loop the process, and finally obtain the parking space line skeleton information.

[0100] For example, the parking space line skeleton information extracted by the computer device can be as follows: Figure 5 As shown in Figure (b), the white part is the parking space line skeleton information.

[0101] Then, the computer device performs Hough transform based on the parking line skeleton information, thereby extracting the target parking line information. The computer device can use the image containing the parking line skeleton information output in the above step as input, and use, for example, a probabilistic Hough transform function (such as HoughLinesP() function). The Hough transform can traverse each pixel in the image and output the detected straight line information, including the starting point coordinates and the end point coordinates of the straight line, thereby determining the position and angle of the parking line and other information.

[0102] The computer device can detect the parking space line information more accurately by setting appropriate Hough transform parameters. The Hough transform parameters include but are not limited to one or more of the distance step (rho), angle step (theta), cumulative count threshold (threshold) (the smaller the cumulative count threshold, the more straight lines are detected), minimum straight line length (minLineLength), and interval between two points on a line segment (maxLineGap).

[0103] For example, the computer device may set the distance step length rho=1, the angle step length theta=1, pi / 180, the cumulative count threshold threshold=10, minLineLength=5, and maxLineGap=20 during the straight line search. Thus, the computer device may determine the probabilistic Hough transform function as HoughLinesP(img, rho, theta, threshold, minLineLength, maxLineGap), and perform traversal accordingly, thereby further extracting the target parking space line information from the parking space line skeleton information.

[0104] For example, the target parking space line information extracted by the computer device through Hough transform can be Figure 5 As shown in Figure (c), the red line is the extracted target parking space line.

[0105] In the above embodiment, by extracting the parking line skeleton information, the parking line can be accurately located, so that the subsequent parking line detection can greatly reduce the interference caused by non-parking line information; and then performing Hough transform on this basis greatly reduces the data processing amount, improves the parking line detection efficiency, and can accurately determine the target parking line.

[0106] After determining the target parking space line information, the computer device can determine the parking space information based on the target parking space line information. To this end, in some embodiments, determining the parking space information based on the target parking space line information includes: extracting paired parking space line information from the target parking space line information based on a preset threshold condition; performing deduplication processing on the paired parking space line information to obtain independent parking space line information; and determining the parking space information based on the independent parking space line information.

[0107] Specifically, the computer device sets a threshold condition based on prior information of the parking space, such as whether the line segments on both sides of the parking space are parallel and there is a certain distance between the line segments on both sides of the parking space. Therefore, the computer device can determine the angle of each parking space line and calculate the angle difference between every two parking space lines. Alternatively, the computer device can calculate the distance between every two parking space lines respectively. The angle of the parking space line refers to the angle of the parking space line relative to the horizontal axis or the vertical axis in the image coordinate system. Exemplarily, the angle of the parking space line can be obtained by calculating the arctan value of the parking space line in the image coordinate system.

[0108] Accordingly, the preset threshold condition may be that the angle difference between every two parking space lines is less than a certain threshold, and / or the distance between every two parking space lines is less than a certain threshold, and so on.

[0109] Furthermore, the computer device can compare every two parking lines based on the threshold condition to determine whether the two parking lines constitute the same parking space. If so, the two parking lines are paired parking lines, and the computer device can obtain paired parking line information.

[0110] Since the same parking line can belong to two adjacent parking spaces, duplication may occur. Therefore, the computer device can perform deduplication processing on the paired parking line information, and only retain the information of one parking line for the duplicated parking lines, so as to use the retained parking line information as independent parking line information.

[0111] In addition, the computer device can also determine the distance between the corner point and the end point of the detected parking space line based on the coordinates of the corner point, and screen out repeated parking space lines whose starting point is far from the corner point under the condition that the distance does not exceed a certain specific value, and average the parking space lines whose distance does not exceed the specific value, thereby outputting the final independent parking space line.

[0112] For example, by Figure 5 The above processing is performed on Figure (c) in the figure, and the independent parking space line obtained can be shown as Figure 6 As a result, the computer device can further process the independent parking space line information to determine the parking space information.

[0113] In the above embodiment, a threshold condition is set based on prior information of parking spaces such as parallelism and distance of parking spaces, and pairs of parking space lines are extracted based on the threshold condition, so that the detected line segments can be associated, thereby further improving the accuracy of parking space detection; at the same time, since the number of parking space lines after Hough transform is uncertain, duplicate line segments on the same parking space can be removed through deduplication processing, thereby avoiding the consumption of computing resources and improving the efficiency of parking space detection.

[0114] Since a parking space is composed of multiple line segments, adjacent parking spaces may share a line segment, so there may be duplication when the detected line segments are used as parking space lines. Therefore, in some embodiments, based on a preset threshold condition, extracting paired parking space line information from the target parking space line information includes: matching multiple parking space lines included in the target parking space line information with each other, determining the angle difference and distance difference between every two parking space lines; when the angle difference meets the angle threshold condition and the distance difference meets the distance threshold condition, determining the matched two parking space lines as paired parking space lines, and obtaining paired parking space line information.

[0115] Specifically, the computer device matches the multiple parking lines contained in the target parking line information in pairs, and calculates the angle difference and distance difference between every two parking lines. Exemplarily, for parking line L1 and parking line L2, the computer device calculates the angle between every two parking lines respectively, and obtains (theta1, theta2), where theta1 is the angle of parking line L1, and theta2 is the angle of parking line L2. Thus, the computer device can calculate the angle difference, and determine whether parking line L1 and parking line L2 are parallel based on the angle difference. If the angle difference is within the preset angle threshold, the computer device determines that parking line L1 and parking line L2 are parallel.

[0116] The computer device calculates the distance d between the parking line L1 and the parking line L2. For example, the computer device presets the pixel width between adjacent parking lines in the standard parking space to be 80, and the pixel width between non-adjacent parking lines to be 150, and the distance threshold range can be set to [80, 150], or [60, 130], etc. When the parking line L1 and the parking line L2 are parallel, and the distance d is within the distance threshold range, the computer device outputs the parking line L1 and the parking line L2 as paired parking line information, and the parking line L1 and the parking line L2 constitute a standard parking space.

[0117] In the above embodiment, a threshold condition is set based on prior information of parking spaces such as parallelism and distance of parking spaces, and pairs of parking space lines are extracted based on the threshold condition, so that the detected line segments can have correlation, thereby further improving the accuracy of parking space detection.

[0118] Thus, based on the non-repetitive independent parking space line information, the computer device can determine the parking space information by reasoning according to the prior information of the parking space. To this end, in some embodiments, determining the parking space information based on the independent parking space line information includes: inferring the simulated inner corner point information based on the independent parking space line information and the standard parking space size; determining the parking space information according to the corner point information and the inner corner point information. Among them, the standard parking space size includes one or more of the length, width, shape, etc. of the standard parking space.

[0119] Specifically, the computer device can infer the simulated inner corner point information based on the starting point coordinates and the end point coordinates of the independent parking space line information and the standard parking space size. The inner corner point is a virtual corner point on the independent parking space line that is a certain distance away from the corner point.

[0120] Therefore, the computer device combines the simulated inner corner points and the previously detected corner points according to the shape of the standard parking space (such as a rectangle, etc.), thereby forming a complete parking space.

[0121] In the above embodiment, by using virtual inner corner point information and determining a parking space composed of the virtual inner corner point information and the actually detected entrance line corner point information, there is no need to perform complex neural network processing, which reduces the amount of data processing and thereby improves the efficiency of parking space detection. In addition, the parking space information obtained by reasoning based on the standard parking space size is more accurate.

[0122] In any of the above embodiments, the corner point information in the image to be detected is extracted, including: recognizing the image to be detected by a pre-trained corner point recognition model to obtain each corner point detection frame and each entry line detection frame; respectively determining a first confidence corresponding to each corner point detection frame and a second confidence corresponding to each entry line detection frame; based on each first confidence and each second confidence, obtaining the corner point information in the image to be detected.

[0123] Specifically, the computer device can identify the image to be detected through the trained corner point recognition model to obtain the corner point information therein. The corner point recognition model includes but is not limited to the YOLO5 model. In the embodiment of the present application, the YOLO5 model is improved, and while outputting the corner point detection frame, the entry line frame is also output, and the first confidence corresponding to each corner point detection frame and the second confidence corresponding to each entry line detection frame are respectively output.

[0124] For example, the computer device performs corner detection through the YOLO5 model and outputs 9-dimensional data of (x, y, w, h, confidence1, confidence2, cos.sin, isOccupied). The output image is as follows: Figure 7 As shown in the figure, the dotted part is the detection box. The coordinates of the detection box are (x, y), the size is (w, h), confidence1 is the confidence corresponding to the corner point detection box, that is, the first confidence, and confidence2 is the confidence corresponding to the entry line detection box, that is, the second confidence.

[0125] Therefore, based on each first confidence level and each second confidence level, the detected corner points are screened, and the corner points whose confidence levels meet the threshold condition are retained, thereby obtaining corner point information.

[0126] In the above embodiment, the corner points in the image to be detected are detected through the corner point recognition model, and the first confidence of the corner point detection frame and the second confidence of the entrance line detection frame are set. On the basis of the first confidence, further screening is performed with the second confidence of the entrance line detection frame to ensure that the corner points are corner points on the parking space entrance line, thereby ensuring the correlation between the detected corner points and the parking space lines, thereby improving the accuracy of parking space line detection.

[0127] Among them, in some embodiments, based on each first confidence level and each second confidence level, corner point information in the image to be detected is obtained, including: based on each first confidence level, each corner point detection frame is screened to obtain a target corner point detection frame; based on each second confidence level, each entry line detection frame is screened to obtain a target entry line detection frame; based on the target corner point detection frame and the target entry line detection frame, the corner point information is determined.

[0128] Specifically, the computer device screens out a corner point detection box that meets the first threshold condition based on the first confidence of the corner point detection box corresponding to the corner point, that is, the target corner point detection box, and retains the corner point corresponding to the target corner point detection box in combination with a preset first threshold condition.

[0129] In addition, the computer device also filters out the entrance line detection frame that meets the second threshold condition based on the second confidence of the entrance line detection frame corresponding to the entrance line and the preset second threshold condition, that is, the target entrance line detection frame, and retains the corner points on the entrance line contained in the target entrance line detection frame.

[0130] Thus, the corner points are screened based on the target corner point detection frame and the target entry line detection frame to obtain the retained target corner points and the corner point information of the retained target corner points. Exemplarily, the computer device can determine the coordinate value of the corner point according to the preset anchor point size.

[0131] In the above embodiment, by screening corner points by the first confidence level and the second confidence level, the accuracy of corner point detection can be improved, and the correlation between the detected corner points and the parking space lines is ensured, thereby improving the accuracy of parking space line detection.

[0132] In a specific example, Figure 8 As shown, the parking space detection method provided in the present application can be applied to a parking space detection system, including a parking space corner point detection module, a parking space line preprocessing module, a parking space line screening module and a parking space reasoning module. Exemplarily, each module cooperates to perform the following Fig. 9 The parking space detection process shown is as follows: the computer device performs color space mapping on the image to be detected, converts the RGB image into an HSV image, and determines the pixel value through color information for filtering and extraction to obtain the initial parking space line area; and, performs corner point detection on the image to be detected through the YOLO5 model, outputs the corner point information of the entrance line, and determines the target threshold range based on the corner point coordinates, and performs parking space line preprocessing in combination with the target threshold range and the initial parking space line area to obtain the target parking space line information; then, the parking space lines are screened and matched, such as extracting paired parking space lines, removing redundant parking space lines (including repeated parking space lines), etc.; finally, parking space reasoning is performed to obtain complete parking space information.

[0133] Among them, the parking space corner point detection module uses a large amount of labeled data and a deep learning network to train a corner point detection model, thereby outputting all corner point information for a given AVM image.

[0134] The parking space line preprocessing module is responsible for Fig. 9 The parking space line preprocessing process in the process may include the following: Fig.10 The preprocessing step shown is that the computer device performs filtering based on color information, and then performs morphological processing such as corrosion and expansion to screen the connected domains in the output image, remove the connected domains with larger areas, and the retained connected domains constitute the target parking space line area. Then, the computer device performs skeleton extraction on the target parking space line area to obtain parking space skeleton information, and performs Hough transform based on the parking space skeleton information to detect and obtain the target parking space line information.

[0135] The parking line screening module further screens and matches the line information output by the parking line preprocessing to obtain the final parking line information. The parking line screening module mainly includes extracting paired parking lines, removing duplicates (for example, outputting all paired parking information to a list, deleting duplicates in the list by checking for duplicates, and outputting independent parking line information) and removing other redundant parking lines.

[0136] The parking space reasoning module combines the parking space prior information and performs parking space reasoning based on the detected independent parking space lines and corner point coordinates. For example, based on the starting point coordinates and end point coordinates of the independent parking space line and the standard parking space length, the virtual inner corner point information of the independent parking space line is inferred, and the complete parking space information is obtained based on the inferred virtual inner corner point information and the corner point information of the detected entrance line corner point.

[0137] The parking space detection method and system provided by the present application, based on the HSV channel space color and the corner point coordinate information detected by deep learning, removes the background part outside the parking space line area, filters and extracts the target parking space area, and can more significantly highlight the parking space line features compared to directly binarizing the RGB image. In addition, through the parking space preprocessing, the filtering effect of non-parking space lines is relatively good, and the smaller area and the non-parking space connected domain can be removed, and the skeleton of the parking space line can be extracted. Then, based on the skeleton, the parking space line of the original width is processed into a narrower line, which is convenient for the Hough transform to output a single parking space line in the center. The obtained parking space line is more accurate and has a smaller offset from the actual parking space line, which improves the accuracy of parking space detection. In addition, the above method can be applied to various scenarios, and can realize parking space detection of various parking space types, parking space angles, and parking space colors. In particular, for parking spaces surrounded by closed lines, it is only necessary to insert a small area of ​​black area between the adjacent corner points detected for truncation to make the closed solid line open, which greatly improves the efficiency and accuracy of parking space detection.

[0138] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0139] Based on the same inventive concept, the embodiment of the present application also provides a parking space detection device for implementing the parking space detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more parking space detection device embodiments provided below can refer to the limitations of the parking space detection method above, and will not be repeated here.

[0140] See also Fig.11 , a parking space detection device is provided, which can be integrated in a computer device, including an extraction module 1101 and a determination module 1102, wherein:

[0141] The extraction module 1101 is used to extract corner point information in the image to be detected.

[0142] The determination module 1102 is used to determine the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space.

[0143] The determination module 1102 is further configured to extract target parking space line information in the target parking space line area, and determine parking space information based on the target parking space line information.

[0144] In some embodiments, the determination module is also used to obtain color information of the image to be detected mapped to a preset color space; based on the corner point information and color information, filter the pixels in the image to be detected that are outside the target threshold range to obtain an initial parking line area; and screen the initial parking line area to obtain a target parking line area.

[0145] In some embodiments, the determination module is also used to determine the target pixel value that matches the corner point information, and determine the target threshold range based on the target pixel value; based on the target threshold range, each pixel is screened, and pixels outside the target threshold range in the image to be detected are filtered to obtain the initial parking space line area.

[0146] In some embodiments, the determination module is further used to determine, in the initial parking space line area, an image block consisting of multiple adjacent pixels with equal pixel values ​​as a first connected domain, to obtain multiple first connected domains; based on the multiple first connected domains, the initial parking space line area is screened to obtain a target parking space line area.

[0147] In some embodiments, the determination module is also used to determine the area of ​​each first connected domain and obtain a preset area threshold; for any first connected domain, when the area of ​​the targeted first connected domain is smaller than the area threshold, the targeted first connected domain is retained; based on the retained first connected domain, the target parking space line area is obtained.

[0148] In some embodiments, the determination module is also used to obtain a candidate parking line area based on the retained first connected domain; in the candidate parking line area, an image block consisting of multiple adjacent pixels with equal pixel values ​​is determined as a second connected domain to obtain multiple second connected domains; based on the multiple second connected domains, the candidate parking line area is screened to obtain a target parking line area.

[0149] In some embodiments, the determination module is further used to obtain the contour range of each second connected domain; based on the contour range of each second connected domain and the corner point information, the candidate parking space line area is screened to obtain the target parking space line area.

[0150] In some embodiments, the corner point information includes corner point coordinate information; the determination module is also used to filter the contour pixels of any second connected domain if the corner point coordinates are outside the contour range corresponding to the second connected domain; based on the filtered second connected domain, the target parking space line area is obtained.

[0151] In some embodiments, the determination module is further used to extract target parking space line information in the target parking space line area; and determine the parking space information based on the target parking space line information.

[0152] In some embodiments, the determination module is further used to extract the parking space line skeleton information in the target parking space line area; and perform Hough transform based on the parking space line skeleton information to obtain the target parking space line information.

[0153] In some embodiments, the determination module is also used to extract paired parking line information from the target parking line information based on preset threshold conditions; deduplicate the paired parking line information to obtain independent parking line information; and determine the parking information based on the independent parking line information.

[0154] In some embodiments, the determination module is also used to match multiple parking lines contained in the target parking line information with each other, and determine the angle difference and distance difference between every two parking lines; when the angle difference satisfies the angle threshold condition and the distance difference satisfies the distance threshold condition, the two matched parking lines are determined as paired parking lines to obtain paired parking line information.

[0155] In some embodiments, the determination module is further used to infer simulated inner corner point information based on the independent parking space line information and the standard parking space size; and determine the parking space information according to the corner point information and the inner corner point information.

[0156] In some embodiments, the extraction module is also used to identify the image to be detected through a pre-trained corner point recognition model to obtain each corner point detection frame and each entry line detection frame; determine the first confidence corresponding to each corner point detection frame and the second confidence corresponding to each entry line detection frame respectively; based on each first confidence and each second confidence, obtain the corner point information in the image to be detected.

[0157] In some embodiments, the extraction module is also used to filter each corner point detection box based on each first confidence level to obtain a target corner point detection box; filter each entry line detection box based on each second confidence level to obtain a target entry line detection box; and determine corner point information based on the target corner point detection box and the target entry line detection box.

[0158] Each module in the above-mentioned devices can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of the processor in the control device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0159] Correspondingly, an embodiment of the present application also provides a computer device, which may be a terminal device or a server.

[0160] like Fig.12 As shown, Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 1200 includes a processor 1201 having one or more processing cores, a memory 1202 having one or more computer-readable storage media, and a computer program stored in the memory 1202 and executable on the processor. The processor 1201 is electrically connected to the memory 1202. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0161] The processor 1201 is the control center of the computer device 1200, and uses various interfaces and lines to connect various parts of the entire computer device 1200. By running or loading software programs and / or units stored in the memory 1202, and calling data stored in the memory 1202, the processor 1201 executes various functions of the computer device 1200 and processes data, thereby monitoring the computer device 1200 as a whole. The processor 1201 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0162] In the embodiment of the present application, the processor 1201 in the computer device 1200 will load the instructions corresponding to the processes of one or more application programs into the memory 1202 according to the following steps, and the processor 1201 will run the application programs stored in the memory 1202, so as to realize various functions, such as: extracting the corner point information in the image to be detected; determining the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space; extracting the target parking space line information in the target parking space line area, and determining the parking space information based on the target parking space line information. The specific implementation of each of the above operations can be referred to the previous embodiments, and will not be repeated here.

[0163] Alternatively, if Fig.12 As shown, the computer device 1200 further includes: a touch screen 1203, a radio frequency circuit 1204, an audio circuit 1205, an input unit 1206, and a power supply 1207. The processor 1201 is electrically connected to the touch screen 1203, the radio frequency circuit 1204, the audio circuit 1205, the input unit 1206, and the power supply 1207, respectively. Those skilled in the art can understand that Fig.12 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0164] The touch display screen 1203 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1203 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, which can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect the user's touch operations on or near it (such as the user's operation on the touch panel or near the touch panel using any suitable object or accessory such as a finger, a stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 1201, and can receive the command sent by the processor 1201 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1201 to determine the type of touch event, and then the processor 1201 provides corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 1203 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 1203 can also be used as a part of the input unit 1206 to realize the input function.

[0165] The radio frequency circuit 1204 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer device through wireless communication, and to send and receive signals between the network device or other computer device.

[0166] The audio circuit 1205 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 1205 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1205 and converted into audio data, and then the audio data is output to the processor 1201 for processing, and then sent to another computer device through the radio frequency circuit 1204, or the audio data is output to the memory 1202 for further processing. The audio circuit 1205 may also include an earphone jack to provide communication between an external headset and the computer device.

[0167] The input unit 1206 may be configured to receive input numbers, character information, or user feature information (eg, fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0168] The power supply 1207 is used to supply power to various components of the computer device 1200. Optionally, the power supply 1207 can be logically connected to the processor 1201 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 1207 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0169] although Fig.12 Not shown, the computer device 1200 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0170] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0171] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0172] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute any one of the parking space detection methods provided in the embodiments of the present application. The computer program can execute the following steps of the parking space detection method: extracting corner point information in the image to be detected; determining the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space; extracting the target parking space line information in the target parking space line area, and determining the parking space information based on the target parking space line information. The specific implementation of each of the above operations can be found in the previous embodiments, and will not be repeated here.

[0173] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0174] Since the computer program stored in the computer-readable storage medium can execute any parking space detection method provided in the embodiments of the present application, the beneficial effects that can be achieved by any parking space detection method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0175] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations in the above embodiments.

[0176] In the above-mentioned parking space detection device, computer-readable storage medium, computer equipment, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-described parking space detection device, computer-readable storage medium, computer program product, computer equipment, and corresponding units can refer to the description of the parking space detection method in the above embodiment, and will not be repeated here.

[0177] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0178] The above are only preferred embodiments of the present application and do not constitute any form of limitation to the present application. Although the descriptions of various embodiments in the embodiments of the present application have different focuses, for parts not described in detail in a certain embodiment, reference can be made to the relevant embodiments of other embodiments. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.

Claims

1. A parking space detection method, characterized in that: The method comprises: Extract corner point information from the image to be detected; Determine a target parking space line area in the image to be detected based on the corner point information and color information of the image to be detected in a preset color space; Determining parking space information based on the target parking space line area; The determining of the target parking space line area in the image to be detected based on the corner point information and the color information of the image to be detected in a preset color space includes: Obtaining color information of the image to be detected mapped to a preset color space; Based on the corner point information and the color information, pixels outside a target threshold range in the image to be detected are filtered to obtain an initial parking space line area; Screening the initial parking space line area to obtain a target parking space line area; The screening of the initial parking space line area to obtain the target parking space line area includes: In the initial parking space line area, an image block consisting of a plurality of adjacent pixels having equal pixel values ​​is determined as a first connected domain, to obtain a plurality of first connected domains; Based on the multiple first connected domains, the initial parking space line area is screened to obtain a target parking space line area; The step of screening the initial parking space line region based on the plurality of first connected domains to obtain a target parking space line region includes: Determine the area of ​​each first connected domain and obtain a preset area threshold; For any first connected domain, when the area of ​​the targeted first connected domain is smaller than the area threshold, retain the targeted first connected domain; Based on the retained first connected domain, a target parking space line area is obtained; The step of obtaining a target parking space line area based on the retained first connected domain includes: Based on the retained first connected domain, a candidate parking space line region is obtained; In the candidate parking space line region, an image block consisting of a plurality of adjacent pixels having equal pixel values ​​is determined as a second connected domain, to obtain a plurality of second connected domains; Based on the multiple second connected domains, the candidate parking space line regions are screened to obtain a target parking space line region.

2. The method according to claim 1, characterized in that The filtering of pixels outside a target threshold range in the image to be detected based on the corner point information and the color information to obtain an initial parking space line area includes: Determine a target pixel value that matches the corner point information, and determine a target threshold range based on the target pixel value; The pixels are screened based on the target threshold range, and the pixels outside the target threshold range in the image to be detected are filtered to obtain an initial parking space line area.

3. The method according to claim 1, characterized in that The step of screening the candidate parking space line regions based on the plurality of second connected domains to obtain a target parking space line region includes: Obtaining the contour range of each second connected domain; Based on the contour range of each second connected domain and the corner point information, the candidate parking space line area is screened to obtain a target parking space line area.

4. The method according to claim 3, characterized in that The corner point information includes corner point coordinate information; the candidate parking space line area is screened based on the contour range of each second connected domain and the corner point information to obtain the target parking space line area, including: For any second connected domain, if the corner point coordinates are outside the contour range corresponding to the targeted second connected domain, filtering the contour pixels of the targeted second connected domain; Based on the filtered second connected domain, a target parking space line area is obtained.

5. The method according to claim 1, characterized in that The determining of parking space information based on the target parking space line area includes: Extracting target parking space line information in the target parking space line area; Based on the target parking space line information, parking space information is determined.

6. The method according to claim 5, characterized in that Extracting target parking space line information in the target parking space line area includes: Extracting the parking space line skeleton information in the target parking space line area; A Hough transform is performed based on the parking space line skeleton information to obtain target parking space line information.

7. The method according to claim 5, characterized in that The determining of parking space information based on the target parking space line information includes: Based on a preset threshold condition, extracting paired parking space line information from the target parking space line information; Deduplication processing is performed on the paired parking space line information to obtain independent parking space line information; Parking space information is determined based on the independent parking space line information.

8. The method according to claim 7, characterized in that The extracting paired parking space line information from the target parking space line information based on a preset threshold condition includes: Matching the multiple parking space lines included in the target parking space line information to determine the angle difference and distance difference between every two parking space lines; When the angle difference satisfies an angle threshold condition and the distance difference satisfies a distance threshold condition, the two matched parking space lines are determined as a paired parking space line, and paired parking space line information is obtained.

9. The method according to claim 7, characterized in that: The determining of the parking space information based on the independent parking space line information includes: Based on the independent parking space line information and the standard parking space size, the simulated inner corner point information is inferred; Parking space information is determined according to the corner point information and the inner corner point information.

10. The method according to claim 1, characterized in that The step of extracting corner point information from the image to be detected includes: The image to be detected is recognized by using the pre-trained corner point recognition model to obtain the detection frames of each corner point and each entry line; Determine respectively a first confidence level corresponding to each corner point detection frame and a second confidence level corresponding to each entry line detection frame; Based on each first confidence level and each second confidence level, corner point information in the image to be detected is obtained.

11. The method according to claim 10, characterized in that The obtaining of corner point information in the image to be detected based on each first confidence level and each second confidence level includes: Based on each of the first confidence levels, each corner point detection frame is screened to obtain a target corner point detection frame; Based on each of the second confidence levels, each entry line detection frame is screened to obtain a target entry line detection frame; Based on the target corner point detection frame and the target entry line detection frame, corner point information is determined.

12. A parking space detection device, characterized in that: The device comprises: An extraction module, used to extract corner point information in the image to be detected; A determination module, configured to determine a target parking space line area in the image to be detected based on the corner point information and color information of the image to be detected in a preset color space; The determination module is further used to determine parking space information based on the target parking space line area; The determination module is further used to obtain color information of the image to be detected mapped to a preset color space; based on the corner point information and the color information, filter pixels outside the target threshold range in the image to be detected to obtain an initial parking space line area; filter the initial parking space line area to obtain a target parking space line area; The determination module is further configured to determine, in the initial parking space line region, an image block consisting of a plurality of adjacent pixels having equal pixel values ​​as a first connected domain, thereby obtaining a plurality of first connected domains; and based on the plurality of first connected domains, screen the initial parking space line region to obtain a target parking space line region; The determination module is further used to determine the area of ​​each first connected domain and obtain a preset area threshold; for any first connected domain, when the area of ​​the targeted first connected domain is smaller than the area threshold, the targeted first connected domain is retained; based on the retained first connected domain, a target parking space line area is obtained; The determination module is further used to obtain a candidate parking line area based on the retained first connected domain; in the candidate parking line area, an image block consisting of multiple adjacent pixels with equal pixel values ​​is determined as a second connected domain to obtain multiple second connected domains; based on the multiple second connected domains, the candidate parking line area is screened to obtain a target parking line area.

13. A computer device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the parking space detection method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the parking space detection method according to any one of claims 1-11.

15. A computer program product, characterized in that The method comprises a computer program, wherein the computer program is used by a processor to execute the steps of the parking space detection method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method for feature selection of parking spaces based on binocular vision

    CN109063632A

  • Underground parking space batch identification and measurement method based on laser radar technology

    CN118038664A