A lane line detection method, system, device and medium based on night road image enhancement

CN122966746APending Publication Date: 2026-10-23NANJING FORESTRY UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510245875.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

然而,AHE方法在增强过程中容易放大噪声,导致过高的对比度

Benefits of technology

[0038]本发明公开了一种基于夜间道路图像增强的车道线检测方法、系统、设备及介质,所述方法包括将待测图像由RGB格式转换为YCbCr格式,并提取图像中的Y通道;采用CLAHE算法对所述Y通道进行对比度增强,并基于JND阈值与背景亮度的关系,构建伽马值与背景亮度的动态映射曲线;基于所述动态映射曲线,采用自适应Gamma校正方法,对不同区域的亮度应用动态伽马值进行校正,并将校正后的图像由YCbCr格式转回RGB格式,得到优化图像;利用DBSCAN聚类算法与多项式拟合方法对增强后的图像进行目标提取,得到目标车道线。本发明能够提升夜间道路图像的亮度和对比度,进而提高车道线检测准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966746A_ABST
    Figure CN122966746A_ABST
Patent Text Reader

Abstract

The application discloses a lane line detection method and system based on night road image enhancement, equipment and a medium, and relates to the technical field of lane line detection. The method comprises the following steps: converting a to-be-detected image from an RGB format into a YCbCr format, and extracting a Y channel in the image; adopting a CLAHE algorithm to perform contrast enhancement on the Y channel, and constructing a dynamic mapping curve of a gamma value and background brightness based on the relationship between a JND threshold and the background brightness; based on the dynamic mapping curve, adopting an adaptive gamma correction method to apply a dynamic gamma value to correct the brightness of different regions, and converting the corrected image from the YCbCr format back into the RGB format to obtain an optimized image; and using a DBSCAN clustering algorithm and a polynomial fitting method to perform target extraction on the enhanced image to obtain a target lane line. The application can improve the brightness and contrast of a night road image, and thus improves the lane line detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lane line detection technology, and in particular to a lane line detection method, system, device and medium based on nighttime road image enhancement. Background Technology

[0002] In recent years, with the rapid development of artificial intelligence technology, many high-performance lane detection algorithms have emerged. In daytime scenarios, most lane detection algorithms perform well, accurately identifying lane lines on urban roads. However, in nighttime scenarios, interference from complex light sources such as streetlights, oncoming headlights, and vehicle taillights significantly increases image noise, with some areas even experiencing overexposure or underexposure, resulting in blurred lane line information and significantly reducing detection effectiveness. Lane detection is a crucial foundation for lane departure warning systems and lane keeping assist systems. Statistics show that the incidence of traffic accidents at night is far higher than during the day; therefore, improving the accuracy of nighttime lane detection has significant research value and practical implications.

[0003] Currently, methods for enhancing low-light road images at night mainly include traditional algorithms and deep learning methods. Compared to deep learning methods, traditional image enhancement algorithms have the advantages of simple structure and low implementation cost. Furthermore, with the improvement of computer hardware performance, the real-time processing capability of traditional image enhancement algorithms has significantly increased, and their enhancement effects have been gradually optimized. Among them, enhancement techniques based on histogram equalization, Retinex algorithm, and gamma correction are widely used to improve the contrast and brightness of low-light images. Histogram equalization (HE) is a common global contrast enhancement method. Although it is simple to operate, it is difficult to meet the needs of local contrast enhancement because it is based only on the global histogram. To overcome this limitation, researchers have proposed improved methods such as dynamic histogram equalization (DHE) and adaptive histogram equalization (AHE). However, the AHE method is prone to amplifying noise during the enhancement process, leading to excessively high contrast. Summary of the Invention

[0004] The purpose of this invention is to provide a lane detection method, system, device, and medium based on nighttime road image enhancement, which can improve the brightness and contrast of nighttime road images, thereby improving the accuracy of lane detection.

[0005] To achieve the above objectives, the present invention provides the following solution:

[0006] A lane line detection method based on nighttime road image enhancement includes:

[0007] The image to be tested is converted from RGB format to YCbCr format, and the Y channel of the image is extracted;

