Lane line detection method and related device
Patent Information
- Application Number
- CN202211642793.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-12-20
AI Technical Summary
[0003]本申请实施例公开了一种车道线检测方法及相关设备,能够解决无法识别停止线的技术问题
[0014]在本申请提供的车道线检测方法中,为了识别主道线以及停止线,首先,获取车辆的前景图像,将前景图像转换为鸟瞰图,建立鸟瞰图对应的横向直方图,将横向直方图的波峰作为移动横向滑动窗口的起点,通过拟合横向滑动窗口内的非零像素点生成主车道线,提高了识别主车道线的精度。然后,计算每个横向滑动窗口的置信度,比对每个横向滑动窗口置信度跟预设阈值的大小,若存在连续预设数量的横向滑动窗口的置信度小于预设阈值,将连续预设数量的横向滑动窗口的前一个横向滑动窗口作为在先横向滑动窗口,根据在先横向滑动窗口确定车道线终点,利用置信度确定车道线终点,进一步提高了识别主车道线的准确度。最后,建立鸟瞰图对应的纵向直方图,将纵向直方图的波峰作为移动纵向滑动窗口的起点,通过拟合纵向滑动窗口内的非零像素点生成目标曲线,若车道线终点位于目标曲线上,确定目标曲线为停止线。本申请通过建立横、纵方向上的直方图,可以提高在获取的图像中识别车道线(包括主车道线和停止线)的准确度,进一步提高驾驶的安全性。
Smart Images

