Road line detection method and device, electronic equipment and storage medium
Through deep neural network models and visual mapping technology, road line detection is projected into a unified coordinate system, solving the problem of poor detection effect in sensitive environmental changes and complex scenarios in existing technologies, achieving high-precision and stable road line detection, and supporting accurate control of autonomous vehicles.
Patent Information
- Application Number
- CN202410501445.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2025-10-24
AI Technical Summary
Existing road line detection methods are sensitive to environmental changes and perform poorly in complex scenarios, making it difficult to achieve accurate, fast, and reliable road line detection.
A pre-trained deep neural network model is used to detect and identify road images, and the road lines are projected into a unified coordinate system through visual mapping technology. The position and shape information of the road lines are obtained in combination with image processing technology.
The accuracy and stability of road line detection are improved, and it can quickly and reliably detect road lines in complex environments, facilitating control decisions for autonomous vehicles.
Smart Images

Figure CN120833583A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automatic driving, in particular to a road line detection method and device, electronic equipment and storage medium. BACKGROUND
[0002] Automatic driving is a kind of transportation technology that has attracted much attention in recent years. It can make vehicles drive safely and reliably on the road and reach the predetermined location by sensing the road environment through the vehicle-mounted sensing system and controlling the steering and speed of the vehicle according to the road, vehicle position and obstacle information obtained by sensing. This means that the automatic driving vehicle can automatically perform acceleration, braking, steering and traffic rule following tasks without human intervention, which means that the automatic driving vehicle needs to obtain the surrounding environment in time and accurately through the visual perception system. In the visual perception system, road line detection is an important function module, which usually needs to detect lane lines from the road image around the vehicle and then guide the driving vehicle. The existing road line detection method mainly relies on Hough transform, sliding window search and other technologies, but these methods are sensitive to environmental changes and have poor effect in some complex scenes. Therefore, how to make the automatic driving vehicle accurately, quickly and reliably detect road lines is a problem that needs to be solved. SUMMARY
[0003] Therefore, the present application provides a road line detection method, device, electronic equipment and storage medium to solve the problem that the existing technology cannot accurately, quickly and reliably detect road lines.
[0004] In a first aspect, the embodiments of the present application provide a road line detection method, which comprises:
[0005] obtaining a road image;
[0006] detecting and identifying the road line in the road image to obtain a first road line;
[0007] projecting the first road line based on a unified coordinate system to obtain a second road line;
[0008] outputting the position information and shape information of the second road line.
[0009] In a possible implementation, the detecting and identifying the road line in the road image to obtain a first road line comprises:
[0010] detecting and identifying the road line in the road image based on a pre-trained road line detection and identification model to obtain a first road line.
[0011] In a possible implementation, the coordinate projection on the first road line based on the unified coordinate system comprises:
[0012] The line key points of the first road line are extracted, the line key points comprising line end points and line inflection points;
[0013] The source point and the target point are set based on the line key points, the source point being the original coordinates of the line key points, and the target point being the projection coordinates of the source point in the unified coordinate system;
[0014] The first road line is projected on the coordinates based on the source point and the target point, to obtain a second road line.
[0015] In a possible implementation, the coordinate projection on the first road line based on the source point and the target point comprises:
[0016] A transformation matrix is generated based on the source point and the target point;
[0017] The first road line is projected on the coordinates based on the transformation matrix, to obtain a second road line.
[0018] In a possible implementation, the output of the position information and the shape information of the second road line comprises:
[0019] A vertical edge image is generated, the vertical edge image comprising all vertical edges of an image in which the second road line is located;
[0020] The vertical edge image is divided into a plurality of horizontal regions;
[0021] The target vertical edge of each horizontal region is determined;
[0022] The position information and the shape information of the second road line are output based on the target vertical edge.
[0023] In a possible implementation, the determination of the target vertical edge of each horizontal region comprises:
[0024] The vertical edges included in each horizontal region are divided into a plurality of columns;
[0025] Pixel value summation processing is performed on each column;
[0026] The column with the maximum pixel value is determined as the target vertical edge.
[0027] In a possible implementation, the method further comprises:
[0028] output a vehicle driving control decision based on the position information and the shape information of the second road line.
[0029] In a second aspect, an embodiment of the present application provides a road line detection device, comprising:
[0030] a obtaining unit, configured to obtain a road image;
[0031] a detection and recognition unit, configured to detect and recognize a road line in the road image to obtain a first road line;
[0032] a projection unit, configured to perform coordinate projection on the first road line based on a unified coordinate system to obtain a second road line;
[0033] an output unit, configured to output position information and shape information of the second road line.
[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method in any one of the first aspect.
[0035] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, comprising stored program, wherein when the program runs, the device where the computer readable storage medium is located is controlled to execute the method in any one of the first aspect.
[0036] Compared with the prior art, the embodiment of the present application can quickly detect road lines from complex environment images, and the detection result is more accurate and stable. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0038] Figure 1 An application scenario schematic diagram is provided for the embodiments of the present application;
[0039] Figure 2 A flowchart of a road line detection method is provided for the embodiments of the present application;
[0040] Figure 3 An image data saving flowchart is provided for the embodiments of the present application;
[0041] Figure 4A road line detection and recognition model provided in an embodiment of the present application;
[0042] Figure 5 A coordinate projection transformation flowchart provided in an embodiment of the present application;
[0043] Figure 6 A coordinate projection transformation schematic diagram provided in an embodiment of the present application;
[0044] Figure 7 A flowchart of acquiring road line position information and shape information provided in an embodiment of the present application;
[0045] Figure 8 Another application scenario schematic diagram provided in an embodiment of the present application;
[0046] Figure 9 A vehicle driving control decision flowchart provided in an embodiment of the present application;
[0047] Figure 10 A structural schematic diagram of a road line detection device provided in an embodiment of the present application;
[0048] Figure 11 A structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to better understand the technical solutions of the present application, the embodiments of the present application will be described in detail below with reference to the drawings.
[0050] It should be clear that the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0051] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to limit the present application. The singular forms "a", "an" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0052] It should be understood that the term "and / or" used herein is only to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a "or" relationship.
[0053] Referring to Figure 1 An application scenario schematic diagram provided in an embodiment of the present application. InFigure 1 An autonomous vehicle 110 and a road line 120 are shown in the figure, the autonomous vehicle 110 comprises a visual perception system, a data processing system and a control system, wherein the visual perception system is used to obtain road line 120 information, the data processing system is used to process the road line 120 information through image processing and computer vision algorithm to identify and understand the road situation, and make driving decisions according to the road situation, and the control system is used to control the acceleration, braking, steering and other actions of the autonomous vehicle 110 according to the driving decisions.
[0054] It should be noted that, Figure 1 is only an exemplary description and should not be considered as a limitation of the protection scope of the present application. For example, the autonomous vehicle 110 includes but is not limited to a car, a high-speed train, a motorcycle, an agricultural vehicle or some vehicles for special industries, etc.; the road line 120 includes but is not limited to a lane line, a road boundary line, etc.
[0055] Autonomous driving is a kind of transportation technology that has attracted much attention in recent years. It can make the vehicle drive safely and reliably on the road and reach the predetermined location by sensing the road environment through the vehicle-mounted sensing system and controlling the steering and speed of the vehicle according to the road, vehicle position and obstacle information obtained by sensing. This means that the autonomous vehicle can automatically perform acceleration, braking, steering and traffic rule following tasks without human intervention, which means that the autonomous vehicle needs to obtain the surrounding environment in time and accurately through the visual perception system. In the visual perception system, road line detection is an important functional module, which usually needs to detect the lane line from the road image around the vehicle to guide the driving vehicle. The existing road line detection method mainly relies on Hough transform, sliding window search and other technologies, but these methods are sensitive to environmental changes and have poor effect in some complex scenes. Therefore, how to make the autonomous vehicle accurately, quickly and reliably detect the road line is a problem that needs to be solved
[0056] To solve the above problems, the embodiment of the present application provides a road line detection method, which identifies the road line of the photographed road image through a pre-trained deep neural network model, and projects the identified road line to a unified coordinate system by using visual mapping technology, so as to obtain more accurate and stable road line detection results, and make it more convenient for the control system of the autonomous vehicle to make accurate decisions. The following will be described in combination with specific implementation.
[0057] Referring to Figure 2 , a flowchart of a road line detection method provided by the embodiment of the present application is shown. The method can be applied to Figure 1 , as shown in the figure, the electronic device, such as Figure 2 , mainly includes the following steps.
[0058] S201: acquire a road image.
[0059] An autonomous vehicle generally perceives the surrounding environment by setting various sensors, for example, including a camera, a radar, a lidar and an ultrasonic sensor, etc., each of which functions differently and thus perceives the surrounding environment differently. For example, the camera is used to capture images on the road, helping to identify pedestrians, road signs, road lines or other vehicles, etc. The radar is used to emit radio waves and detect the position and speed of surrounding objects by measuring the reflection of the radio waves. In the embodiments of the present application, since the road line needs to be identified, the acquired road image is obtained by a camera arranged on the autonomous vehicle.
[0060] In a specific implementation, the acquired road image can be saved to provide real data for evaluation and training of the road line detection deep learning model in the following, and can also be used as an input for subsequent control decision of the autonomous vehicle.
[0061] Referring to Figure 3 , a flowchart of an image data saving process provided by the embodiments of the present application is shown. As Figure 3 shown, the flowchart includes: after acquiring the road image by the camera, converting the road image into a digital signal; pre-processing the digital signal, such as cropping, scaling, color space conversion, etc. The specific processing means can be performed according to the needs, and the present application does not make specific requirements thereon; extracting metadata information from the pre-processed image data, such as shooting time, position, device model, etc., and simultaneously performing image compression and encoding processing on the pre-processed image data to reduce the data amount; uploading the metadata and the image data processed by compression and encoding to the cloud for storage, and the data can be directly extracted from the cloud for subsequent use.
[0062] S202: detecting and identifying the road line in the road image to obtain a first road line.
[0063] In the embodiments of the present application, a road line detection and identification model is pre-trained, and when the road image is acquired, the road image is input into the pre-trained road line detection and identification model, and the road line detection and identification model detects and identifies the road line in the road image to obtain the first road line.
[0064] In a possible implementation, the road line detection and identification model is a deep convolutional neural network model (Convol ut iona l Neural Network, CNN), for example, Figure 4As shown, it includes an input layer, a convolutional layer 1, a pooling layer 1, a convolutional layer 2, a pooling layer 2, a 1x1 convolution, a residual connection, a flattening layer, a fully connected layer, and an output layer. In a specific implementation, the input layer inputs the road image data, the convolutional layer 1 extracts features from the road image data, the pooling layer 1 performs spatial down-sampling on the extracted feature data to obtain a first feature map; the first feature map is sequentially subjected to feature extraction by the convolutional layer 2 and spatial down-sampling by the pooling layer 2 to obtain a second feature map; meanwhile, the first feature map is subjected to 1x1 convolution to adjust the number of channels to obtain a third feature map, wherein the number of channels of the third feature map is the same as that of the second feature map; the third feature map and the second feature map are added to form a residual connection; the output of the residual connection is flattened by the flattening layer and then input to the fully connected layer for classification; and the output of the fully connected layer is subjected to a sigmoid activation function to obtain a final result.
[0065] In the embodiment of the present application, the convolutional layer and the pooling layer together constitute a feature extraction part, the existence of the pooling layer not only reduces the data dimension, but also enhances the invariance of the model to small displacement, and the setting of the residual connection can alleviate the training difficulty of the deep convolutional neural network model, so that the deep convolutional neural network model can effectively learn complex image features.
[0066] Compared with the prior art, the CNN model used in the embodiment of the present application can solve the following technical problems:
[0067] 1. Sensitive to environmental changes:
[0068] The use of the CNN model can automatically learn useful features from the original image without the need for manual design and selection of features, which makes the model more robust to environmental changes (such as light and weather). The CNN maps the original image to a high-level feature space through multiple convolutional layers and nonlinear activation functions, and in this space, similar images are mapped to points that are close in distance, thereby improving the model's tolerance to small changes in input data.
[0069] 2. Large demand for computing resources:
[0070] Compared with methods such as sliding window search, the CNN only needs to perform a forward propagation on the image to obtain the features of all positions, greatly reducing the amount of calculation. In addition, by using weight sharing and pooling in the CNN, the number of model parameters can be further reduced, and the demand for computing resources can be reduced.
[0071] 3. Processing complex scenes:
[0072] Adding more convolutional layers and pooling layers can make the model have a deeper hierarchy, which can learn more complex features. In addition, the introduction of residual connection can effectively prevent the gradient vanishing problem in the training process of deep network, so that the model can effectively learn various features from simple to complex, and improve the processing ability of complex scenes (such as double yellow lines, virtual and real lines, construction signs, etc.).
[0073] 4. Visual interference:
[0074] CNN is composed of multiple convolutional layers, each of which can learn higher-level feature representation from the previous layer, which enables CNN to distinguish between real road lines and other visual interferences (such as road damage) through layer-by-layer abstraction.
[0075] In a possible implementation manner, the road image can also be subjected to road line detection and recognition by a road line detection algorithm (such as gradient-based edge detection or a deep learning-based semantic segmentation model) to obtain the first road line.
[0076] In a possible implementation manner, to ensure the uniformity and usability of image data, after the autonomous vehicle obtains the road image, the road image needs to be preprocessed, such as cropping, scaling, color space conversion, etc., and then the preprocessed road image is input into the road line detection and recognition model for road line detection and recognition.
[0077] S203: Coordinate projection is performed on the first road line based on a unified coordinate system to obtain a second road line.
[0078] In the embodiments of the present application, the main target is to convert (map) the information in the 3D real world captured by the camera to the 2D image plane. Generally, due to factors such as camera position, angle, and lens distortion, the road image directly collected from the camera may appear distorted and perspective. For example, the road line far from the camera appears narrower, while the road line close to the camera appears wider. This phenomenon affects the accuracy and stability of the vehicle in identifying road lines. By using visual mapping technology, such as perspective transformation (coordinate transformation), we can correct these distortions and perspective effects, project the image to a unified coordinate system, and make the processed image closer to the real view of the vehicle on the road.
[0079] Referring to Figure 5 , a coordinate projection change flowchart is provided for the embodiments of the present application. As Figure 5 shown, it mainly includes the following steps.
[0080] S501: Extracting line key points of the first road line.
[0081] In the embodiment of the present application, the line key points of the first road line include line end points and line inflection points, that is, after the first road line is acquired, the line end points and the line inflection points contained in the first road line are identified, and the coordinates of the identified line end points and line inflection points are extracted.
[0082] S502: Setting a source point and a target point based on the line key points.
[0083] In the embodiment of the present application, the source point is the original coordinate of the line key point, and the target point is the projection coordinate of the source point in the unified coordinate system. Therefore, when the coordinate of the line key point is acquired, the source point and the target point can be set based on the coordinate of the line key point. It should be noted that the coordinate of the target point is a pre-set coordinate, that is, regardless of the coordinate of the line key point, the coordinate of the target point is unchanged when converted to the unified coordinate system.
[0084] S503: Performing coordinate projection on the first road line based on the source point and the target point to obtain a second road line.
[0085] In the embodiment of the present application, when the source point and the target point are set, a transformation matrix is generated based on the source point and the target point, and the first road line is subjected to coordinate projection transformation based on the transformation matrix to obtain a second road line. In a specific implementation, when the coordinates of the source point and the target point are provided, a cv2.getPerspect iveTransform function can be used to generate a transformation matrix, and a cv2.warpPerspect ive function can be used to perform perspective transformation (coordinate projection transformation) on the entire image according to the generated transformation matrix. It should be noted that the second road line generally includes two mutually parallel road lines.
[0086] The following will be described in conjunction with specific embodiments.
[0087] Referring to Figure 6 , a coordinate transformation diagram provided in the embodiment of the present application is shown. As Figure 6 shown, the first road line includes line end points a, b, c, and d. The source point coordinates obtained according to the line end points are a(550, 450), b(280, 720), c(1030, 720), and d(730, 450), and the target point coordinates are a'(200, 0), b'(200, 720), c'(1080, 720), and d'(1080, 0). A cv2.getPerspect iveTransform function is used to generate a transformation matrix based on the source point coordinates and the target point coordinates, and a cv2.warpPerspect ive function is used to perform coordinate projection transformation on the image in which the first road line is located based on the transformation matrix to obtain a second road line, and the second road line includes target points a', b', c', and d'.
[0088] In the embodiment of the present application, the first road line is projected into a unified coordinate system, which enables us to accurately detect the road line from the complex environment image and map it to a unified perspective, so that the subsequent path planning and control tasks are simpler and more reliable.
[0089] S204: output the position information and shape information of the second road line.
[0090] In the embodiment of the present application, when the second road line is obtained, the position information and shape information of the second road line can be obtained by image processing techniques (such as edge detection, Hough transform, etc.) or deep learning models (such as semantic segmentation models), and the position information and shape information of the second road line are output.
[0091] Referring to Figure 7 , a flowchart for obtaining road line position information and shape information is provided in the embodiment of the present application. As Figure 7 shown, it mainly includes the following steps.
[0092] S701: generate a vertical edge image, the vertical edge image including all vertical edges of the image in which the second road line is located.
[0093] In the embodiment of the present application, for the image in which the second road line is located, all vertical edges in the image can be found by Sobe l operator, and a vertical edge image is generated based on all vertical edges. Specifically, all possible vertical edges on the image in which the second road line is located are obtained by Sobe l operator, these vertical edges include all places with significant gradient changes in the X direction (horizontal direction), and the obtained vertical edges are binarized by threshold processing, so that the position of the vertical edge can be more easily identified. After processing the image in which the second road line is located by Sobe l operator, a new image, i.e. a vertical edge image, can be obtained, and the vertical edge image only includes all vertical edges of the image in which the second road line is located. In a specific implementation, we can identify the potential vertical edge position through the bright spots on the vertical edge image.
[0094] In actual process, other methods such as Roberts operator, Prewitt operator, Kr isch operator, etc. can also be used to find all vertical edges of the image in which the second road line is located, and the present application does not make specific requirements thereon.
[0095] S702: divide the vertical edge image into multiple horizontal regions.
[0096] In the embodiment of the present application, since the vertical edge image includes all the vertical edges of the image in which the second road line is located, the most obvious vertical edge, i.e., the vertical edge of the second road line, needs to be found out. In a specific implementation, in order to ensure the searching efficiency and effect, the vertical edge image is divided into multiple horizontal regions, and searching is performed on each horizontal region respectively. Specifically, the vertical road image can be divided into 10 equal horizontal regions by using the array_split function of numpy.
[0097] S703: Determine the target vertical edge of each horizontal region.
[0098] In the embodiment of the present application, after the vertical edge image is divided into multiple horizontal regions, the target vertical edge of each horizontal region is determined, which specifically includes: dividing the vertical edges included in each horizontal region into multiple columns, calculating the pixel value sum of each column, determining the column with the maximum pixel value sum as the target vertical edge, and the target vertical edge is the vertical edge of the second road line. It can be seen that the target vertical edge is the most obvious vertical edge on the vertical edge image.
[0099] In a possible implementation, after the pixel value sum of each column is calculated, a histogram is generated based on the pixel value sum of each column, then the index corresponding to the maximum value in the histogram, i.e., the position of the most obvious vertical edge, is found out, and the position of the most obvious vertical edge in each horizontal region is recorded in the vertical edge array.
[0100] S704: Output the position information and shape information of the second road line based on the target vertical edge.
[0101] In the embodiment of the present application, each target vertical edge in the vertical edge array represents the position of the most obvious vertical edge in the corresponding horizontal region, and outputting the vertical edge array means outputting the position information of the second road line. Meanwhile, connecting each target vertical edge in the vertical edge array can also obtain the shape information of the second road line.
[0102] In the embodiment of the present application, by obtaining the vertical edge image of the image after perspective projection, dividing the vertical edge image into multiple horizontal regions, and finding out the most obvious vertical edge in each horizontal region, these vertical edges represent the positions of the road lines, which can simplify the complex 2D image into a 1D vertical edge position array, facilitating the obtaining of the position information and shape information of the road line. Meanwhile, in a specific implementation, different types of road lines (such as solid lines, dashed lines, double yellow lines, etc.) can be recognized by using the color and texture information of the image, and the possible road conditions and driving rules can be predicted accordingly.
[0103] In a possible implementation, when the position information and shape information of the second road line are acquired, the vehicle driving control decision can also be output according to the position information and shape information of the second road line. In actual application, the vehicle driving control decision is planned according to the acquired road line information, and the current state (such as position, speed, and direction) and target task (such as destination, driving time, and driving mode) of the vehicle, so that an accurate road line information is crucial for subsequent driving control decision. The following will be described in detail in combination with specific examples.
[0104] Referring to Figure 8 , another application scenario provided by the embodiment of the present application is shown. As shown in the figure, the vehicle drives in the right lane of the road, and the road image in front is acquired by the camera during driving. After the road image is projected on the uniform coordinate through road line detection and identification, the road line information is obtained, including the road line position information and the road line shape information. Based on the road line information, the vehicle driving control decision can be adjusted, such as adjusting the position of the vehicle on the road, controlling the start and stop of the vehicle, accelerating, decelerating, and the like. Figure 8 In the figure, the road line in front of the vehicle is a straight line, and there is no intersection and branch in front, so the vehicle can be controlled to drive normally. Figure 8
[0105] Referring to Figure 9 , a vehicle driving control decision flowchart provided by the embodiment of the present application is shown. As shown in the figure, the flowchart includes: acquiring the road line and the current state of the vehicle; calculating the distance between the vehicle and the left and right road lines, and judging whether the vehicle is located in the road center; if the vehicle deviates from the center, the steering angle needs to be adjusted to correct the trajectory; observing the change of the road line in front, and predicting the possible situation; if a curve is detected in front, the vehicle can be decelerated in advance, and the steering angle can be adjusted according to the curvature of the curve; if a crossroad is detected in front, the vehicle can be temporarily stopped until it is confirmed to be safe and then continue driving; in other cases, the vehicle can drive normally. Figure 9
[0106] Compared with the prior art, the embodiment of the present application has the following advantages:
[0107] 1. High-precision identification: the embodiment of the present application combines deep learning (especially CNN) and visual mapping technology, and can realize high-precision road line detection under various lighting conditions and road environments.
[0108] 2. Strong robustness: compared with the traditional color-based and gradient-based method, the deep learning model can automatically learn more complex and robust features, thereby improving the robustness of detection.
[0109] 3. Good adaptability: the embodiment of the application projects the detection result into a unified coordinate system through visual mapping, so that the processed result is closer to the real visual field of the vehicle on the road, which facilitates subsequent control decisions and enhances the adaptability of the system to various scenes.
[0110] 4. Strong real-time performance: once the deep learning model is trained, it can perform fast inference on a GPU or other hardware accelerator. At the same time, visual mapping usually only needs mathematical calculation and has high efficiency. Therefore, the method of the embodiment of the application can run in real time or near real time, thereby meeting the needs of applications such as autonomous driving.
[0111] 5. Facilitating control decisions: after the road line information is mapped and converted, it is more consistent with the actual visual angle of the vehicle and is more convenient for the control system to make accurate decisions, such as planning the running track and speed of the vehicle.
[0112] Corresponding to the above embodiment, the embodiment of the application also provides a road line detection device.
[0113] Referring to Figure 10 , a structural schematic diagram of a road line detection device provided by the embodiment of the application is shown. As Figure 10 shown, the road line detection device 1000 includes: an acquisition unit 1001 configured to acquire a road image; a detection and recognition unit 1002 configured to detect and recognize a road line in the road image to obtain a first road line; a projection unit 1003 configured to perform coordinate projection on the first road line based on a unified coordinate system to obtain a second road line; and an output unit 1004 configured to output position information and shape information of the second road line.
[0114] The specific content of the embodiment of the application can be referred to the description of the above method embodiment, and will not be described here for brevity.
[0115] Corresponding to the above embodiment, the embodiment of the application also provides a road line detection device. Figure 11 A structural schematic diagram of an electronic device provided by the embodiment of the application is shown, and the electronic device 1100 can include a processor 1101, a memory 1102, and a communication unit 1103. These components communicate through one or more buses, and those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the application. It can be a bus structure, or a star structure, and can include more or fewer components than shown in the figure, or combine some components, or different component arrangements.
[0116] The communication unit 1103 is configured to establish a communication channel, so that the electronic device can communicate with other devices. The communication unit 1103 is configured to receive user data from other devices or send user data to other devices.
[0117] The processor 1101 is the control center of the electronic device. The processor 1101 is connected with various parts of the electronic device through various interfaces and lines, and executes various functions of the electronic device and / or processes data by running or executing software programs, instructions, and / or modules stored in the memory 1102 and calling data stored in the memory 1102. The processor 1101 can be composed of an integrated circuit (IC), for example, a single packaged IC or a plurality of packaged ICs connected together. For example, the processor 1101 can only include a central processing unit (CPU). In the embodiments of the present application, the CPU can be a single operation core or can include a plurality of operation cores.
[0118] The memory 1102 is configured to store execution instructions of the processor 1101. The memory 1102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.
[0119] When the execution instructions in the memory 1102 are executed by the processor 1101, the electronic device 1100 can perform some or all of the steps in the embodiments shown in FIG. 10. Figure 2
[0120] In specific implementations, the present application also provides a computer storage medium, which can store a program. When the program is executed, some or all of the steps in the embodiments of the road line detection method provided by the present application can be included. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0121] In specific implementations, the present application also provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes some or all of the steps in the embodiments of the road line detection method provided by the present application.
[0122] Those skilled in the art can clearly understand that the technical solutions in the embodiments of the present application can be implemented by means of software plus necessary universal hardware platforms. Based on such an understanding, the technical solutions in the embodiments of the present application can be embodied in a software product form, and the computer software product can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in the various embodiments or some parts of the embodiments of the present application.
[0123] The same or similar parts among the various embodiments in the specification can be referred to each other. Especially, for the device embodiments and the terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
Claims
1. A road line detection method characterized by, The method comprises: acquiring a road image; detecting and identifying a road line in the road image to obtain a first road line; projecting coordinates of the first road line based on a unified coordinate system to obtain a second road line; outputting position information and shape information of the second road line.
2. The method of claim 1, wherein, The detecting and identifying the road line in the road image to obtain the first road line comprises: detecting and identifying the road line in the road image based on a pre-trained road line detection and identification model to obtain the first road line.
3. The method of claim 1, wherein, The projecting coordinates of the first road line based on the unified coordinate system to obtain the second road line comprises: extracting line key points of the first road line, the line key points comprising line end points and line inflection points; setting a source point and a target point based on the line key points, the source point being an original coordinate of the line key point, and the target point being a projection coordinate of the source point in the unified coordinate system; projecting coordinates of the first road line based on the source point and the target point to obtain the second road line.
4. The method of claim 3, wherein, The projecting coordinates of the first road line based on the source point and the target point to obtain the second road line comprises: generating a transformation matrix based on the source point and the target point; projecting coordinates of the first road line based on the transformation matrix to obtain the second road line.
5. The method of claim 1, wherein, The outputting the position information and the shape information of the second road line comprises: generating a vertical edge image, the vertical edge image comprising all vertical edges of an image in which the second road line is located; dividing the vertical edge image into a plurality of horizontal regions; determining a target vertical edge of each horizontal region; outputting the position information and the shape information of the second road line based on the target vertical edge.
6. The method of claim 5, wherein, The determining the target vertical edge of each horizontal region comprises: dividing vertical edges included in each horizontal region into a plurality of columns; performing pixel value summation processing on each column; determining a column with the maximum pixel value as the target vertical edge.
7. The method of claim 1, wherein, The method further comprises: outputting a vehicle driving control decision based on the position information and the shape information of the second road line.
8. A road lane detection device characterized by comprising: comprises: an acquisition unit configured to acquire a road image; a detection and identification unit configured to detect and identify a road line in the road image to obtain a first road line; a projection unit configured to project coordinates of the first road line based on a unified coordinate system to obtain a second road line; an output unit configured to output position information and shape information of the second road line.
9. An electronic device, comprising: comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein when the program runs, the device where the computer readable storage medium is located is controlled to execute the method of any one of claims 1-7.