[0008] The CLAHE algorithm is used to enhance the contrast of the Y channel, and a dynamic mapping curve between the gamma value and the background brightness is constructed based on the relationship between the JND threshold and the background brightness.

[0009] Based on the dynamic mapping curve, an adaptive Gamma correction method is used to correct the brightness of different regions by applying dynamic gamma values, and the corrected image is converted from YCbCr format back to RGB format to obtain an optimized image.

[0010] The target lane lines are obtained by using the DBSCAN clustering algorithm and the multinomial fitting method to extract targets from the enhanced image.

[0011] Optionally, converting the image to be tested from RGB format to YCbCr format specifically includes:

[0012] The image to be tested is converted from an RGB image to a YCbCr color space using a format conversion formula, which is expressed as follows:

[0013]

[0014] In this context, the Y channel represents the brightness of the image, Cb represents the blue chromaticity component of the image, Cr represents the red chromaticity component of the image, and R, G, and B represent the red light intensity, green light intensity, and blue light intensity, respectively.

[0015] Optionally, the step of using the CLAHE algorithm to enhance the contrast of the Y channel specifically includes:

[0016] The Y channel image is divided into multiple rectangular blocks, and each block is independently subjected to histogram equalization.

[0017] Calculate the gray-level histogram for each small block, count the frequency of each gray-level pixel, and obtain the gray-level distribution of the image.

[0018] Set a limit value T. Based on the grayscale histogram of all small blocks, when the frequency H(i) of any grayscale level i exceeds T, the excess part is cropped to obtain the cropped histogram H'(i):

[0019] H'(i)=min(H(i),T)

[0020] Calculate the total number of cropped pixels S: S = ∑ i max(H(i)-T,0), when H(i)>T;

[0021] The cropped pixels are evenly distributed across all gray levels N to obtain the redistributed histogram H(i):

[0022] The boundaries of adjacent small blocks are smoothed using bilinear interpolation to obtain an equalized image;

[0023] The equalized images corresponding to each small block are recombined to obtain the image with enhanced contrast.

[0024] Optionally, in the process of applying dynamic gamma values ​​to correct the brightness of different regions using the adaptive gamma correction method, the method further includes constructing an adaptive gamma correction factor γ. jnd(x,y) :

[0025]

[0026] Among them, T lmax(x,y) K represents the maximum value of the visibility threshold, K represents the parameter used to adjust γjnd, A is the adjustment factor, and K is 0.5 and A is 0.6.

[0027] Optionally, the step of using the DBSCAN clustering algorithm and multinomial fitting method to extract targets from the enhanced image to obtain target lane lines specifically includes:

[0028] Perform perspective transformation on the enhanced image to generate scatter plot data;

[0029] The DBSCAN clustering algorithm is used to extract targets from the scatter plot data, and morphological operations are used to remove interfering noise points. Finally, a polynomial fitting method is used to extract the target lane lines. The morphological operations include at least erosion and dilation.

[0030] The present invention also provides a lane detection system based on nighttime road image enhancement, comprising:

[0031] The format conversion unit is used to convert the image under test from RGB format to YCbCr format and extract the Y channel from the image;

[0032] The contrast enhancement unit is used to enhance the contrast of the Y channel using the CLAHE algorithm, and to construct a dynamic mapping curve between the gamma value and the background brightness based on the relationship between the JND threshold and the background brightness.

[0033] The image correction unit is used to apply dynamic gamma values ​​to correct the brightness of different regions based on the dynamic mapping curve using an adaptive gamma correction method, and convert the corrected image from YCbCr format back to RGB format to obtain an optimized image.

[0034] The lane line extraction unit is used to extract targets from the enhanced image using the DBSCAN clustering algorithm and multinomial fitting method to obtain the target lane lines.

[0035] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to cause the electronic device to perform the lane detection method based on nighttime road image enhancement described above.

[0036] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the lane detection method based on nighttime road image enhancement as described above.

