Method for determining the number of lanes, electronic device, storage medium and program product
By determining the number of lanes in the target picture, the problem of high dependence on cross-section lines in the prior art has been solved, and higher accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411807390.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art has a high dependence on cross-sections when determining the number of lanes, resulting in inaccurate number of lanes.
By obtaining the pixel points set of road elements in the target picture, the pixel points set of lane lines and the pixel points set of lane planes are determined to determine the number of lanes included in the target picture.
Reliable on cross-sections is reduced, accuracy of lane count and algorithm robustness is improved.
Smart Images

Figure CN119762501A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a method for determining the number of lanes, an electronic device, a storage medium, and a program product. Background Art
[0002] Technologies such as autonomous driving or high-precision map navigation are inseparable from the accurate determination of the number of lanes.
[0003] In related technologies, the number of lanes is mostly determined based on the number of intersections between lane lines and cross-section lines. However, this method is highly dependent on cross-section lines. If the number of intersections between lane lines and cross-section lines is inaccurate, the number of lanes will be inaccurate. Summary of the invention
[0004] The embodiments of the present application provide a method for determining the number of lanes, an electronic device, a storage medium, and a program product, which reduce the dependence on the cross-section line while ensuring the accuracy of the number of lanes.
[0005] In a first aspect, an embodiment of the present application provides a method for determining the number of lanes, including:
[0006] Obtaining a pixel point set of a road element in a target image; wherein the pixel point set of the road element includes a pixel point set of a lane line and a pixel point set of a lane surface;
[0007] Determining a connected area of the lane surface according to a set of pixel points of the lane surface and a set of pixel points of the lane line;
[0008] The number of lanes included in the target image is determined according to the connected area of the lane surface.
[0009] In a possible implementation, determining the connected area of the lane surface according to the pixel point set of the lane surface and the pixel point set of the lane line includes:
[0010] Determining, based on the pixel point set of the lane surface, an initial connected area of the lane surface composed of the pixel point set of the lane surface;
[0011] Determining a curve equation of the lane line according to a set of pixel points of the lane line;
[0012] According to the curve equation of the lane line, the initial connected area of the lane surface is segmented to obtain the connected area of the lane surface.
[0013] In a possible implementation, segmenting the initial connected area of the lane surface according to the curve equation of the lane line to obtain the connected area of the lane surface includes:
[0014] Determine the intersection of the initial connected area of the lane surface and the curve equation of the lane line;
[0015] According to the pixel points included in the intersection, the initial connected area of the lane surface is segmented to obtain an intermediate connected area of the lane surface; wherein the intermediate connected area of the lane surface uses the pixel points included in the intersection as a boundary;
[0016] The connected area of the lane surface is determined according to the intermediate connected area.
[0017] In a possible implementation manner, the lane line has a lane line category, and determining the connected area of the lane surface according to the intermediate connected area includes:
[0018] According to the category of the lane line, the middle connected area of the lane surface is screened to obtain the connected area of the lane surface.
[0019] In a possible implementation manner, the pixel point set of the road element further includes a pixel point set of a diversion area; and determining the connected area of the lane surface according to the intermediate connected area includes:
[0020] If it is determined based on the pixel point set of the diversion area that the area of the diversion area is greater than or equal to a fifth threshold, the middle connected area of the lane surface is screened based on the position of the diversion area to obtain the connected area of the lane surface.
[0021] In a possible implementation, determining the curve equation of the lane line according to the pixel point set of the lane line includes:
[0022] Determine, based on the pixel point set of the lane line, an initial connected area of the lane line composed of the pixel points of the lane line;
[0023] According to a preset lane line condition, the initial connected area of the lane line is screened to obtain a connected area of the lane line;
[0024] The curve equation of the lane line is obtained by fitting according to the pixel points in the connected area of the lane line.
[0025] In a possible implementation manner, the preset lane line condition includes at least one of the following:
[0026] The area of the initial connected region of the lane line is greater than or equal to a first threshold;
[0027] The slope of the initial connected area of the lane line is greater than or equal to the second threshold and less than or equal to the third threshold;
[0028] The length of the initial connected area of the lane line is greater than or equal to a fourth threshold.
[0029] In a possible implementation, determining the number of lanes included in the target image according to the connected area of the lane surface includes:
[0030] Determine, among the connected regions of the lane surface, the number of connected regions of the lane surface whose areas are greater than or equal to a sixth threshold;
[0031] The number of connected areas of the lane surface is determined as the number of lanes included in the target image.
[0032] In a possible implementation, after obtaining the pixel point set of the road element in the target image, the following steps are included:
[0033] Determine whether the pixel point set of the road element includes the pixel point set of the zebra crossing;
[0034] If not, the step of determining a connected area of the lane surface according to the pixel point set of the lane surface and the pixel point set of the lane line is performed.
[0035] In a possible implementation, obtaining a pixel point set of a road element in a target image includes:
[0036] Get the target image;
[0037] Perform image instance segmentation processing on the target image to obtain a pixel point set of road elements in the target image.
[0038] In a second aspect, an embodiment of the present application provides a device for determining the number of lanes, including:
[0039] An acquisition module, used to acquire a pixel point set of a road element in a target image; wherein the pixel point set of the road element includes a pixel point set of a lane line and a pixel point set of a lane surface;
[0040] A first determining module, configured to determine a connected area of the lane surface according to a pixel point set of the lane surface and a pixel point set of the lane line;
[0041] The second determination module is used to determine the number of lanes included in the target image according to the connected area of the lane surface.
[0042] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0043] The memory stores computer-executable instructions;
[0044] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0047] The method for determining the number of lanes, the electronic device, the storage medium, and the program product provided in the embodiments of the present application, after obtaining the pixel point set of the road elements in the target image, determines the connected area of the lane surface according to the pixel point set of the lane line and the pixel point set of the lane surface, and determines the number of lanes in the target image using the connected area of the lane surface. In this way, the number of lanes is determined using the connected area of the lane surface, and there is no need to set up a cross-section line additionally, which reduces the dependence on the selection of the cross-section line position, and while ensuring the accuracy of the number of lanes, the robustness of the lane number determination algorithm is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] Figure 1 A schematic diagram of an application scenario in the prior art;
[0050] Figure 2 A schematic diagram of an application scenario provided for this application;
[0051] Figure 3 Schematic diagram of the process of determining the number of lanes provided in this application Figure 1 ;
[0052] Figure 4 Schematic diagram of the process of determining the number of lanes provided in this application Figure 2 ;
[0053] Figure 5 is a schematic diagram of another application scenario provided by an embodiment of the present application;
[0054] Figure 6 A schematic diagram of another application scenario provided by an embodiment of the present application;
[0055] Figure 7 Schematic diagram of the process of determining the number of lanes provided in this application Figure 3 ;
[0056] Figure 8 A schematic diagram of the structure of a device for determining the number of lanes provided in this application;
[0057] Fig. 9 A schematic diagram of the structure of the electronic device provided in this application.
[0058] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0059] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0060] First, the terms involved in this application are explained:
[0061] Simply connected region: A region G is called a simply connected region if a simple closed curve is drawn in it and the interior of the closed curve always belongs to G. It should be noted that the meaning of the connected region and the simply connected region in this application are the same and are not distinguished here.
[0062] In the related art, when using a cross-section line to determine the number of lanes, it is necessary to ensure the accuracy of the number of intersections between the cross-section line and the lane line. However, the accuracy of the number of intersections between the cross-section line and the lane line depends on the position of the cross-section line. Different positions of the cross-section line result in different final numbers of lanes. Figure 1 As shown, Figure 1 This is a schematic diagram of an application scenario in the prior art. If there is a missing lane line at the position where the cross-section line 1 passes, the number of intersection points between the cross-section line and the lane line is determined to be 3, but the number of intersection points between the cross-section line 2 and the lane line is 4, which ultimately leads to a different number of determined lanes, or the number of lanes is inaccurate.
[0063] In the above method, there is a high reliance on the cross-section line, and a reliable algorithm needs to be provided to ensure the correct selection of the cross-section line, thereby ensuring the accuracy of the number of lanes.
[0064] In view of this, the present application provides a method for determining the number of lanes, which uses the lane area where the vehicle can travel normally to determine the number of lanes, without using cross-sections, reducing the dependence on the selection of cross-section position, while ensuring the accuracy of the number of lanes, and improving the robustness of the algorithm for determining the number of lanes.
[0065] Figure 2 A schematic diagram of an application scenario provided by this application. Figure 2 As shown, the area encircled by the envelope can be regarded as the lane surface, that is, the lane area. The number of lanes can be determined by determining the number of lane surfaces without relying on the cross-section, thereby ensuring the accuracy of the lane number.
[0066] The execution entity of this application can be a server in the cloud, or it can be an electronic device with processing capabilities located on the vehicle side. The electronic device can be, for example, a domain controller, an electronic control unit (Electronic Control Unit, ECU) or a microcontroller unit (Microcontroller Unit, MCU), etc. This application does not limit this, and it is specifically related to the performance of the electronic device.
[0067] Taking a server as an example, the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0068] Figure 3 Schematic diagram of the process of determining the number of lanes provided in this application Figure 1 ,like Figure 3 As shown, the method includes:
[0069] S201: Obtain a pixel point set of road elements in a target image.
[0070] For example, the target image represents the image to be processed, and the target image includes lane lines and lane surfaces. The road elements represent elements in the road, and the road elements may include lane lines and lane surfaces; wherein the lane surface represents the area where the lane is located, for example, Figure 2 The area enclosed by the envelope shown. The road element may also include other elements such as zebra crossings, diversion areas, curbstones, etc. This application does not limit the content of the road element.
[0071] The above-mentioned acquisition of the pixel point set of the road element in the target image means acquiring the position of the road element included in the target image, and the pixel point set includes the pixel point coordinates of the road element. Taking the target image including lane lines and lane surfaces as an example, through this step, the pixel point set of the lane lines in the target image and the pixel point set of the lane surface can be acquired.
[0072] It should be noted that the lane line pixel set mentioned here is a general concept and does not limit the number of lane lines included in the target image. For example, Figure 2 As shown, the target image includes 4 lane lines, so the pixel point sets of the 4 lane lines in the target image can be obtained, that is, the pixel point set of lane line 1, the pixel point set of lane line 2, the pixel point set of lane line 3, and the pixel point set of lane line 4. In addition, for the lane lines, the specific categories of the lane lines can also be obtained, such as long white solid lines, yellow solid lines, etc. The principle of the pixel point set of the lane surface is similar to that of the lane surface, which will not be repeated here.
[0073] In one example, the server can receive a target image collected by a vehicle-side collection device, input the target image into a preset image instance segmentation model, and output a pixel point set of road elements in the target image. It should be noted that the present application does not limit the type of image instance segmentation model. The server can also directly receive a pixel point set of road elements in a target image sent by other electronic devices, or receive a pixel point set of road elements in a target image imported by an external device, such as a USB flash drive.
[0074] It should be noted that when the execution subject is an electronic device on the vehicle side, the electronic device on the vehicle side can obtain the target image collected by the collection device on the vehicle, and input the target image into the preset image instance segmentation model, and output the pixel point set of the road element in the target image. The collection device can be, for example, a driving recorder, a camera, a camera, etc., and this application does not limit it here.
[0075] S202: Determine a connected area of the lane surface according to a set of pixel points of the lane surface and a set of pixel points of the lane line.
[0076] Exemplarily, the connected area of the lane surface represents the lane area where the vehicle can travel normally, such as the area of the motor vehicle lane. As mentioned above, the server can obtain the pixel point set of the road elements in the target image, that is, the coordinates of the pixel points of the lane surface and the pixel points of the lane line in the target image can be obtained, and the coordinates of the pixel points of the lane surface can represent the area where the lane surface is located in the target image, and the coordinates of the pixel points of the lane line can represent the area where the lane line is located in the target image; and because the two lane surfaces should be divided by the lane line, the connected area of the lane surface can be jointly determined by the area where the lane line is located and the area where the lane surface is located, that is, the connected area of the lane surface can be jointly determined by the pixel point set of the lane line and the pixel point set of the lane surface.
[0077] In some possible implementations, the server may perform mask processing on the target image, and then, based on the pixel point set of the lane surface and the pixel point set of the lane line, in the target image after mask processing, the area where the lane surface is located and the area where the lane line is located may be displayed with different pixel values respectively. Then, the server may segment the area where the lane surface is located according to the area where the lane line is located. For example, the area where the lane line is located may be extended to segment the area where the lane surface is located, and thus a connected area of the lane surface may be obtained.
[0078] S203: Determine the number of lanes included in the target image according to the connected area of the lane surface.
[0079] Exemplarily, the above-mentioned number of lanes represents the number of lanes on which vehicles can travel normally, such as the number of motor vehicle lanes, including which types of lanes can be set according to actual needs, which is not limited in this application.
[0080] In some possible implementations, as mentioned above, the connected area of the lane surface represents the lane area where the vehicle can travel normally. Therefore, the server can directly determine the number of connected areas of the lane surface as the number of lanes in the target image.
[0081] In some possible implementations, in the connected areas of the lane surface, the server may first determine the number of connected areas of the lane surface whose area is greater than or equal to the sixth threshold; and determine the number of connected areas of the lane surface as the number of lanes included in the target image. In this way, the server can use the area threshold to filter out the connected areas of the lane surface that are misidentified, to ensure the accuracy of the number of connected areas of the lane surface, and further to ensure the accuracy of the number of lanes. It should be noted that the sixth threshold above represents a real number greater than 0, and this application does not limit the value of the sixth threshold, which can be set according to actual needs.
[0082] The method for determining the number of lanes provided in the embodiment of the present application, after obtaining the pixel point set of the road elements in the target image, determines the connected area of the lane surface according to the pixel point set of the lane line and the pixel point set of the lane surface, and determines the number of lanes in the target image using the connected area of the lane surface. In this way, the number of lanes is determined using the connected area of the lane surface, without the need to set an additional cross-section line, reducing the dependence on the selection of the cross-section line position, and improving the robustness of the lane number determination algorithm while ensuring the accuracy of the lane number.
[0083] Figure 4 Schematic diagram of the process of determining the number of lanes provided in this application Figure 2 ,like Figure 4 As shown, in this embodiment Figure 3 Based on the embodiment, a method for determining the number of lanes is described in detail, and the method includes:
[0084] S301, obtaining a target image.
[0085] For example, the server receives a target image sent by the vehicle.
[0086] S302: Perform image instance segmentation processing on the target image to obtain a pixel point set of road elements in the target image.
[0087] For example, the server inputs the target image into a preset image instance segmentation model and outputs a set of pixel points of road elements in the target image. The image instance segmentation model can be, for example, a You Only LookOnce for Panoptic Driving Perception (YOLOP) model or a Mask Region-based Convolutional Neural Network (Mask-RCNN). This application does not limit the type of the image instance segmentation model.
[0088] S303: Determine whether the pixel point set of the road element includes the pixel point set of the zebra crossing.
[0089] Exemplarily, the target image may include multiple road elements. After obtaining the pixel point set of the road elements, the server may first determine whether the pixel point set of the road elements of the target image includes the pixel point set of the zebra crossing to determine whether the shooting scene of the target image is an intersection scene. If so, it means that the scene of the target image is an intersection, and the number of lanes included in the target image is determined to be 0; if not, it means that the scene of the target image is not an intersection, and the step of determining the connected area of the lane surface according to the pixel point set of the lane surface and the pixel point set of the lane line is performed, that is, step S304 is performed.
[0090] S304: Determine, based on the pixel point set of the lane surface, an initial connected area of the lane surface formed by the pixel point set of the lane surface.
[0091] Exemplarily, the initial connected area of the lane surface represents an area composed of pixel points of the lane surface. The initial connected area of the lane surface represents that within an area, a closed curve is drawn at random, and all pixel points included in the closed curve are pixel points of the lane surface. In other words, all pixel points in the initial connected area of the lane surface are pixel points of the lane surface, and do not include pixel points of other road elements.
[0092] For example, the server may perform mask processing on the target image according to the set of lane surface pixels to obtain a first mask image, which only displays the pixel values of the lane surface pixels, and the area surrounded by the lane surface pixels is the initial connected area of the lane surface. Figure 5 As shown, Figure 5 It is a schematic diagram of another application scenario provided by an embodiment of the present application. Figure 5 exist Figure 1 In this scenario, due to the lack of lane lines, the initial connected area of a lane surface can be expressed as Figure 5 The area circled by envelope 1 is shown.
[0093] S305: Determine a curve equation of the lane line according to the pixel point set of the lane line.
[0094] Exemplarily, the curve equation of the lane line is used to simulate the posture of the lane line. It should be noted that the present application does not limit the specific form of the curve equation of the lane line, which is related to the shape and direction of the lane line.
[0095] In some possible implementations, the server may perform mask processing on the target image according to the pixel point set of the lane line to obtain a second mask image, which only displays the pixel values of the pixel points of the lane line, and fit the pixel points of the lane line based on the second mask image to obtain the curve equation of the lane line. It should be noted that this application does not limit the fitting method.
[0096] In some possible implementations, the server may first determine an initial connected area of the lane line composed of pixel points of the lane line based on a set of pixel points of the lane line; then screen the initial connected area of the lane line according to preset lane line conditions to obtain a connected area of the lane line; finally, based on the pixel points in the connected area of the lane line, fit the curve equation of the lane line.
[0097] Exemplarily, the initial connected area of the lane line refers to an area composed of pixel points of the lane line. The connected area of the lane line refers to an area after the initial connected area of the lane line is screened.
[0098] In this way, the server can screen and process the initial connected area of the lane line according to the preset lane line conditions to prevent misidentification of the lane line, ensure the accuracy of lane line identification, and obtain the accurate curve equation of the lane line.
[0099] Optionally, the preset lane line condition may include at least one of the following:
[0100] (1) The area of the initial connected region of the lane line is greater than or equal to the first threshold;
[0101] For example, the server may use an area function to directly determine the area of the initial connected region of the lane line, and further determine the relationship between the area of the initial connected region of the lane line and the first threshold.
[0102] (2) The slope of the initial connected area of the lane line is greater than or equal to the second threshold and less than or equal to the third threshold;
[0103] For example, the server can perform fitting processing on the pixel points within the initial connected area of the lane line to obtain the curve equation corresponding to the initial connected area of the lane line to determine the slope of the initial connected area of the lane line, and then determine whether the slope of the initial connected area of the lane line falls within the range of [second threshold, third threshold].
[0104] (3) The length of the initial connected area of the lane line is greater than or equal to the fourth threshold.
[0105] For example, the server can use the absolute value of the difference between the maximum y value and the minimum y value in the initial connected coordinate values of the lane line as the length of the initial connected area of the lane line, and then determine the relationship between the length of the initial connected area of the lane line and the fourth threshold.
[0106] It should be noted that the above-mentioned first threshold and fourth threshold are real numbers greater than 0, the second threshold and the third threshold are real numbers, and this application does not limit the specific values of each threshold.
[0107] S306 . Segment the initial connected area of the lane surface according to the curve equation of the lane line to obtain a connected area of the lane surface.
[0108] For example, reference Figure 5 The initial connected area of the lane surface shown may have a situation where the lane surface is stuck due to the lack of lane lines or being blocked (envelope 1). Therefore, the initial connected area of the lane surface can be segmented according to the curve equation of the lane line to obtain the connected area of the lane surface. For example, the server can perform segmentation according to the intersection of the curve equation of the lane line and the initial connected area of the lane surface, where the pixel points in the intersection represent the pixel points of the lane line. The pixel points in the intersection are used as the boundary, and the initial connected area of the lane surface can be segmented to obtain the connected area of the lane surface.
[0109] In some possible implementations, the server may determine the intersection of the initial connected area of the lane surface and the curve equation of the lane line; segment the initial connected area of the lane surface according to the pixel points included in the intersection to obtain the intermediate connected area of the lane surface; and determine the connected area of the lane surface according to the intermediate connected area. The intermediate connected area of the lane surface uses the pixel points included in the intersection as the boundary.
[0110] In some possible implementations, after determining the initial connected area of the lane surface based on the first mask image, the server may draw a curve a of the curve equation of the lane line on the first mask image, and extend the curve a to a preset length using a preset extension function, referring to Figure 5 As shown, the extended curve a passes through the initial connected area (envelope 1) of the lane surface. The initial connected area of the lane surface is segmented with the extended curve a as the boundary to obtain the intermediate connected area of the lane surface; based on the intermediate connected area, the connected area of the lane surface is determined.
[0111] After obtaining the middle connected area of the lane surface in the above manner, in a possible implementation, the middle connected area of the lane surface is screened and processed according to the category of the lane line to obtain the connected area of the lane surface. Exemplarily, as mentioned above, the type of lane can be screened according to the category of the lane line. For example, if the server determines that a lane line with a long white solid line indicates that the lane to the right of the lane line with the long white solid line is a non-motorized vehicle lane, the middle connected area of the lane surface to the right of the lane line with the long white solid line is deleted; if the server determines that a lane line with a yellow solid line indicates that the left side of the lane line with the yellow solid line is an opposite lane, the middle connected area of the lane surface to the left side of the lane line with the yellow solid line is deleted. In this way, the middle connected area of the lane surface is screened and processed using the category of the lane line to obtain the connected area of the lane surface where the vehicle can travel normally, thereby improving the accuracy of the connected area of the lane surface.
[0112] In another possible implementation, if the server determines that the area of the diversion area is greater than or equal to the fifth threshold value based on the pixel point set of the diversion area, the middle connected area of the lane surface is screened according to the position of the diversion area to obtain the connected area of the lane surface. Exemplarily, the above-mentioned road element may also include a diversion area, and the server may first determine the area of the diversion area based on the pixel point set of the diversion area, and screen the diversion area based on the area of the diversion area to filter out the misidentified diversion area, and then use the diversion area to screen the middle connected area of the lane surface.
[0113] It should be understood that when there is a diversion area, it means that there may be a fork in the road. Figure 6 As shown, Figure 6 This is a schematic diagram of another application scenario provided by an embodiment of the present application. In this scenario, the server can determine the two sides of the diversion area as the vehicle driving side and the non-driving side for collecting target images according to the driving direction of the vehicle. Figure 6 In the position shown, the left side of the diversion area is the non-driving side, and the right side of the diversion area is the vehicle driving side of the target image. At this time, the server can delete the middle connected area of the lane surface on the non-driving side according to the position of the diversion area, that is, Figure 6 The middle connected area of the lane surface shown in the middle envelope 4 is used to obtain the connected area of the lane surface where the vehicle collecting the target image can travel normally, that is, Figure 2 The connected area of the lane surface shown in the middle envelope 2 and 3. In this way, the middle connected area of the lane surface is screened by using the position of the diversion area to obtain the connected area of the lane surface where the vehicle can travel normally, thereby improving the accuracy of the connected area of the lane surface.
[0114] It should be noted that the present application does not limit the screening conditions for the middle connected area of the lane surface. The screening may be performed by the type of lane line, the position of the diversion area, or the type of lane line and the position of the diversion area. Other screening conditions may also be used, such as traffic identifiers on the road, such as right turn, straight go, left turn and other traffic identifiers. The principle is similar to the aforementioned screening conditions, and the present application will not give examples one by one here.
[0115] S307: Determine the number of lanes included in the target image according to the connected area of the lane surface.
[0116] For example, the server may display a plurality of connected areas of lane surfaces on the first mask image through the above steps, count the number of connected areas of lane surfaces on the first mask image, and obtain the number of lanes included in the target image.
[0117] The method for determining the number of lanes provided in the embodiment of the present application determines the non-intersection scene of the target image by using whether there is a zebra crossing in the road element, and then obtains the curve equation of the lane line according to the pixel point set of the lane line, and then uses the curve equation of the lane line to segment the initial connected area of the lane surface composed of the pixel point set of the lane surface, and obtains the connected area of the lane surface, and then determines the number of lanes included in the target image according to the connected area of the lane surface. In this way, the number of lanes is determined by using the connected area of the lane surface, and there is no need to set up a cross-section line additionally, which reduces the dependence on the selection of the cross-section line position, and the curve equation of the lane line can be used to segment the initial connected area of the lane surface, thereby preventing the inaccurate recognition of the connected area of the lane surface due to the occlusion or missing of the lane line, improving the accuracy of the connected area of the lane surface, and then improving the accuracy of the number of lanes.
[0118] Figure 7 Schematic diagram of the process of determining the number of lanes provided in this application Figure 3 ,like Figure 7 As shown, in this embodiment Figure 4 Based on the embodiment, a method for determining the number of lanes is described in detail, and the method includes:
[0119] S401, obtaining a target image.
[0120] It should be noted that this step is similar to the aforementioned step S301 and will not be repeated here.
[0121] S402: Perform image instance segmentation processing on the target image to obtain a pixel point set of road elements in the target image.
[0122] It should be noted that this step is similar to the aforementioned step S302 and will not be repeated here.
[0123] S403: Determine whether the pixel point set of the road element includes the pixel point set of the zebra crossing.
[0124] It should be noted that this step is similar to the aforementioned step S303 and will not be repeated here.
[0125] S404: Determine, based on the pixel point set of the lane surface, an initial connected area of the lane surface composed of the pixel point set of the lane surface.
[0126] It should be noted that this step is similar to the aforementioned step S304 and will not be repeated here.
[0127] S405: Determine a curve equation of the lane line according to the pixel point set of the lane line.
[0128] It should be noted that this step is similar to the aforementioned step S305 and will not be repeated here.
[0129] S406: Determine the intersection of the initial connected area of the lane surface and the curve equation of the lane line.
[0130] For example, the server may traverse the pixel points of the initial connected area of the lane surface, and if it is determined that the pixel points of the initial connected area of the lane surface are located on the curve represented by the curve equation of the lane line, the pixel points are added to the intersection.
[0131] S407 . Segment the initial connected area of the lane surface according to the pixel points included in the intersection to obtain an intermediate connected area of the lane surface.
[0132] For example, the pixel points included in the intersection are used as boundaries to segment the initial connected area of the lane surface to obtain the intermediate connected area of the lane surface.
[0133] S408. Screening the middle connected area of the lane surface according to the type of the lane line to obtain a screened connected area of the lane surface.
[0134] It should be noted that this step can refer to the description in the aforementioned step S305 and will not be repeated here.
[0135] S409: If it is determined based on the pixel point set of the diversion area that the area of the diversion area is greater than or equal to the fifth threshold, the connected area of the filtered lane surface is filtered according to the position of the diversion area to obtain the connected area of the lane surface.
[0136] It should be noted that this step can refer to the description in the aforementioned step S305 and will not be repeated here.
[0137] Through steps S408 and S409, the middle connected area of the lane surface can be screened twice to ensure the accuracy of the connected area of the lane surface. It should be noted that this application is only used as an example to illustrate the screening based on the type of lane line first, and it can also be screened based on the position of the diversion area first, which is not limited in this application.
[0138] S410: Determine, among the connected regions of the lane surface, the number of connected regions of the lane surface whose areas are greater than or equal to a sixth threshold.
[0139] It should be noted that this step can refer to the description in the aforementioned step S203 and will not be repeated here.
[0140] S411. Determine the number of connected areas of the lane surface as the number of lanes included in the target image.
[0141] It should be noted that this step can refer to the description in the aforementioned step S203 and will not be repeated here.
[0142] The method for determining the number of lanes provided in the embodiment of the present application determines the non-intersection scene of the target image by using whether there is a zebra crossing in the road element, obtains the curve equation of the lane line according to the pixel point set of the lane line, and then uses the curve equation of the lane line to segment the initial connected area of the lane surface composed of the pixel point set of the lane surface to obtain the middle connected area of the lane surface, and then screens the middle connected area of the lane surface according to screening conditions such as the type of lane line and the position of the diversion area to obtain the connected area of the lane surface, and finally screens again according to the area of the connected area of the lane surface to obtain the final connected area of the lane surface, and then obtains the number of lanes. In this way, the number of lanes is determined by using the connected area of the lane surface, without the need to set an additional cross-section line, which reduces the dependence on the selection of the cross-section line position, and at the same time, the middle connected area of the lane surface is screened by the screening conditions, thereby improving the accuracy of the connected area of the lane surface, and then improving the accuracy of the number of lanes.
[0143] Figure 8 A schematic diagram of the structure of the device for determining the number of lanes provided in this application, such as Figure 8 As shown, the lane number determination device 500 provided in this embodiment includes:
[0144] The acquisition module 501 is used to acquire a pixel point set of a road element in a target image; wherein the pixel point set of the road element includes a pixel point set of a lane line and a pixel point set of a lane surface;
[0145] A first determining module 502, configured to determine a connected area of the lane surface according to a pixel point set of the lane surface and a pixel point set of the lane line;
[0146] The second determination module 503 is used to determine the number of lanes included in the target image according to the connected area of the lane surface.
[0147] In a possible implementation manner, the first determining module 502 is specifically configured to:
[0148] Determining, based on the pixel point set of the lane surface, an initial connected area of the lane surface composed of the pixel point set of the lane surface;
[0149] Determining a curve equation of the lane line according to a set of pixel points of the lane line;
[0150] According to the curve equation of the lane line, the initial connected area of the lane surface is segmented to obtain the connected area of the lane surface.
[0151] In a possible implementation manner, the first determining module 502 is specifically configured to:
[0152] Determine the intersection of the initial connected area of the lane surface and the curve equation of the lane line;
[0153] According to the pixel points included in the intersection, the initial connected area of the lane surface is segmented to obtain an intermediate connected area of the lane surface; wherein the intermediate connected area of the lane surface uses the pixel points included in the intersection as a boundary;
[0154] The connected area of the lane surface is determined according to the intermediate connected area.
[0155] In a possible implementation manner, the lane line has a lane line category, and the first determination module 502 is specifically configured to:
[0156] According to the category of the lane line, the middle connected area of the lane surface is screened to obtain the connected area of the lane surface.
[0157] In a possible implementation manner, the pixel point set of the road element further includes a pixel point set of a diversion area; the first determination module 502 is specifically configured to:
[0158] If it is determined based on the pixel point set of the diversion area that the area of the diversion area is greater than or equal to a fifth threshold, the middle connected area of the lane surface is screened based on the position of the diversion area to obtain the connected area of the lane surface.
[0159] In a possible implementation manner, the first determining module 502 is specifically configured to:
[0160] Determine, based on the pixel point set of the lane line, an initial connected area of the lane line composed of the pixel points of the lane line;
[0161] According to a preset lane line condition, the initial connected area of the lane line is screened to obtain a connected area of the lane line;
[0162] The curve equation of the lane line is obtained by fitting according to the pixel points in the connected area of the lane line.
[0163] In a possible implementation manner, the preset lane line condition includes at least one of the following:
[0164] The area of the initial connected region of the lane line is greater than or equal to a first threshold;
[0165] The slope of the initial connected area of the lane line is greater than or equal to the second threshold and less than or equal to the third threshold;
[0166] The length of the initial connected area of the lane line is greater than or equal to a fourth threshold.
[0167] In a possible implementation manner, the second determining module 503 is specifically configured to:
[0168] Determine, among the connected regions of the lane surface, the number of connected regions of the lane surface whose areas are greater than or equal to a sixth threshold;
[0169] The number of connected areas of the lane surface is determined as the number of lanes included in the target image.
[0170] In a possible implementation, after the acquisition module 501 acquires the pixel point set of the road element in the target image, the third determination module is used to:
[0171] Determine whether the pixel point set of the road element includes the pixel point set of the zebra crossing;
[0172] If not, the step of determining a connected area of the lane surface according to the pixel point set of the lane surface and the pixel point set of the lane line is performed.
[0173] In a possible implementation, the acquisition module 501 is specifically configured to:
[0174] Get the target image;
[0175] Perform image instance segmentation processing on the target image to obtain a pixel point set of road elements in the target image.
[0176] The device for determining the number of lanes provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be described in detail here.
[0177] Fig. 9 This is a schematic diagram of the structure of the electronic device provided in this application. Fig. 9 As shown, the electronic device 600 provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the device 600 also includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus 604. The electronic device can be the aforementioned server or a vehicle-side ECU, MCU or domain controller.
[0178] In a specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the above method.
[0179] The specific implementation process of the processor 601 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0180] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0181] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0182] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0183] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0184] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0185] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0186] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0187] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0188] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0189] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0190] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0191] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0192] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for determining the number of lanes, characterized in that: include: Obtaining a pixel point set of a road element in a target image; wherein the pixel point set of the road element includes a pixel point set of a lane line and a pixel point set of a lane surface; Determining a connected area of the lane surface according to a set of pixel points of the lane surface and a set of pixel points of the lane line; The number of lanes included in the target image is determined according to the connected area of the lane surface.
2. The method according to claim 1, characterized in that The determining, according to the pixel point set of the lane surface and the pixel point set of the lane line, a connected area of the lane surface comprises: Determining, based on the pixel point set of the lane surface, an initial connected area of the lane surface composed of the pixel point set of the lane surface; Determining a curve equation of the lane line according to a set of pixel points of the lane line; According to the curve equation of the lane line, the initial connected area of the lane surface is segmented to obtain the connected area of the lane surface.
3. The method according to claim 2, characterized in that The segmenting process of the initial connected area of the lane surface according to the curve equation of the lane line to obtain the connected area of the lane surface includes: Determine the intersection of the initial connected area of the lane surface and the curve equation of the lane line; According to the pixel points included in the intersection, the initial connected area of the lane surface is segmented to obtain an intermediate connected area of the lane surface; wherein the intermediate connected area of the lane surface uses the pixel points included in the intersection as a boundary; The connected area of the lane surface is determined according to the intermediate connected area.
4. The method according to claim 3, characterized in that The lane line has a lane line category, and determining the connected area of the lane surface according to the intermediate connected area includes: According to the category of the lane line, the middle connected area of the lane surface is screened to obtain the connected area of the lane surface.
5. The method according to claim 3, characterized in that: The pixel point set of the road element also includes a pixel point set of the diversion area; and determining the connected area of the lane surface according to the intermediate connected area includes: If it is determined based on the pixel point set of the diversion area that the area of the diversion area is greater than or equal to a fifth threshold, the middle connected area of the lane surface is screened based on the position of the diversion area to obtain the connected area of the lane surface.
6. The method according to claim 2, characterized in that The determining, according to the pixel point set of the lane line, a curve equation of the lane line comprises: Determine, based on the pixel point set of the lane line, an initial connected area of the lane line composed of the pixel points of the lane line; According to a preset lane line condition, the initial connected area of the lane line is screened to obtain a connected area of the lane line; The curve equation of the lane line is obtained by fitting according to the pixel points in the connected area of the lane line.
7. The method according to claim 6, characterized in that The preset lane line condition includes at least one of the following: The area of the initial connected region of the lane line is greater than or equal to a first threshold; The slope of the initial connected area of the lane line is greater than or equal to the second threshold and less than or equal to the third threshold; The length of the initial connected area of the lane line is greater than or equal to a fourth threshold.
8. The method according to any one of claims 1 to 7, characterized in that: The determining the number of lanes included in the target image according to the connected area of the lane surface includes: Determine, among the connected regions of the lane surface, the number of connected regions of the lane surface whose areas are greater than or equal to a sixth threshold; The number of connected areas of the lane surface is determined as the number of lanes included in the target image.
9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.
10. A computer-readable storage medium / computer program product, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor; and / or, The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.