Figure CN118230266B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a lane line detection method and related equipment. Background Technology
[0002] Lane detection is a crucial technology in autonomous and assisted driving scenarios. It involves detecting traffic markings (lane lines) on the road to determine if a vehicle is deviating from its lane. Inaccurate lane line detection can compromise safe driving. Therefore, accurate lane line identification is essential in intelligent driving systems. Summary of the Invention
[0003] This application discloses a lane line detection method and related equipment, which can solve the technical problem of not being able to identify stop lines.
[0004] This application provides a lane line detection method, the method comprising: acquiring a foreground image of a vehicle; converting the foreground image into a bird's-eye view and establishing a horizontal histogram corresponding to the bird's-eye view; using the peak of the horizontal histogram as the starting point of a moving horizontal sliding window, and generating a main lane line by fitting non-zero pixels within the horizontal sliding window; calculating the confidence level of each horizontal sliding window; if there exists a preset number of consecutive horizontal sliding windows with confidence levels less than a preset threshold, determining the preceding horizontal sliding window of the preset number of consecutive horizontal sliding windows as the prior horizontal sliding window, and determining the lane line endpoint of the main lane line based on the prior horizontal sliding window; establishing a vertical histogram corresponding to the bird's-eye view, using the peak of the vertical histogram as the starting point of a moving vertical sliding window, generating a target curve by fitting non-zero pixels within the vertical sliding window, and determining the target curve as a stop line if the lane line endpoint is located on the target curve.
[0005] In some optional embodiments, converting the foreground image into a bird's-eye view includes: performing distortion correction on the foreground image to obtain a corrected image; taking each non-zero pixel in the corrected image as a target point, calculating the coordinates of the target point using a coordinate transformation formula to obtain an inverse perspective transformation matrix; and using the inverse perspective transformation matrix to convert the corrected image into the bird's-eye view.
[0006] In some optional embodiments, the step of using the peak of the horizontal histogram as the starting point for moving the horizontal sliding window and generating the main lane line by fitting the non-zero pixels within the horizontal sliding window includes: using the peak of the horizontal histogram as the starting point for moving the horizontal sliding window, calculating the average of the horizontal coordinates of all non-zero pixels within the previous horizontal sliding window as a first average horizontal coordinate; determining the horizontal window center of the current horizontal sliding window based on the first average horizontal coordinate; determining the position of the current horizontal sliding window based on the horizontal window center; and fitting the non-zero pixels within the current horizontal sliding window and all horizontal sliding windows preceding the current horizontal sliding window to generate the main lane line.
[0007] In some optional embodiments, calculating the confidence level of each of the horizontal sliding windows includes: inputting a bird's-eye view containing the horizontal sliding windows into a preset deep learning neural network model, calculating the similarity between the pixel features of each pixel in each horizontal sliding window and the sample features; and determining the confidence level of each of the horizontal sliding windows based on the similarity, wherein the similarity is proportional to the confidence level.
[0008] In some optional embodiments, the step of using the peak of the vertical histogram as the starting point for moving the vertical sliding window and generating a target curve by fitting the non-zero pixels within the vertical sliding window includes: using the peak of the vertical sliding window as the starting point for moving the vertical sliding window, calculating the average of the abscissas of all non-zero pixels within the previous vertical sliding window as a second abscissa average; determining the vertical window center of the current vertical sliding window based on the second abscissa average, determining the position of the current vertical sliding window based on the vertical window center; and fitting the non-zero pixels within the current vertical sliding window and all the vertical sliding windows preceding the current vertical sliding window to generate the target curve.
[0009] In some optional embodiments, determining the target curve as a stop line if the lane line endpoint is located on the target curve includes: calculating the matching degree between multiple longitudinal sliding windows corresponding to the target curve and the prior lateral sliding window; if any matching degree exceeds a preset matching degree, determining that the lane line endpoint is located on the target curve; and determining the position of the stop line based on the position of the target curve and the position of the lane line endpoint.
[0010] In some optional embodiments, after determining that the target curve is a stop line, the method further includes filtering out the consecutive preset number of the horizontal sliding windows.
[0011] In some optional embodiments, the method further includes: if the lane line endpoint does not exist on the target curve, determining that the stop line does not exist in the foreground image, and outputting a warning indicating that the main lane line will soon be unrecognizable.
[0012] This application also provides a vehicle-mounted device, which includes a processor and a memory, wherein the processor is used to implement the lane detection method by executing a computer program stored in the memory.
[0013] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the lane detection method described above.
[0014] In the lane line detection method provided in this application, to identify the main lane line and stop line, firstly, a foreground image of the vehicle is acquired and converted into a bird's-eye view. A horizontal histogram corresponding to the bird's-eye view is established, and the peak of the horizontal histogram is used as the starting point of the moving horizontal sliding window. The main lane line is generated by fitting the non-zero pixels within the horizontal sliding window, thus improving the accuracy of main lane line identification. Then, the confidence score of each horizontal sliding window is calculated and compared with a preset threshold. If a preset number of consecutive horizontal sliding windows have a confidence score less than the preset threshold, the preceding horizontal sliding window of the preset number of consecutive horizontal sliding windows is taken as the prior horizontal sliding window. The lane line endpoint is determined based on the prior horizontal sliding window, and the lane line endpoint is determined using the confidence score, further improving the accuracy of main lane line identification. Finally, a vertical histogram corresponding to the bird's-eye view is established, and the peak of the vertical histogram is used as the starting point of the moving vertical sliding window. A target curve is generated by fitting the non-zero pixels within the vertical sliding window. If the lane line endpoint is located on the target curve, the target curve is determined to be the stop line. This application improves the accuracy of lane line identification (including main lane lines and stop lines) in acquired images by establishing histograms in the horizontal and vertical directions, thereby further enhancing driving safety. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the vehicle-mounted device provided in the embodiments of this application.
[0016] Figure 2 This is a flowchart of the lane line detection method provided in the embodiments of this application.
[0017] Figure 3 This is a schematic diagram of the confidence level provided in an embodiment of this application.
[0018] Figure 4 This is a schematic diagram of the confidence level provided in an embodiment of this application.
[0019] Figure 5 This is a flowchart of a lane line detection method provided in an embodiment of this application.
[0020] Figure 6 This is a schematic diagram of a lane line provided in an embodiment of this application. Detailed Implementation
[0021] For ease of understanding, exemplary descriptions of some concepts related to the embodiments of this application are provided for reference.
[0022] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0023] To address the technical problem that existing technologies cannot accurately identify stop lines on roads using image recognition, this application provides a lane line detection method applied to an in-vehicle device. This method can determine the end point of the main lane line and the stop line by establishing a lateral bird's-eye view and a longitudinal bird's-eye view, effectively ensuring driving safety and improving the driving experience.
[0024] To better understand the lane line detection method and related equipment provided in the embodiments of this application, the application scenarios of the lane line detection method of this application are described below.
[0025] Figure 1 This is a schematic diagram of the vehicle-mounted device provided in an embodiment of this application. The lane detection method provided in this embodiment of the application is applied to the vehicle-mounted device 1. The vehicle-mounted device 1 includes, but is not limited to, a memory 11, at least one processor 12, and a shooting device 13 connected to each other via a communication bus 10. The shooting device 13 can be an in-vehicle shooting device or an external vehicle camera device, such as a camera or a dashcam, to capture multiple images or videos of the front of the vehicle.
[0026] Figure 1 This is merely an example of vehicle-mounted device 1 and does not constitute a limitation on vehicle-mounted device 1. In actual applications, vehicle-mounted device 1 may include more or fewer components than shown in the figure, or combine certain components, or replace different components. For example, vehicle-mounted device 1 may also include input / output devices, network access devices, etc.
[0027] In this embodiment of the application, the vehicle-mounted device 1 is applied in a vehicle. For example, it can be a vehicle-mounted device in a vehicle (e.g., a vehicle-mounted system) or an independent electronic device (e.g., a computer, mobile phone, tablet computer, etc.) and can communicate and interact with the vehicle-mounted device to achieve control of the vehicle.
[0028] like Figure 2 The diagram shown is a flowchart of a lane line detection method provided in an embodiment of this application. The lane line detection method described in this application is applied to in-vehicle devices (e.g., [missing information]). Figure 1 In the vehicle-mounted device 1). Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0029] S21, acquire the foreground image of the vehicle.
[0030] In one embodiment of this application, the foreground image can be an image captured in the direction the vehicle is traveling. The foreground image can be obtained by capturing an image of the foreground in front of the vehicle. Alternatively, the foreground image can be obtained from a video recording of the scene in front of the vehicle.
[0031] When the vehicle-mounted device includes a camera, the first foreground image can be acquired through the camera of the vehicle-mounted device. When the vehicle-mounted device does not include a camera, the foreground image can be acquired through a camera on the vehicle (e.g., a dashcam).
[0032] S22, convert the foreground image into a bird's-eye view and create a horizontal histogram corresponding to the bird's-eye view.
[0033] In one embodiment of this application, due to issues such as angle, rotation, and scaling during shooting, the first foreground image may be distorted (i.e., deformed), requiring distortion correction of the foreground image.
[0034] Distortion correction is performed on the foreground image to obtain a corrected image. Specifically, an image coordinate system is established for the foreground image. The first coordinate of each non-zero pixel in the foreground image is obtained in the image coordinate system. The intrinsic parameters of the imaging device are obtained. Based on the intrinsic parameters and the first coordinate, the second coordinate corresponding to the first coordinate is determined, where the second coordinate is the distortion-free coordinate. The distortion distance between the first coordinate and the center coordinate of the foreground image is determined based on the first coordinate and the center coordinate. The image complexity of the foreground image is calculated based on the grayscale value of each pixel in the foreground image, and the correction parameters of the foreground image are determined based on the image complexity. A smoothing coefficient corresponding to the distortion distance and the correction parameters is determined based on a preset smoothing function. The first coordinate is smoothed and corrected based on the smoothing coefficient and the second coordinate to obtain the corrected image.
[0035] After obtaining the corrected image, each non-zero pixel in the corrected image is taken as a target point. The coordinates of the target points are calculated using coordinate transformation formulas to obtain the inverse perspective transformation matrix. The inverse perspective transformation matrix is then used to convert the corrected image into a bird's-eye view. Specifically, this may include: preprocessing the corrected image by converting it to grayscale, applying gradient thresholding, color thresholding, and saturation thresholding, removing irrelevant lane line information from the corrected image to obtain a binary image, and using the characteristic that lanes on the same road surface are approximately parallel, perspective transformation is used to eliminate perspective effects. Each non-zero pixel in the corrected image is taken as a target point, and the coordinate transformation formula is used to calculate the inverse transformation matrix for each target point. The inverse transformation matrix is then used to perform perspective transformation on the binary image to obtain the bird's-eye view. The bird's-eye view is a three-dimensional image drawn from a high vantage point, based on the principles of perspective, and is more realistic than a two-dimensional image.
[0036] After obtaining the bird's-eye view, a horizontal histogram corresponding to the bird's-eye view is created. Specifically, this includes: creating a horizontal histogram for the non-zero pixels corresponding to the lower half of the bird's-eye view; and obtaining the peaks of the horizontal histogram based on the cumulative value of the number of non-zero pixels in each column. For example, it may include a first peak and a second peak.
[0037] S23, using the peak of the horizontal histogram as the starting point of the moving horizontal sliding window, generates the main lane line by fitting the non-zero pixels within the horizontal sliding window.
[0038] In one embodiment of this application, based on the obtained first peak and second peak, a horizontal sliding window is used to search for lane lines on a bird's-eye view. Specifically, this includes: using the first peak as the starting point of the moving horizontal sliding window, calculating the average value of the horizontal coordinates of all non-zero pixels in the previous horizontal sliding window as the first horizontal coordinate average value, determining the horizontal window center of the current horizontal sliding window based on the first horizontal coordinate average value, determining the position of the current horizontal sliding window based on the horizontal window center, and fitting the non-zero pixels in the current sliding window and all horizontal sliding windows before the current horizontal sliding window to generate the left main lane line.
[0039] Similarly, based on the second peak, the horizontal sliding window is moved, and the average value of the horizontal coordinates of all non-zero pixels in the previous horizontal sliding window is calculated as the first average value of the horizontal coordinate. The horizontal window center of the current horizontal sliding window is determined based on the first average value of the horizontal coordinate, and the position of the current horizontal sliding window is determined based on the horizontal window center. The non-zero pixels in the current sliding window and all the horizontal sliding windows before the current horizontal sliding window are fitted to generate the right main lane line.
[0040] In this embodiment of the application, in order to quickly fit the main lane lines, if the horizontal sliding window moves to an area with fewer non-zero pixels within the range of the bird's-eye view, the horizontal sliding window moves in a straight line. This area may be the gap between the dashed lane lines, or it may be the lane lines that are blurred due to weather conditions.
[0041] S24, calculate the confidence level for each horizontal sliding window.
[0042] To determine whether a lateral sliding window contains lane lines, the confidence score for each lateral sliding window needs to be calculated. Before calculating the confidence score for each lateral sliding window, a deep neural network model needs to be pre-determined. This deep neural network model is trained using a large amount of sample data. Lane line image samples under various road conditions and lighting conditions are pre-acquired, and the pixels containing lane lines are labeled to obtain training samples. The deep neural network is then trained to determine the deep neural network model.
[0043] In one embodiment of this application, a bird's-eye view containing a horizontal sliding window is input into a preset deep learning neural network model. The similarity between the pixel features and sample features of each pixel in each horizontal sliding window is calculated. The confidence level of each horizontal sliding window is determined based on the similarity. The similarity is directly proportional to the confidence level; the higher the similarity, the higher the confidence level. For example, if the similarity between a pixel feature in the foreground image and its corresponding sample feature is higher than a preset first proportion, such as 98%, the confidence level of the pixel is recorded as 1. If the similarity between a pixel feature in the foreground image and its sample feature is lower than a preset second proportion, such as 0.2%, the confidence level of the pixel is recorded as 0. The confidence level of the horizontal sliding window is obtained based on the confidence levels of all pixels within the horizontal sliding window.
[0044] Figure 3 This is a schematic diagram illustrating the confidence level provided in one embodiment of this application. For example... Figure 3 As shown, if 240 pixels in the horizontal sliding window A have pixel features that match the sample features, the confidence level is 0.8. If 40 pixels in the horizontal sliding window B have pixel features that match the sample features, the confidence level is 0.2.
[0045] S25, if the confidence level of a consecutive preset number of horizontal sliding windows is less than a preset threshold, determine the previous horizontal sliding window of the consecutive preset number of horizontal sliding windows as the prior horizontal sliding window, and determine the lane end point of the main lane line based on the prior horizontal sliding window.
[0046] In one embodiment of this application, after calculating the confidence level of each horizontal sliding window, the confidence level is compared with a preset threshold. If the confidence level of a consecutive preset number of horizontal sliding windows is less than the preset threshold, the first horizontal sliding window among the consecutive preset number of horizontal sliding windows is taken as the prior horizontal sliding window.
[0047] Figure 4 This is a schematic diagram of the confidence level provided in an embodiment of this application.
[0048] For example, in some examples, assuming the preset threshold is 0.3 and the preset quantity is 3, such as... Figure 4 As shown, assuming that the confidence levels of horizontal sliding windows 0, 2, 5, 7, 8, 9, and 10 are all less than the preset threshold of 0.3, and the confidence levels of consecutive horizontal sliding windows 7, 8, 9, and 10 are less than the preset threshold of 0.3, the preceding horizontal sliding window (i.e., horizontal sliding window 6) of a consecutive preset number (3) of horizontal sliding windows is taken as the prior horizontal sliding window.
[0049] After determining the prior lateral sliding window, based on the aforementioned confidence level, it can be determined that the sliding window moving after the prior lateral sliding window does not contain lane lines. Therefore, based on the prior lateral sliding window (e.g....), Figure 4 6) Determine the lane endpoint of the main lane line using the horizontal sliding window in the middle.
[0050] In the embodiments of this application, the confidence level of the lateral sliding window is calculated to determine whether the main lane line is included, which not only speeds up the fitting of lane lines, but also improves the accuracy of lane line recognition.
[0051] S26. Establish a vertical histogram corresponding to the bird's-eye view. Use the peak of the vertical histogram as the starting point of the moving vertical sliding window. Generate the target curve by fitting the non-zero pixels in the vertical sliding window. If the end point of the lane line is located on the target curve, determine the target curve as the stop line.
[0052] After obtaining the lane line endpoint, to further determine whether the lane line endpoint is correct, a vertical histogram corresponding to the bird's-eye view is established. A vertical sliding window is used to determine the target curve. The accuracy of the lane line endpoint is determined by checking whether it lies on the target curve. Specifically, the peak of the vertical sliding window serves as the starting point for moving the window. The average of the x-coordinates of all non-zero pixels in the previous vertical sliding window is calculated as the second average x-coordinate. The center of the current vertical sliding window is determined based on this second average x-coordinate, and its position is determined based on this center. The non-zero pixels in the current vertical sliding window and all previous vertical sliding windows are fitted to generate the target curve. If the number of non-zero pixels in the current vertical sliding window is less than a preset non-zero pixel threshold, the current vertical sliding window is not fitted; that is, if there are no lane line pixel features within the vertical sliding window, it is not fitted.
[0053] After obtaining the target curve, if the target curve is in the same position as the end point of the lane line, it proves that there is a lane line, i.e., a stop line, at the end point of the lane line. If the target curve is not in the same position as the end point of the lane line, it proves that there is no lane line at the end point of the lane line. The judgment that the end point of the lane line is not the end point of the lane line may be due to the blurring of the lane line caused by external factors such as weather.
[0054] Determining whether the target curve and the lane line endpoint are consistent can include: calculating the matching degree between multiple longitudinal sliding windows corresponding to the target curve and a prior lateral sliding window. If any matching degree exceeds a preset matching degree, the lane line endpoint is determined to be located on the target curve. The stop line position is determined based on the position of the target curve and the lane line endpoint. If the matching degree between the moving longitudinal sliding window and the lateral sliding window on the stop line is high, it can be further confirmed that the lane line endpoint obtained above is correct and not due to blurred lane lines, weak light, or weather conditions causing inaccurate judgment. If the target curve is not the stop line, and the matching degree between the moving sliding window and the lateral sliding window on the target curve is low, it is determined that this is not the lane line endpoint, and the lane line blurring may be due to weather conditions. A warning is issued, indicating that the driver will soon be unable to recognize the main lane line.
[0055] Figure 5 This is a flowchart of a lane line detection method provided in an embodiment of this application.
[0056] In some examples, such as Figure 5As shown, assuming a vertical histogram is built on the left side of the bird's-eye view, with point C as the peak of the vertical histogram, point C is used as the starting point for moving the vertical sliding window on the right side of the bird's-eye view. The target curve is fitted based on the moving vertical sliding window. If point C is located at the position of the previous horizontal sliding window (e.g., horizontal sliding window 6), it indicates that point C and the previous horizontal sliding window 6 are on the stop line.
[0057] Figure 6 This is a schematic diagram of a lane line provided in an embodiment of this application.
[0058] After determining the stop line, filter out a preset number of consecutive horizontal sliding windows, such as... Figure 5 The horizontal sliding windows 7, 8, 9, and 10 are considered noise and discarded, not participating in the lane line fitting process. Figure 6 As shown, the pixels within the filtered horizontal sliding window are fitted to obtain lane lines including the lane endpoints and stop lines. Compared to the actual lane lines, the lane lines fitted after discarding noise have a higher degree of matching with the actual lane lines, which facilitates assisted driving in intelligent driving mode, improving driving safety and the driver's experience.
[0059] In this embodiment, firstly, a foreground image of the vehicle is acquired using an imaging device. This foreground image is then processed to convert it into a bird's-eye view, and a horizontal histogram corresponding to the bird's-eye view is established. The peak of the horizontal histogram is used as the starting point for moving a horizontal sliding window. Main lane lines, including left and right main lane lines, are generated by fitting non-zero pixels within the horizontal sliding window. Next, the confidence level of each horizontal sliding window is calculated. If a predetermined number of consecutive horizontal sliding windows have a confidence level less than a predetermined threshold, the preceding horizontal sliding window of that predetermined number is determined as the prior horizontal sliding window. The lane endpoint of the main lane line is then determined based on the prior horizontal sliding window. Finally, to avoid lane line blurring due to weather or other external factors, which could lead to inaccurate lane endpoint identification, a vertical histogram corresponding to the bird's-eye view is established. The peak of the vertical histogram is used as the starting point for moving a vertical sliding window. A target curve is generated by fitting non-zero pixels within the vertical sliding window. If the lane endpoint lies on the target curve, the target curve is considered a stop line. This application improves the accuracy of lane line identification.
[0060] Please continue reading. Figure 1 In this embodiment, the memory 11 can be the internal memory of the vehicle-mounted device 1, that is, the memory built into the vehicle-mounted device 1. In other embodiments, the memory 11 can also be the external memory of the vehicle-mounted device 1, that is, the memory externally connected to the vehicle-mounted device 1.
[0061] In some embodiments, the memory 11 is used to store program code and various data, and to achieve high-speed and automatic access to programs or data during the operation of the vehicle-mounted device 1.
[0062] The memory 11 may include random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0063] In one embodiment, the processor 12 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor itself may be any other conventional processor.
[0064] If the program code and various data in the memory 11 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments, such as the lane detection method, can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), etc.
[0065] It is understood that the module division described above is a logical functional division, and there may be other division methods in actual implementation. Furthermore, the functional modules in the various embodiments of this application can be integrated into the same processing unit, or each module can exist physically separately, or two or more modules can be integrated into the same unit. The integrated modules described above can be implemented in hardware or in a combination of hardware and software functional modules.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A lane line detection method, characterized in that, The method includes: Acquire a foreground image of the vehicle; Convert the foreground image into a bird's-eye view and create a horizontal histogram corresponding to the bird's-eye view; The peak of the horizontal histogram is used as the starting point of the moving horizontal sliding window, and the main lane line is generated by fitting the non-zero pixels within the horizontal sliding window. Calculate the confidence level for each of the horizontal sliding windows; If the confidence level of a consecutive preset number of the horizontal sliding windows is less than a preset threshold, the preceding horizontal sliding window of the consecutive preset number of the horizontal sliding windows is determined as the prior horizontal sliding window, and the lane end point of the main lane line is determined according to the prior horizontal sliding window. A vertical histogram corresponding to the bird's-eye view is established. The peak of the vertical histogram is used as the starting point of the moving vertical sliding window. A target curve is generated by fitting the non-zero pixels in the vertical sliding window. If the end point of the lane line is located on the target curve, the target curve is determined to be a stop line.
2. The lane line detection method according to claim 1, characterized in that, The step of converting the foreground image into a bird's-eye view includes: The foreground image is subjected to distortion correction to obtain the corrected image; Each non-zero pixel in the corrected image is taken as a target point, and the coordinates of the target point are calculated using the coordinate transformation formula to obtain the inverse perspective transformation matrix; The corrected image is converted into the bird's-eye view using the inverse perspective transformation moment.
3. The lane line detection method according to claim 1, characterized in that, The step of using the peak of the horizontal histogram as the starting point of the moving horizontal sliding window, and generating the main lane line by fitting the non-zero pixels within the horizontal sliding window, includes: Using the peak of the horizontal histogram as the starting point for moving the horizontal sliding window, the average value of the horizontal coordinates of all non-zero pixels in the previous horizontal sliding window of the current horizontal sliding window is calculated as the first average value of the horizontal coordinate. The horizontal center of the current horizontal sliding window is determined based on the average value of the first horizontal coordinate, and the position of the current horizontal sliding window is determined based on the horizontal window center. The main lane line is generated by fitting the non-zero pixels in the current horizontal sliding window and all horizontal sliding windows preceding the current horizontal sliding window.
4. The lane line detection method according to claim 1, characterized in that, The calculation of the confidence level for each of the horizontal sliding windows includes: The bird's-eye view containing the horizontal sliding window is input into a preset deep learning neural network model to calculate the similarity between the pixel features of each pixel in each horizontal sliding window and the sample features. The confidence level of each of the horizontal sliding windows is determined based on the similarity, and the similarity is proportional to the confidence level.
5. The lane line detection method according to claim 1, characterized in that, The step of using the peak of the vertical histogram as the starting point of the moving vertical sliding window, and generating the target curve by fitting the non-zero pixels within the vertical sliding window, includes: Using the peak of the vertical sliding window as the starting point for moving the vertical sliding window, the average value of the horizontal coordinates of all non-zero pixels in the previous vertical sliding window of the current vertical sliding window is calculated as the second average value of the horizontal coordinates. The vertical center of the current vertical sliding window is determined based on the average value of the second horizontal coordinate, and the position of the current vertical sliding window is determined based on the vertical window center. The target curve is generated by fitting the non-zero pixels in the current vertical sliding window and all the vertical sliding windows preceding the current vertical sliding window.
6. The lane line detection method according to claim 1, characterized in that, If the end point of the lane line is located on the target curve, determining the target curve as a stop line includes: Calculate the matching degree between the multiple vertical sliding windows corresponding to the target curve and the prior horizontal sliding window; If any matching degree exceeds the preset matching degree, it is determined that the lane line endpoint is located on the target curve; The position of the stop line is determined based on the position of the target curve and the position of the end point of the lane line.
7. The lane line detection method according to claim 6, characterized in that, After determining the target curve as a stop line, the method further includes: Filter out the consecutive preset number of horizontal sliding windows.
8. The lane line detection method according to claim 1, characterized in that, The method further includes: If the lane line endpoint is not present on the target curve, it is determined that the stop line is not present in the foreground image, and a warning is output, indicating that the main lane line will soon be unrecognizable.
9. A vehicle-mounted device, characterized in that, The on-board device includes a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the lane detection method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the lane line detection method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Lane detection device, method and electronic equipment
CN112084822A
Method and apparatus for indicating lane
US20180129887A1