[0037] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0038] This invention discloses a lane detection method, system, device, and medium based on nighttime road image enhancement. The method includes converting the image to be tested from RGB format to YCbCr format and extracting the Y channel from the image; enhancing the contrast of the Y channel using the CLAHE algorithm and constructing a dynamic mapping curve between gamma value and background brightness based on the relationship between the JND threshold and background brightness; applying an adaptive gamma correction method to correct the brightness of different regions using dynamic gamma values ​​based on the dynamic mapping curve; converting the corrected image back from YCbCr format to RGB format to obtain an optimized image; and using the DBSCAN clustering algorithm and multinomial fitting method to extract targets from the enhanced image to obtain the target lane lines. This invention can improve the brightness and contrast of nighttime road images, thereby improving the accuracy of lane detection. Attached Figure Description

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

[0040] Figure 1 This is a schematic diagram showing the relationship between background brightness, JND threshold, and gamma value in this embodiment; where (a) shows the relationship between JND threshold and background brightness, and (b) shows the relationship between gamma value and background brightness based on JND.

[0041] Figure 2 The images shown are the DBSCAN clustering and multinomial fitting results in this embodiment; where (a) is the original image, (b) is the enhanced image, (c) is the DBSCAN clustering result, and (d) is the lane line fitting effect.

[0042] Figure 3 This is a flowchart of the algorithm in this embodiment;

[0043] Figure 4 The images show the enhancement effects of different algorithms on complex low-light images in this embodiment. The horizontal group (a) represents scene one, the horizontal group (b) represents scene two, the horizontal group (c) represents scene three, the horizontal group (d) represents scene four, and the horizontal group (e) represents scene five. The vertical group (a) represents the original image, the vertical group (b) represents the image after traditional Gamma correction, the vertical group (c) represents the image after linear Gamma correction, and the vertical group (d) represents the detection results of the algorithm in this embodiment.

[0044] Figure 5 This is a comparison chart of the image evaluation index results in this embodiment; wherein, (a) is a schematic diagram of the standard deviation results; (b) is a schematic diagram of the entropy results; (c) is a schematic diagram of the SSIM value results; and (d) is a schematic diagram of the peak signal-to-noise ratio.

[0045] Figure 6 This is a comparison of lane line detection results before and after image enhancement in different scenarios in this embodiment; where, the horizontal (a) group is an environment without streetlights, the horizontal (b) group is an environment with streetlights, the horizontal (c) group is a complex lighting environment, and the horizontal (d) group is a curved environment without streetlights; the vertical (a) group is the original image, the vertical (b) group is the enhanced image, the vertical (c) group is the detection result of the original image, and the vertical (d) group is the detection result of the enhanced image. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] The purpose of this invention is to provide a lane line detection method, system, device, and medium based on nighttime road image enhancement, which can improve the brightness and contrast of nighttime road images, thereby improving the accuracy of lane line detection.

[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0049] This invention provides a lane line detection method based on nighttime road image enhancement, comprising:

[0050] Step 100: Convert the image to be tested from RGB format to YCbCr format and extract the Y channel from the image;

[0051] Step 200: The contrast of the Y channel is enhanced using the CLAHE algorithm, and a dynamic mapping curve between the gamma value and the background brightness is constructed based on the relationship between the JND threshold and the background brightness.

[0052] Step 300: Based on the dynamic mapping curve, the adaptive Gamma correction method is used to correct the brightness of different regions by applying dynamic gamma values, and the corrected image is converted from YCbCr format back to RGB format to obtain the optimized image;

[0053] Step 400: Use the DBSCAN clustering algorithm and multinomial fitting method to extract the target from the enhanced image and obtain the target lane lines.

[0054] As a specific implementation method, the implementation principle of the above steps is as follows:

[0055] Applications of color space conversion:

[0056] Images captured by visual sensors are typically represented in RGB (red, green, blue) format. This format combines hue, brightness, and saturation, making it difficult to extract brightness information separately. To address this issue, this embodiment converts RGB images to YCbCr format, where the Y channel represents the image's brightness, Cb represents the blue chromaticity component, and Cr represents the red chromaticity component. Since this embodiment focuses on enhancing images in low-light conditions, subsequent experiments will process the Y channel to improve processing efficiency.

[0057] RGB and YCbCr formats can be converted to each other. The formula for converting an RGB image to a YCbCr image is as follows:

[0058]

[0059] In this context, the Y channel represents the brightness of the image, Cb represents the blue chromaticity component of the image, Cr represents the red chromaticity component of the image, and R, G, and B represent the red light intensity, green light intensity, and blue light intensity, respectively.

