Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 12, No. 3, 2025 59 A Comparative Study on Edge Detection Algorithms for Automotive Lighting Systems Sen Ye 1, Mingge Sun 1, *, Jian Li 2, Dongxuan Huang 1, Jiaxuan Chai 1 1 School of Information and Control Engineering, Jilin Institute of Chemical Technology, Jilin, Jilin 132022, China 2 China Petroleum Jilin Petrochemical Company, Jilin, Jilin 132021, China * Corresponding author: Mingge Sun Abstract: To address the challenges of edge blurring, noise interference, and insufficient adaptability of conventional algorithms in automotive headlamp inspection, this study proposes an optimized edge detection method integrating the Canny and Marr-Hildreth operators. Leveraging Gaussian filtering and a dynamic weighting fusion strategy, the proposed approach combines the gradient sensitivity of the Canny operator with the second-order differential characteristics of the Marr-Hildreth operator, effectively balancing detail preservation and noise suppression. Experimental results demonstrate that the improved algorithm significantly reduces edge localization errors in low-beam images compared to traditional methods, meeting the engineering requirements for automotive safety inspection. Keywords: Canny Operator; Marr-Hildreth Operator; Edge Detection; Headlamp Inspection; Image Processing. 1. Introduction Headlamps, as the primary electrical lighting devices for nighttime driving, play a critical role in road safety, with beam projection alignment being a mandatory inspection item in vehicle safety certification. Conventional inspection methods relying on manual operations or mechanical calibration equipment suffer from inefficiency and significant spatial constraints. In recent years, machine vision technology has introduced a novel non-contact measurement approach for headlamp inspection. However, the robustness of existing algorithms under complex working conditions remains challenged: 1 The low-beam cut-off line exhibits blurred characteristics due to scattering effects, where traditional edge detection operators (e.g., Sobel, Prewitt) are prone to noise interference, resulting in insufficient positioning accuracy; 2 Non-uniform light intensity distribution and environmental illumination fluctuations impose stricter requirements on image stability, with current detection systems often compromised by suboptimal exposure control, thereby affecting measurement repeatability. 2. Edge Detection Overview 2.1. Common Edge Detection Algorithms Image edge detection techniques can be categorized into three classical methodologies: 1. Traditional frequency-domain analysis, including Fast Fourier Transform (FFT) and Wavelet Transform, which extract edges by analyzing spectral characteristics of images; 2. Gradient-based differential operators, which locate edges through grayscale gradient computation, with representative methods such as the Sobel operator, Prewitt operator [1-2], and the Canny operator [3] known for its multi-stage detection capability; 3. Modern feature decomposition approaches, exemplified by Bidimensional Empirical Mode Decomposition (BEMD), which adaptively decompose image signals to capture edge features. In practical applications, optimal balance among detection accuracy, edge continuity, and algorithmic adaptability requires comprehensive consideration of image characteristics, noise interference, and precision requirements, achieved through algorithm comparison and parameter optimization. 2.2. Application of Edge Detection Algorithms in Headlamp Inspection Headlamp inspection typically involves sequential processing steps: geometric transformation [4], color processing [5], feature extraction [6], edge extraction [7], edge detection [8], and image segmentation [9]. Low-beam pattern inspection constitutes a critical component of vehicle safety certification, directly impacting road safety and regulatory compliance. National standards mandate strict specifications for parameters including light pattern distribution, cut-off line clarity, and light spot symmetry. Edge detection methods in image processing enable efficient and precise extraction of light pattern contours, providing technical support for automated inspection systems. In practical implementations, after capturing high- resolution images of headlamp projections on standardized screens, edge detection algorithms rapidly localize pattern boundaries to identify inflection points of cut-off lines, light spot geometries, and diffusion ranges. For instance, quantitative analysis of geometric features in edge contours can verify whether cut-off lines exhibit the required clear 15° horizontal-oblique transition or whether light spots maintain uniform symmetry. Furthermore, these algorithms detect abnormal light pattern diffusion or distortion caused by assembly errors or lens degradation. Compared to traditional visual inspection, image-based edge detection significantly enhances inspection efficiency (≈68% time reduction) and consistency (CV < 3.5%). Its non- contact nature eliminates human interference while enabling multi-parameter synchronization through computer vision, automatically generating inspection reports. Future integration of hybrid algorithms combining deep learning with edge detection is expected to improve robustness in complex environments (e.g., ±10% illuminance variation tolerance), advancing headlamp quality control toward 60 intelligent and standardized paradigms. 3. Headlamp Inspection Method Based on Canny and Marr-Hildreth Operators 3.1. Headlamp Image Detection Process The headlamp image detection process ensures light pattern compliance through standardized procedures. First, the vehicle headlamps are aligned with the detection screen, and a high-resolution camera captures the projected light pattern image. Next, the image undergoes preprocessing (e.g., noise reduction, contrast enhancement) before edge detection techniques are applied to extract the light pattern contours and cut-off line. Subsequently, the system analyzes light spot symmetry, cut-off line angle, and luminance distribution, comparing them with national standard parameters. Finally, a detection report is generated to determine compliance or anomalies. This process relies on automated systems to achieve efficient and precise evaluation of lighting performance. 3.2. Detection Principle and Application of Canny Operator Compared to Sobel and Prewitt operators, the Canny algorithm demonstrates superior performance. Sobel and Prewitt operators have the following limitations: they fail to fully utilize the gradient direction of edges, and the resulting binary images are simply processed using a single threshold. The Canny algorithm improves upon these aspects by introducing: Non-maximum suppression based on edge gradient direction; Hysteresis thresholding with dual thresholds [10]. Original Image Gaussian Smoothing 1/2 1/2 -1/2 -1/2 -1/2 1/2 -1/2 1/2 Gradient Magnitude Non- Maximum Suppression Threshold Selection Edge Detection GX Gy Fig 1. Canny Edge Detection Algorithm Process To reduce noise while preserving edge information, a two- dimensional Gaussian kernel with effective denoising capabilities can be applied through a single convolution operation. As a linear filter, the Gaussian filter is derived by sampling and normalizing the two-dimensional Gaussian function. In the Canny operator, the adopted two-dimensional Gaussian function is defined by Equation (1) and Equation (2). By applying this filter, noise is suppressed while retaining edge features in the image, providing a more accurate foundation for subsequent edge detection. , exp 2 1 ∗ 2 where:  represents the Gaussian filter obtained by sampling and normalizing the 2D Gaussian function;  denotes the input headlamp image to be detected;  ∗ indicates the convolution operation;  is the resulting digital headlamp image after Gaussian filtering. For an edge with a normal direction , the gradient components and in the and directions at pixel points along this edge are given by Equation (3): 1, 1, 2 1, 1 , 1 2 3 The gradient magnitude and orientation at the pixel are respectively given by: arctan 4 To suppress non-maximum values in the image gradient magnitude, the gradient magnitude is compared with the gradient magnitudes of neighboring pixels along its gradient direction . Only the pixel locations where is a local maximum are retained. These positions are identified as the central information of image edges, effectively refining edge localization by eliminating non-maximal responses. 3.3. LOG Operator (Marr-Hildreth Operator) Detection Principle and Applications Marr-Hildreth edge detection is a classical and important method for image edge detection. Its core lies in the Gauss- Laplace filter 2G 2G, which can be expressed as: , , , 2 exp 2 5 where is the Laplace operator , and , exp is the two-dimensional Gaussian function. In classical image processing, the Marr-Hildreth edge detection method first convolves an image , with the LoG filter, defined as: , , ∗ , 6 Subsequently, zero-crossing points in , are identified to determine the edge positions of , . A zero-crossing at pixel indicates that at least two adjacent pixels have opposite signs. Four cases must be tested: Left/Right, Up/Down (horizontal and vertical neighbors), Two diagonal directions (diagonal neighbors). In practice, a 61 threshold is set. A pixel is considered a zero-crossing pixel if and only if the absolute difference in grayscale values between adjacent pixels exceeds this threshold. This ensures robust detection of true edges while suppressing noise- induced false positives. 4. Experimental Data and Result Analysis 4.1. Comparative Experiments Fig 2. result of algorithm one Fig 3. result of algorithm two Fig 4. result of algorithm three In this experiment, the performance of three different image processing algorithms for edge detection in automotive headlights was compared. The first method employed Gaussian filtering, a Laplacian of Gaussian (LoG) operator, and Hough transform, with results shown in Figure 2. Gaussian filtering was used to smooth the image and reduce noise, the Laplacian operator detected edges in the image, and the Hough transform performed line detection. While this method suppressed noise and extracted partial edge information, the Hough transform detected overly dense lines in the lower half of the headlight, resulting in long processing times and excessive unnecessary information. The second method applied Gaussian filtering and smoothing, followed by edge detection using the Laplacian operator, and introduced non-maximum suppression and morphological operations for optimization, as shown in Figure 3. Non-maximum suppression removed redundant edge points to retain the strongest edges, while morphological operations further eliminated noise and connected broken edges. Although this method improved edge detection through optimization steps, the results still contained excessive detail, particularly with unclear detection of the lower edges. Fig 5. Improve the detection results of the algorithm The third method combined Gaussian filtering, threshold segmentation, mask filling, Canny edge detection, and the Marr-Hildreth algorithm, with results shown in Figure 4. Gaussian filtering smoothed the image, threshold 62 segmentation converted it into a binary image, and mask filling processed specific lower regions of the image. Tailored to headlight detection, mask filtering was applied to occlude irrelevant areas, enhancing overall image purity and reducing interference for subsequent processing. Canny edge detection, a gradient-based method, effectively extracted edges, while the Marr-Hildreth algorithm identified edges through the Laplacian operator and zero-crossing detection. Experimental results demonstrated that the third method achieved the highest accuracy and clarity in edge detection, effectively extracting headlight edges while minimizing noise and redundant information. The final result is shown in Figure 5. In summary, the third method demonstrates significant advantages in automotive headlight edge detection by combining multiple effective algorithms. Future research could further optimize algorithm parameters to improve both the efficiency and accuracy of edge detection, thereby better meeting the practical application requirements. To verify the measurement accuracy of the operator edge detection method, experiments were conducted using the PBT-GF-10 headlamp, and the experimental data obtained are presented in Table 1. The actual horizontal center and vertical center represent the inflection point positions, while the left and right edges correspond to the actual left and right positions of the light pattern in the captured images. Detection Value 1 was obtained using the Canny edge detection and Marr-Hildreth algorithms, with the corresponding errors termed Error 1. Detection Value 2 was derived from the system employing the Roberts cross differential operator, with its corresponding errors labeled Error 2. Table 1. Test result The actual position of the lighting value Actual value (mm) Detection Value 1 (mm) Error 1(mm) Detection Value 2(mm) Error 2 (mm) Horizontal center 223 226 3 230 7 Vertical center 184 190 6 175 9 Left edge 178 168 10 170 8 Right edge 189 195 6 175 14 5. Conclusion This paper conducted an in-depth study on edge detection technology for automotive low-beam projection images and proposed a comprehensive method integrating Gaussian filtering, threshold segmentation, mask filling, Canny edge detection, and the Marr-Hildreth algorithm. By applying Gaussian filtering to suppress image noise, utilizing threshold segmentation and mask filling to highlight target regions, and combining Canny edge detection with the Marr-Hildreth algorithm, the method achieves high-precision edge extraction. Compared to traditional single-operator detection approaches, this method demonstrates significant advantages in edge detection accuracy and clarity, enabling clearer identification of headlight contours and details. Experimental results validate the effectiveness of the proposed method, with measured values closely aligned to actual values and significantly improved measurement accuracy. Future research will focus on optimizing algorithm parameters and exploring more efficient image processing techniques to enhance both speed and accuracy of edge detection, meeting stringent real-time and precision requirements in practical applications. References [1] Sobel I. Camera models and machine perception[R]. Computer Science Department, Technion, 1972. [2] Prewitt J M S. Object enhancement and extraction[J]. Picture processing and Psychopictorics,1970, 10(1): 15-19. [3] Canny J. A computational approach to edge detection[J]. IEEE Transactions on pattern analysis and machine intelligence, 1986 (6): 679-698. [4] LEP Q, ILIYASU A M, DONG F, et al. Fast Geometric Transformations on Quantum Images [J]. IAENG International Journal of Applied Mathematics, 2010, 40(3): 113-123. [5] JIANG N, WU W Y, WANG L, et al. Quantum Image Pseudo Color Coding Based on the Density-Stratified Method [J]. Quantum Information Processing, 2015, 14(5) : 1735-1755. [6] ZHANG Y, LU K, XU K, et al. Local Feature Point Extraction for Quantum Images [J]. Quantum Information Processing, 2015, 14(5): 1573-1588. [7] ZHANG Y, LU K, GAO Y H. QSobel: A Novel Quantum Image Edge Extraction Algorithm [J]. Science China (Information Sciences), 2014, 58: 012106-1-012106-13. [8] YAO X W, WANG H, LIAO Z, et al. Quantum Image Processing and Its Application to Edge Detection: Theory and Experiment [J]. Physical Review X, 2017, 7(3): 1-14. [9] SIMONA C, VASILE I M. Image Segmentation on a Quantum Computer [J]. Quantum Information Processing, 2015, 14(5): 1693-1715. [10] Sarangi S, Rath N P. Performance Analysis of Fuzzy-based Canny Edge Detector[C]//Proc. of ICCIMA’07. Sivakasi, India: IEEE Press, 2007.