[0060] Applications of the CLAHE algorithm:

[0061] Contrast-Limited Adaptive Histogram Equalization (CLAHE) is an image enhancement algorithm that combines histogram equalization, contrast limiting, and bilinear interpolation. It is widely used to improve the local contrast of images, especially showing significant enhancement effects in low-contrast regions. Its main steps are as follows:

[0062] Step 1: Image segmentation

[0063] The input image is divided into multiple small rectangular regions (called "tiles" or "blocks"). Each small block is independently histogram equalized, thereby enhancing the contrast of the local region.

[0064] Step 2: Calculate the grayscale histogram

[0065] Calculate the grayscale histogram for each small block, count the frequency of each grayscale pixel, and obtain the grayscale distribution of the image.

[0066] Step 3: Histogram cropping

[0067] To prevent excessive contrast from affecting the visual effect, a limit value T is set. When the frequency H(i) of a certain gray level i exceeds T, the excess part is cropped: the histogram of each block is cropped to limit the maximum frequency of a certain gray level: H'(i) = min(H(i), T).

[0068] Calculate the total number of cropped pixels S: S = ∑ i max(H(i)-T,0), when H(i)>T.

[0069] The cropped pixels are evenly distributed across all gray levels N to obtain the redistributed histogram H(i):

[0070] Step 4: Histogram Equalization

[0071] Equalization is applied to the cropped histogram to redistribute the gray levels, thereby enhancing the image's contrast and making the brightness distribution more uniform.

[0072] Step 5: Bilinear Interpolation

[0073] By using bilinear interpolation to smooth the boundaries of adjacent small blocks, the transition areas of the image are ensured to be smooth, thereby avoiding blockiness.

[0074] Step 6: Image Reconstruction

[0075] All the equalized patches are recombined into a complete image to obtain the enhanced output image.

[0076] When using the CLAHE algorithm alone to process images with significant brightness differences, the following problems may occur: areas with high contrast (such as oncoming headlights, streetlights, and vehicle headlights in nighttime road images) can lead to excessively high local brightness and a decrease in overall contrast. Furthermore, because the CLAHE algorithm uniformly distributes the histogram exceeding the cropping threshold, it may cause the loss of some detailed information in the input image. To address these issues, this embodiment introduces an adaptive gamma correction algorithm based on the JND (Just Noticeable Difference) model. The JND model dynamically adjusts the gamma value in conjunction with background brightness, enabling adaptive correction for different brightness areas, compensating for the shortcomings of the CLAHE algorithm, and thus more effectively enhancing the brightness and contrast of road images under low-light and complex lighting conditions while preserving image detail.

[0077] For JND-based adaptive Gamma correction:

[0078] To address the common problem of low and uneven brightness distribution in nighttime road images, this embodiment proposes an adaptive gamma correction method based on the JND (Just Noticeable Difference) model. The nonlinear relationship between the JND visibility threshold and background brightness is calculated and used as the basis for dynamic adjustment of the gamma value. Specifically, the gamma value is significantly increased in low grayscale regions, effectively enhancing the brightness and contrast of these areas; in mid-to-high grayscale regions, the gamma value gradually decreases to avoid image distortion. The nonlinear relationship between the JND visibility threshold and background brightness can be expressed by the following formula:

[0079]

[0080] Among them, T l(x,y) I is the visibility threshold. (x,y) The local average background brightness of the input image is the pixel located at (x,y).

[0081] The calculation formula for the JND-based adaptive gamma correction method is as follows:

[0082]

[0083] Where V out(x,y) V refers to the normalized brightness image after adaptive gamma correction. in(x,y) Given the input normalized brightness image, γ jnd(x,y)This is a JND-based gamma correction factor used to adjust image contrast. Specifically, when γ < 1, the image becomes brighter overall, especially with significant enhancement of dark details; when γ = 1, the image maintains its original brightness without any change; when γ > 1, the image becomes darker overall, while bright details become more prominent. Nighttime road images suffer from uneven brightness distribution due to the influence of oncoming headlights and streetlights. Therefore, this embodiment proposes an adaptive gamma correction based on JND for processing. In dark areas, a γ value less than 1 is used to increase brightness and enhance details in dark areas, making them clearer; in bright areas, a γ value greater than 1 is used to reduce brightness, decrease overexposure, and highlight details in bright areas.

[0084] In this embodiment, the adaptive gamma correction factor is derived from the visibility threshold through a mathematical model, and is expressed as:

[0085]

[0086] Among them, T lmax(x,y) K represents the maximum value of the visibility threshold, K represents the parameter used to adjust γjnd, A is the adjustment factor, and in the technology proposed in this embodiment, K is 0.5 and A is 0.6.

[0087] Applications of the DBSCAN clustering algorithm:

[0088] DBSCAN (Density-Based Spatial Clustering) is a clustering method based on sample density, where cluster division depends entirely on the density distribution characteristics between samples. The degree of clustering can be described by two parameters: Eps (cluster radius) and MinPts (minimum number of cluster points). When the number of neighboring samples within a sample's cluster radius reaches or exceeds the minimum number of cluster points, the sample and its neighbors are assigned to the same cluster; conversely, if the number of neighboring samples is insufficient, the sample is considered noise. A major advantage of this algorithm is its ability to effectively identify clusters of arbitrary shapes, its suitability for non-convex datasets, and the fact that it does not require pre-specifying the number of clusters, adaptively clustering based on sample density. The specific calculation steps are as follows:

[0089] Step 1: Randomly select a sample object p from the sample set D that is not assigned to any cluster and is not labeled;

[0090] Step 2: Calculate the size of the r-neighborhood of sample p | N r (p)|, find |N r Points whose (p)|≥MinPts are marked as core points;

[0091] Step 3: Initialize cluster C at the core point p, add all points in the neighborhood of r to cluster C, and continue to expand cluster C if there are other core points in the neighborhood.

[0092] Step 4: Repeat the above steps until all samples have been assigned to the specified clusters, and finally output the cluster sets C1, C2...Cn.

[0093] Based on the above technical solution, the following is provided: Figures 1-6 The specific application examples shown are used to analyze the effectiveness of the technical solution by setting the experimental environment and obtaining experimental results.

[0094] Experimental environment and overall plan

[0095] The image dataset used in the experiment consists of two parts: one is the Exclusively-Dark-Image dataset, which contains more than 7,000 images under low light conditions; the other is 2,800 road images under low light conditions selected from the CULane public dataset. The selected images cover a variety of complex interference situations, including the presence or absence of streetlights, road surface damage, interference from road markings, vehicles obscuring lane lines, and interference from oncoming high beams.

[0096] Lane detection process in low-light environments, as follows: Figure 3 As shown: First, the RGB image is converted to the YCbCr color space, and the Y channel is processed independently. The specific processing flow includes JND-based gamma correction and the application of the CLAHE algorithm to enhance the image's brightness and contrast. Then, perspective transformation is performed on the processed low-light image to generate scatter plot data. The scatter plot is analyzed using the DBSCAN clustering algorithm to extract the target point set, and morphological operations such as erosion and dilation are combined to remove interfering noise points. Finally, a multinomial fitting method is used to extract lane lines.

[0097] Algorithm Enhancement Results and Analysis

[0098] Evaluation Metric: Standard deviation represents the dispersion of image pixel values ​​relative to the mean. Generally, a larger standard deviation indicates a more dispersed grayscale value distribution and better image quality; conversely, a smaller standard deviation indicates a more concentrated grayscale value distribution and poorer image quality. For a grayscale image I(x,y) of size M×N, its standard deviation δ is:

[0099]

[0100] In the formula:

[0101]

[0102] Entropy (or information entropy) is a metric used in information theory to measure the amount of information in an image; it represents the average information content of the image. A higher entropy value indicates that the image contains more information, more detail, and therefore better image quality. Its entropy value E is:

[0103]

[0104] In the formula: p(i) is the probability of gray value i appearing in the image.

[0105] Peak signal-to-noise ratio (PSNR) is a metric that measures the ratio between useful signal and noise. A higher PSNR indicates better image quality after enhancement. PSNR is defined as:

[0106] PSNR=10·lg((2 n -1) 2 / MSE)

[0107] in:

[0108]

[0109] The Structural Similarity Index (SSIM) assesses the similarity between images before and after enhancement in terms of brightness, contrast, and structure, more accurately reflecting human subjective perception of image quality. A higher SSIM indicates greater similarity between the images before and after enhancement. Given two images, a and b, before and after enhancement, the SSIM is calculated as follows:

[0110]

[0111] Where, μ a and μ b These are the average brightness values ​​of images a and b, respectively. and The variances of a and b are σ, respectively. ab It is the covariance of images a and b, reflecting structural similarity.

[0112] Experimental results

[0113] This experiment randomly selected five complex low-light images containing lane lines from the Exclusively-Dark-Image dataset as test samples. To improve the reliability and persuasiveness of the experimental results, these five images underwent three processing methods: gamma correction with a fixed gamma value, gamma correction with a linearly varying gamma value, and image enhancement compared to the algorithm in this embodiment. The enhancement effect was evaluated from two aspects: subjective visual effect and objective evaluation metrics. The evaluation metrics used included standard deviation, entropy value, peak signal-to-noise ratio (PSNR), and structural similarity index (SSIM).

[0114] Depend on Figure 4 It can be seen that the gamma correction methods with fixed gamma values ​​and linearly varying gamma values ​​can improve the overall brightness of low-light images to some extent, but at the same time, they can cause overexposure in bright areas of the original image. Furthermore, both methods introduce a large number of noise points into the road area, significantly reducing the accuracy of subsequent lane line fitting using the DBSCAN algorithm. In contrast, the image enhanced by the algorithm in this embodiment not only significantly improves the brightness of the road area but also effectively avoids overexposure and the introduction of noise points, resulting in a superior enhancement effect.

[0115] like Figure 5 As shown, the box plots for the four evaluation metrics further validate the superiority of the algorithm in this embodiment. Although the algorithm in this embodiment is slightly inferior to the Gamma correction methods with fixed gamma and linearly transformed gamma values ​​in terms of standard deviation and entropy, it significantly outperforms these two methods in terms of structural similarity (SSIM) and peak signal-to-noise ratio (PSNR). Therefore, it can be concluded that the enhancement algorithm proposed in this embodiment is superior to the other two Gamma correction methods in both subjective visual effects and objective evaluation metrics.

[0116] Improved Low-Light Road Image Processing Method: Lane Fitting Experiment Verification. To further verify the enhancement effect of the algorithm in this embodiment on nighttime road images, the experiment combined the DBSCAN clustering algorithm with a multinomial fitting method to detect lane lines in the acquired nighttime road images. A total of 2800 road images were tested, and the detection accuracy results are shown in Table 1. Simultaneously, the lane line detection results for typical environments (such as no streetlights, streetlights, complex lighting, and curves without streetlights) are selected for demonstration (e.g., lane line detection in curves without streetlights). Figure 6 (As shown). The figure includes the original image, the enhanced image, and the results of lane line detection based on these two types of images.

[0117] Table 1 Comparative Analysis of Lane Detection Results Before and After Image Enhancement Table 1 Comparative Analysis of Lane Detection Results Before and After Image Enhancement

[0118]

[0119]

[0120] Depend on Figure 6 As can be seen, the original image, due to insufficient lighting or complex illumination, easily misses some lane lines and has low detection accuracy, resulting in inaccurate fitting results. In contrast, the enhanced image effectively improves lane line detection by enhancing the visibility of low-brightness areas. The enhancement process significantly improves the completeness and accuracy of lane line detection, enabling more accurate detection and fitting of all lane lines.

[0121] in conclusion

[0122] To further improve the accuracy of lane detection at night, this embodiment proposes a nighttime road image enhancement method based on JND-Gamma correction. This method studies the relationship between the JND (Minimum Perceptible Difference) threshold and background brightness, and fully utilizes the independent characteristics of the brightness channels in the YCbCr color space to perform adaptive Gamma correction on the brightness channels based on JND, thereby enhancing the nighttime road image. Subsequently, lane detection is performed using the DBSCAN clustering algorithm and a multinomial fitting method. Experiments were conducted on two datasets. From the image enhancement effect and experimental data, compared with the other two methods, the method in this embodiment performs better in terms of visual effect, while effectively avoiding the problem of noise amplification. In complex lighting and low-light nighttime road environments, the lane detection accuracy reached 96.4%. This embodiment significantly improves the accuracy and completeness of lane detection on nighttime roads.

[0123] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0124] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A lane line detection method based on nighttime road image enhancement, characterized in that, include: The image to be tested is converted from RGB format to YCbCr format, and the Y channel of the image is extracted; The CLAHE algorithm is used to enhance the contrast of the Y channel, and a dynamic mapping curve between the gamma value and the background brightness is constructed based on the relationship between the JND threshold and the background brightness. Based on the dynamic mapping curve, an adaptive Gamma correction method is used to correct the brightness of different regions by applying dynamic gamma values, and the corrected image is converted from YCbCr format back to RGB format to obtain an optimized image. The target lane lines are obtained by using the DBSCAN clustering algorithm and the multinomial fitting method to extract targets from the enhanced image.

2. The lane line detection method based on nighttime road image enhancement according to claim 1, characterized in that, The process of converting the image to be tested from RGB format to YCbCr format specifically includes: The image to be tested is converted from an RGB image to a YCbCr color space using a format conversion formula, which is expressed as follows: In this context, the Y channel represents the brightness of the image, Cb represents the blue chromaticity component of the image, Cr represents the red chromaticity component of the image, and R, G, and B represent the red light intensity, green light intensity, and blue light intensity, respectively.

3. The lane line detection method based on nighttime road image enhancement according to claim 1, characterized in that, The contrast enhancement of the Y channel using the CLAHE algorithm specifically includes: The Y channel image is divided into multiple rectangular blocks, and each block is independently subjected to histogram equalization. Calculate the gray-level histogram for each small block, count the frequency of each gray-level pixel, and obtain the gray-level distribution of the image. Set a limit value T. Based on the grayscale histogram of all small blocks, when the frequency H(i) of any grayscale level i exceeds T, the excess part is cropped to obtain the cropped histogram H'(i): H'(i)=min(H(i),T) Calculate the total number of cropped pixels S: S = ∑ i max(H(i)-T,0), when H(i)>T; The cropped pixels are evenly distributed across all gray levels N to obtain the redistributed histogram H(i): The boundaries of adjacent small blocks are smoothed using bilinear interpolation to obtain an equalized image; The equalized images corresponding to each small block are recombined to obtain the image with enhanced contrast.

4. The lane line detection method based on nighttime road image enhancement according to claim 1, characterized in that, The process of applying dynamic gamma values ​​to correct the brightness of different regions using the adaptive gamma correction method also includes constructing an adaptive gamma correction factor γ. jnd(x,y) : Among them, T lmax(x,y) K represents the maximum value of the visibility threshold, K represents the parameter used to adjust γjnd, A is the adjustment factor, and K is 0.5 and A is 0.

6.

5. The lane line detection method based on nighttime road image enhancement according to claim 1, characterized in that, The step of using the DBSCAN clustering algorithm and multinomial fitting method to extract targets from the enhanced image to obtain target lane lines specifically includes: Perform perspective transformation on the enhanced image to generate scatter plot data; The DBSCAN clustering algorithm is used to extract targets from the scatter plot data, and morphological operations are used to remove interfering noise points. Finally, a polynomial fitting method is used to extract the target lane lines. The morphological operations include at least erosion and dilation.

6. A lane detection system based on nighttime road image enhancement, characterized in that, include: The format conversion unit is used to convert the image under test from RGB format to YCbCr format and extract the Y channel from the image; The contrast enhancement unit is used to enhance the contrast of the Y channel using the CLAHE algorithm, and to construct a dynamic mapping curve between the gamma value and the background brightness based on the relationship between the JND threshold and the background brightness. The image correction unit is used to apply dynamic gamma values ​​to correct the brightness of different regions based on the dynamic mapping curve using an adaptive gamma correction method, and convert the corrected image from YCbCr format back to RGB format to obtain an optimized image. The lane line extraction unit is used to extract targets from the enhanced image using the DBSCAN clustering algorithm and multinomial fitting method to obtain the target lane lines.

7. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the lane detection method based on nighttime road image enhancement according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the lane detection method based on nighttime road image enhancement as described in any one of claims 1-5.