Projection chessboard-based headlamp calibration method and related device

CN122906170APending Publication Date: 2026-10-13深圳市欧冶半导体有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611373274.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0005]本申请旨在提供一种基于投影棋盘格的车灯标定方法及相关装置,以解决在投影棋盘格标定的方案中部分角点未被有效检测,从而造成角点集出现不规则缺失,以及,当角点发生缺失时,容易导致缺失位置之后的角点索引整体偏移、错位,进而导致角点与世界坐标之间的对应关系错误,进而影响标定的准确性的问题

Benefits of technology

本申请实施例相对于现有车灯标定方案采用按图像坐标对角点集合直接排序分配行列索引、且要求角点集合完整可见与拍摄角度近似正视的方式,本申请实施例首先获取标定图像中检测到的角点坐标集;其中,角点坐标集包括投影至标定面的棋盘格的多个交叉点在标定图像中的像素坐标;其次,根据角点坐标集确定目标投影角度;并将角点坐标集中的角点沿目标投影角度进行方向投影,得到投影结果;然后,根据投影结果进行聚类,得到多个聚类簇;根据多个聚类簇确定角点对应的行列索引和聚类置信度;根据行列索引和聚类置信度对角点进行筛选,得到目标角点集;最后,确定目标角点集在世界坐标系中的对应关系;根据对应关系对目标角点集中的目标角点进行标定求解,得到标定参数;其中,标定参数包括被测灯具的光轴偏转角和照射距离。如此,由于根据角点坐标集确定目标投影角度;并将角点坐标集中的角点沿目标投影角度进行方向投影,得到投影结果;然后,根据投影结果进行聚类,得到多个聚类簇,使得角点索引分配过程不依赖完整角点集合,即使部分角点缺失,仍能够基于剩余角点之间的空间分布关系建立角点索引关系,从而降低因角点缺失导致索引整体偏移的风险。进一步的,根据所述多个聚类簇确定所述角点对应的行列索引和聚类置信度;根据所述行列索引和所述聚类置信度对所述角点进行筛选,得到目标角点集,并基于目标角点集中的目标角点与世界坐标建立对应关系,能够提高输入标定求解过程中的角点对应精确度,进而,提高环境受限条件下车灯标定结果的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906170A_ABST
    Figure CN122906170A_ABST
Patent Text Reader

Abstract

The application provides a car lamp calibration method based on a projected chessboard and related devices, and belongs to the technical field of intelligent automobiles. The method comprises the following steps: acquiring a set of corner point coordinates detected in a calibration image; determining a target projection angle according to the set of corner point coordinates, and directionally projecting the corner points in the set of corner point coordinates along the target projection angle to obtain a projection result; clustering according to the projection result to obtain a plurality of clustering clusters, determining the row and column indexes corresponding to the corner points and the clustering confidence according to the plurality of clustering clusters, screening the corner points according to the row and column indexes and the clustering confidence to obtain a set of target corner points; determining the corresponding relationship of the set of target corner points in a world coordinate system; and calibrating and solving all the target corner points in the set of target corner points according to the corresponding relationship to obtain calibration parameters, wherein the calibration parameters comprise the deflection angle of the optical axis of a measured lamp and the irradiation distance. In this way, the accuracy of car lamp calibration can be improved in a production line or other environment-limited scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent vehicle technology, and in particular to a method and device for vehicle headlight calibration based on a projection checkerboard grid. Background Technology

[0002] Inaccurate headlight illumination can dazzle oncoming drivers, while low beams can reduce illumination distance. Therefore, effective headlight calibration is crucial during vehicle production. Existing headlight calibration methods primarily rely on a projection checkerboard approach. Currently, most existing projection checkerboard headlight calibration schemes use corner detection algorithms to return a complete set of corner points. These corner points are then directly sorted according to image coordinates to assign row and column indices, establishing a correspondence between the corner points and the checkerboard world coordinate system for headlight calibration.

[0003] The projection checkerboard headlight calibration scheme requires the checkerboard to be fully visible in the image, and the camera's shooting angle to be approximately head-on. However, in environments with limited space, such as factory production lines, the camera's installation space restricts the shooting angle, causing perspective distortion in the arrangement of the checkerboard corner points in the image. Simultaneously, fluctuations in production line lighting and the headlights' own glare can lead to overexposure or underexposure in the acquired images, resulting in some corner points not being effectively detected. This causes irregular gaps in the corner point set. Furthermore, when corner points are missing, the indexes of the corner points following the missing locations are easily shifted or misaligned, leading to errors in the correspondence between corner points and world coordinates, thus affecting the accuracy of the calibration.

[0004] Therefore, improving the accuracy of vehicle headlight calibration is an urgent issue to be addressed in environments with limited space, such as factory production lines. Summary of the Invention

[0005] This application aims to provide a vehicle headlight calibration method and related apparatus based on a projected checkerboard grid, in order to solve the problems that in the projected checkerboard grid calibration scheme, some corner points are not effectively detected, resulting in irregular missing corner point sets, and when corner points are missing, the overall index of the corner points after the missing position is easily offset or misaligned, which leads to an error in the correspondence between the corner points and world coordinates, thus affecting the accuracy of the calibration.

[0006] To achieve the objectives of this application, the following solutions are provided: In a first aspect, this application provides a vehicle headlight calibration method based on a projected checkerboard pattern, applied to electronic devices in a vehicle headlight calibration fault-tolerant system, the method comprising: Obtain the set of corner coordinates detected in the calibration image; the set of corner coordinates includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image; The target projection angle is determined based on the set of corner coordinates; the corner points in the set of corner coordinates are projected along the target projection angle to obtain the projection result; and the projection result is clustered to obtain multiple clusters. The row and column indices and cluster confidence scores corresponding to the corner points are determined based on the multiple clusters; the corner points are then filtered based on the row and column indices and the cluster confidence scores to obtain a target corner point set; Determine the correspondence of the target corner point set in the world coordinate system; perform calibration and solution on all target corner points in the target corner point set according to the correspondence to obtain calibration parameters; the calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

[0007] Secondly, this application provides a vehicle lamp calibration device based on a projected checkerboard grid, applied to an electronic device in a vehicle lamp calibration fault-tolerant system, the device comprising: The acquisition module is used to acquire the set of corner coordinates detected in the calibration image; the set of corner coordinates includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image; The control module is used to determine the target projection angle based on the corner coordinate set; project the corner points in the corner coordinate set along the target projection angle to obtain the projection result; and perform clustering based on the projection result to obtain multiple clusters. The determination module is used to determine the row and column indices and cluster confidence scores corresponding to the corner points based on the multiple clusters; and to filter the corner points based on the row and column indices and the cluster confidence scores to obtain a target corner point set. The calculation module is used to determine the correspondence of the target corner point set in the world coordinate system; and to perform calibration and solution on all target corner points in the target corner point set according to the correspondence to obtain calibration parameters; the calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

[0008] Thirdly, this application provides an in-vehicle chip SoC, which includes a processor, a memory, a communication interface, and a program stored in the memory; when the program is executed by the processor, the in-vehicle chip SoC performs some or all of the steps described in any of the methods in the first aspect of the embodiments of this application.

[0009] Fourthly, this application provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in any of the methods of the first aspect of the embodiments of this application.

[0010] Fifthly, this application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any method of the first aspect of the embodiments of this application. The computer program product may be a software installation package.

[0011] By implementing the vehicle headlight calibration method and related device based on a projected checkerboard pattern provided in this application, the following beneficial effects are achieved: Compared to existing vehicle headlight calibration schemes that directly sort and assign row and column indices to the corner point set based on image coordinates and require the corner point set to be completely visible and approximately face-up from the shooting angle, this embodiment first obtains the corner point coordinate set detected in the calibration image. This corner point coordinate set includes the pixel coordinates of multiple intersections of a checkerboard pattern projected onto the calibration surface in the calibration image. Next, the target projection angle is determined based on the corner point coordinate set. The corner points in the coordinate set are then projected along the target projection angle to obtain the projection result. Next, clustering is performed based on the projection result to obtain multiple clusters. The row and column indices and cluster confidence scores corresponding to the corner points are determined based on these clusters. The corner points are then filtered based on the row and column indices and cluster confidence scores to obtain the target corner point set. Finally, the correspondence of the target corner point set in the world coordinate system is determined. The target corner points in the target corner point set are calibrated based on the correspondence to obtain calibration parameters. These calibration parameters include the optical axis deflection angle and illumination distance of the tested lamp. Thus, by determining the target projection angle based on the corner coordinate set and projecting the corner points in the coordinate set along the target projection angle to obtain the projection result, and then clustering based on the projection result to obtain multiple clusters, the corner index allocation process does not depend on the complete corner set. Even if some corner points are missing, the corner index relationship can still be established based on the spatial distribution relationship between the remaining corner points, thereby reducing the risk of overall index offset due to missing corner points. Furthermore, the row and column indices and cluster confidence scores corresponding to the corner points are determined based on the multiple clusters; the corner points are filtered based on the row and column indices and the cluster confidence scores to obtain the target corner set, and a correspondence is established between the target corner points in the target corner set and the world coordinates. This improves the accuracy of corner point correspondence in the input calibration solution process, thereby improving the accuracy of vehicle headlight calibration results under environmentally constrained conditions. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is an architecture diagram of a vehicle headlight calibration fault-tolerant system provided in an embodiment of this application; Figure 2 This is a software architecture diagram of a vehicle headlight calibration method based on a projected checkerboard pattern provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an automotive chip SoC provided in an embodiment of this application; Figure 4 This is a flowchart illustrating a vehicle headlight calibration method based on a projected checkerboard pattern provided in an embodiment of this application. Figure 5 This is a schematic diagram of corner point normalization and projection clustering provided in an embodiment of this application; Figure 6 This is a flowchart of the functional modules of a vehicle headlight calibration method based on a projected checkerboard pattern provided in an embodiment of this application; Figure 7 This is a flowchart illustrating another vehicle headlight calibration method based on a projected checkerboard pattern provided in this application embodiment; Figure 8 This is a functional module block diagram of a vehicle headlight calibration device based on a projection checkerboard pattern provided in an embodiment of this application. Detailed Implementation

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

[0015] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0016] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, "multiple" refers to two or more.

[0017] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.

[0018] In this application, the term "connection" refers to various connection methods, such as direct connection or indirect connection, to achieve communication between devices. This application does not impose any limitations on this.

[0019] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] The following is an explanation of the relevant terms used in this application: Checkerboard calibration: Checkerboard calibration is a classic and widely used technique in machine vision (especially camera-based systems) for calibrating camera intrinsic parameters (focal length, principal point, distortion coefficient) and extrinsic parameters (camera position and orientation relative to the world coordinate system). Its quality directly, significantly and in many ways affects the final visual measurement and positioning accuracy.

[0021] The following is combined with Figure 1 and Figure 2 The system architecture of a vehicle headlight calibration method based on a projected checkerboard grid, as described in an embodiment of this application, is explained. Please refer to... Figure 1 , Figure 1 This is an architecture diagram of a vehicle headlight calibration fault-tolerant system provided in an embodiment of this application. The vehicle headlight calibration fault-tolerant system 100 includes an electronic device 110 and a calibration processing device 120 disposed in the electronic device 110.

[0022] The electronic device 110 is used to acquire a calibration image corresponding to the headlight to be calibrated and provide data for headlight calibration processing to the calibration processing device 120. In some embodiments, the electronic device 110 may include a device with image acquisition, data processing, or data interaction capabilities, such as an industrial computer, server, calibration workstation, or other terminal device with computing capabilities. The electronic device 110 can be connected to an image acquisition device to acquire a checkerboard image projected onto the calibration surface, wherein the checkerboard image includes corner information corresponding to multiple intersections of the projected checkerboard; the electronic device 110 can also send the acquired calibration image to the calibration processing device 120 to perform subsequent corner detection, corner index recovery, and headlight calibration processing.

[0023] The calibration processing device 120 can analyze the checkerboard corner points in the calibration image, determine the corresponding projection direction based on the corner point distribution characteristics, and perform clustering processing on the corner points based on the determined projection direction to restore the row and column index relationship corresponding to the corner points. Furthermore, the calibration processing device 120 can perform consistency verification and correction on the corner point index based on the topological relationship between the corner points and the clustering confidence, and complete the solution of the vehicle lamp calibration parameters based on the corrected target corner points.

[0024] In one possible embodiment, the calibration processing device 120 may include a projection angle determination unit 121, a clustering unit 122, a row and column index determination unit 123, a calibration solution unit 124, an index correction unit 125, and a consistency verification unit 126. The projection angle determination unit 121 can acquire the pixel coordinates corresponding to multiple detected corner points and normalize the set of corner point coordinates to reduce the influence of different shooting scales on the angle calculation results. Furthermore, the projection angle determination unit 121 can search for multiple candidate projection angles within a preset search range and determine the target projection angle based on the cluster compactness of the corner points after projection at different projection angles. The clustering unit 122 can project the corner point coordinates along the direction corresponding to the target projection angle, converting the original two-dimensional corner point distribution into projection data with directional characteristics, and clustering based on the projected corner point distribution to obtain multiple clusters corresponding to different directional arrangements of the checkerboard pattern. In some embodiments, clustering unit 122 can determine the number of clusters based on checkerboard grid specifications and determine multiple cluster centers based on the distance relationship between projected coordinates, thereby improving the stability of corner point clustering under oblique shooting conditions. Row and column index determination unit 123 can determine the cluster center corresponding to each cluster and sort the cluster centers according to the arrangement relationship of the cluster centers in different reference directions, thereby determining the row index and column index corresponding to each corner point, and obtaining the row and column index information corresponding to the corner point. At the same time, row and column index determination unit 123 can also determine the corresponding cluster confidence degree according to the projection compactness of the cluster to which the corner point belongs, so as to characterize the reliability of the corner point index allocation result. Consistency verification unit 126 can determine the neighboring corner points in different directions around the target corner point according to the spatial topological relationship between the corner points of the checkerboard grid, and use the row and column indices corresponding to the neighboring corner points to vote on the expected row and column index corresponding to the target corner point; further, consistency verification unit 126 can determine the voting weight according to the confidence information corresponding to the cluster to which the neighboring corner points belong, and determine the voting consistency score corresponding to the target corner point according to the weighted voting result. The index correction unit 125 is used to correct the row and column indices corresponding to the corner points based on the consistency check results. When the current row and column index of a corner point is detected to be inconsistent with the expected row and column index determined based on the neighborhood topology, the index correction unit 125 can adjust the corner point index according to the consistency check results to eliminate index misalignment problems caused by missing checkerboard corner points, detection anomalies, or shooting tilt, and obtain the corrected target corner point information. The calibration and solution unit 124 can establish the correspondence between the target corner point and the world coordinate system, and perform calibration calculations on the target corner point according to the correspondence to obtain the calibration parameters corresponding to the headlights.

[0025] As can be seen, through the architecture of the aforementioned vehicle headlight calibration fault-tolerant system 100, the electronic device 110 can acquire the calibration image corresponding to the projected checkerboard pattern. The calibration processing device 120 then sequentially completes the corner point direction determination, corner point clustering, index recovery, anomaly correction, and calibration solution processes through the projection angle determination unit 121, clustering unit 122, row and column index determination unit 123, consistency verification unit 126, index correction unit 125, and calibration solution unit 124. Compared to the prior art method that relies on complete checkerboard corner points and directly sorts them according to image coordinates to determine the index, this embodiment optimizes the projection direction and uses an index correction mechanism based on the checkerboard topology. This ensures that even with tilted shooting angles, missing corner points, or image quality fluctuations, a stable and reliable corner point index relationship can still be obtained, thereby improving the accuracy and robustness of the vehicle headlight calibration results.

[0026] Please continue reading Figure 2 , Figure 2 This is a software architecture diagram of a vehicle headlight calibration method based on a projected checkerboard pattern provided in an embodiment of this application. As can be seen, the architecture includes a data input layer, an application service layer, and a result output layer.

[0027] The data input layer includes camera-acquired images, projection device images, checkerboard pattern specifications, and calibration system parameters. Camera-acquired images provide calibration image data acquired during the headlight calibration process, including a checkerboard pattern projected onto the calibration surface. Projection device images provide image information corresponding to the projected checkerboard pattern to assist in determining the positional relationship of the checkerboard intersections. Checkerboard pattern specifications characterize the structural information of the projected checkerboard pattern, including the number and arrangement of intersections. Calibration system parameters provide system configuration parameters for the headlight calibration process, used in subsequent calibration calculations. The application service layer includes: "Module A: Corner Index Reconstruction," "Module B: Consistency Verification," and "Module C: Fault Tolerance and Degradation Mechanism." Module A is used to acquire corner coordinates, determine projection direction, and recover corner indexes based on the input calibration images. Specifically, firstly, corner coordinate sets in the calibration image are obtained through corner detection and preprocessing operations, and the corner coordinates are normalized to reduce the impact of image scale changes on subsequent calculations. Then, a target projection direction suitable for the current shooting conditions is determined through projection angle search, and the corners are projected based on this direction. Further, clustering and index allocation are performed based on the projected corner distribution to establish a correspondence between corners and checkerboard row and column positions, outputting the index and confidence score. Module B is used to perform topological consistency judgment on the corner index results output by Module A to reduce the impact of missing corners caused by shooting tilt, lighting changes, or headlight glare on the calibration results. Specifically, Module B includes steps such as nearest neighbor weighted voting verification, global consistency verification, singular corner identification, comprehensive confidence score calculation, adaptive weight generation, and outputting the corner set. The calibration process is divided into several modules: Nearest Neighbor Weighted Voting Verification (NNVV) determines the support weights of neighboring corners based on their spatial proximity and corresponding clustering confidence; Global Consistency Verification determines whether the corner index conforms to the overall chessboard pattern; Singular Corner Identification identifies corners that may have index errors or abnormal positions; Comprehensive Confidence Calculation merges local neighborhood voting results and clustering confidence to determine the reliability of the corners; Adaptive Weight Generation adjusts the corresponding verification weights based on the corner status; and finally, the target corner set after consistency verification is output. Module C dynamically adjusts the calibration process when the number of corners is insufficient or the calibration accuracy does not meet requirements. Specifically, it first performs calibration solution and error evaluation, calculates calibration parameters based on the target corner set and the corresponding world coordinate relationship, and determines whether the current calibration result meets the accuracy requirements.If the judgment result is "yes", that is, when the accuracy requirement is met, the calibration parameters are output and the calibration is marked as successful; if the judgment result is "no", that is, when the accuracy requirement is not met, the effective calibration area is adjusted by step-by-step area reduction and the effective area is updated; then the index is returned and rebuilt to re-obtain reliable corner point information based on the adjusted effective area, thereby improving the fault tolerance of vehicle lamp calibration in a constrained environment.

[0028] The output layer outputs the results of the vehicle lamp calibration, including calibration parameters, confidence information, and system logs. Calibration parameters include optical axis deflection angle and illumination distance, characterizing the optical installation status of the lamp under test. Confidence information includes corner confidence and calibration confidence level, used to evaluate the reliability of the current calibration results. System logs include degradation level and operation logs, used to record abnormal handling status and system operation information during the calibration process.

[0029] Through the aforementioned software architecture, this application sets up corner index reconstruction, consistency verification, and fault tolerance degradation mechanisms in the application service layer. This enables the recovery of the row and column index relationships corresponding to the corner points even when the chessboard image is taken at an angle, has missing corner points in some areas, or has fluctuating image quality. The vehicle headlight calibration is then completed based on reliable corner points, which improves the adaptability of the vehicle headlight calibration process to complex production environments and the accuracy of the calibration results.

[0030] The following is combined with Figure 3 The electronic devices in the embodiments of this application will be described. Figure 3 This is a schematic diagram of the structure of an automotive chip SoC provided in an embodiment of this application, as shown below. Figure 3 As shown, the vehicle-mounted chip SoC 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321. The processor 310 is connected to the memory 320 and the communication interface 330 via an internal communication bus.

[0031] The one or more programs 321 are stored in the memory 320 and configured to be executed by the processor 310. The one or more programs 321 include instructions for performing any step in the above embodiment of the vehicle headlight calibration method based on a projection checkerboard.

[0032] The processor 310 can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, cells, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication unit can be a communication interface, transceiver, transceiver circuitry, etc., and the storage unit can be a memory.

[0033] The memory 320 can be volatile memory or non-volatile memory, or it can include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache.

[0034] It is understood that the automotive SoC 300 may include more or fewer structural components than those shown in the block diagram above, such as a power module, physical buttons, a Wi-Fi module, a speaker, a Bluetooth module, sensors, and a display module, etc., without limitation. It is understood that the automotive SoC 300 can perform functions such as... Figure 2 The software architecture of the vehicle headlight calibration method based on the projection checkerboard grid.

[0035] After understanding the software and hardware architecture of this application, the following will be combined with... Figure 4 This application describes a vehicle headlight calibration method based on a projected checkerboard grid, as described in its embodiments. Figure 4 This is a flowchart illustrating a vehicle headlight calibration method based on a projected checkerboard pattern, provided in an embodiment of this application. The method is applied to electronic devices in a vehicle headlight calibration fault-tolerant system, and specifically includes the following steps: Step S401: Obtain the set of corner coordinates detected in the calibration image; the set of corner coordinates includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image.

[0036] First, a calibration image corresponding to the headlight to be calibrated is acquired using an image acquisition device. This calibration image includes a checkerboard pattern projected onto the calibration surface by a projection device. Next, the calibration image undergoes image preprocessing to enhance the checkerboard edge features and improve the feature response capability in subsequent corner detection. In some embodiments, image preprocessing may include grayscale conversion, noise filtering, and image enhancement. Then, a preset corner detection algorithm is used to detect multiple intersections in the checkerboard pattern and obtain the pixel coordinates of each intersection in the image coordinate system. In some embodiments, the corner detection algorithm can perform corner detection on the preprocessed image by calling the `findChessboardCorners` or `findChessboardCornersSB` method interface from vision libraries such as OpenCV, extracting the interior of the checkerboard. Sub-pixel coordinates of the intersection points The number of rows on the chessboard. This represents the number of columns in the chessboard grid. Finally, the detected corner pixel coordinates are aggregated, and the resulting set of corner coordinates is output. ,in, This is the index in the set of corner point coordinates. The set of corner point coordinates serves as input data for subsequent processes such as determining the projection direction, reconstructing the corner point index, and solving for calibration parameters.

[0037] It should be noted that in actual automotive lighting production line calibration scenarios, due to factors such as ambient light interference, projection area obstruction, changes in the headlight illumination range, and variations in calibration distance, some checkerboard corner points may be undetectable or their detection positions may be offset, resulting in an incomplete set of corner point coordinates relative to all corner points corresponding to the checkerboard. When corner points are missing, if the row and column indices of the currently detected corner points are still assigned according to the fixed arrangement order of the complete checkerboard corner points, the missing corner points can easily cause an overall offset or misalignment of the corner point indices after the missing position, leading to an incorrect correspondence between the corner points and world coordinates. Therefore, this embodiment does not require the corner point coordinate set to include all corner points corresponding to the complete checkerboard. Instead, it performs subsequent projection direction determination, clustering, and index reconstruction processes based on the currently detected valid corner points to establish the correspondence between the corner points and the checkerboard row and column positions even when the corner point coordinate set is incomplete. This reduces the impact of missing corner points on the calibration process and improves the environmental adaptability of the automotive lighting calibration process.

[0038] Step S402: Determine the target projection angle based on the corner coordinate set; project the corner points in the corner coordinate set along the target projection angle to obtain the projection result; perform clustering based on the projection result to obtain multiple clusters.

[0039] The target projection angle is a projection direction parameter used to project the corner points in the corner coordinate set, including the projection angle corresponding to the row direction and the projection angle corresponding to the column direction; the projection result includes the projection coordinates of each corner point in the corner coordinate set after being projected along the target projection angle; the cluster is a set of corner points divided according to the spatial distribution relationship between the projection coordinates, used to characterize the distribution of corner points in the same row or column of the chessboard.

[0040] Specifically, firstly, the corner coordinate set is analyzed, and the arrangement direction of the corner points is determined based on the spatial distribution characteristics of multiple corner points in the image coordinate system. Multiple candidate projection angles are sampled within a preset angle search range. Next, the corner points are projected according to the multiple candidate projection angles, and the corresponding projection compactness parameter is determined based on the concentration of the corner point projection distribution under different projection angles to evaluate the matching degree between the current projection direction and the checkerboard arrangement direction. Then, the target projection angle is determined based on the projection compactness parameters corresponding to the multiple candidate projection angles. The target projection angle has the smallest projection compactness parameter, indicating that after projection along this direction, the corner points in the same row or column can form a more compact projection distribution. Finally, each corner point in the corner coordinate set is projected along the target projection angle to obtain the corresponding projection result. Clustering is then performed based on the distance relationship between the projection coordinates to obtain multiple clusters.

[0041] As can be seen, by optimizing the projection direction of the corner point spatial distribution characteristics, the disordered corner points in the two-dimensional plane are transformed into a projection space with a clear arrangement pattern. The structural information of the checkerboard corner points is then recovered using the clustering features in the projection space. Compared to a method that directly scans in a fixed direction based on image coordinates, this embodiment does not require a complete checkerboard pattern or a preset scanning order. It can adaptively determine the projection direction based on the actual detected corner point distribution, effectively reducing corner point arrangement errors caused by headlight projection distortion, installation deviations, and missing corner points. This provides a reliable data foundation for subsequent corner point row and column index determination and calibration parameter calculation.

[0042] In one optional embodiment, determining the target projection angle based on the corner coordinate set includes: normalizing the corner coordinate set to obtain a normalized corner coordinate set; determining the target sampling angle and the target projection compaction parameter based on the normalized corner coordinate set; performing quadratic term curve fitting on the target sampling angle and the target projection compaction parameter to obtain a projection compaction fitting curve; and determining the target projection angle based on the projection compaction fitting curve; the target projection angle includes the projection angle in the row direction and the projection angle in the column direction.

[0043] The normalized corner coordinate set is a set of corner data obtained by scaling and centering the corner coordinate set. This is used to eliminate the influence of differences in calibration image size, acquisition distance, and corner distribution scale on the projection angle search process. The target projection compactness parameter is a parameter used to evaluate the degree of aggregation of corner points after projection along a preset projection direction. It characterizes the matching relationship between the current projection angle and the corner arrangement direction of the chessboard. When the projection direction is consistent with the row or column direction of the chessboard, the distribution of corner points in the same row or column after projection is more concentrated, and the corresponding projection compactness parameter is smaller. The target sampling angle is a sampling angle determined based on the refined search results and used for quadratic curve fitting. The target projection compactness parameter is the projection compactness parameter corresponding to the target sampling angle.

[0044] Specifically, the coordinates of each corner point in the corner coordinate set are normalized, mapping the distribution of corner points at different scales to a unified coordinate space, resulting in a normalized corner coordinate set. That is, the corner set... Calculate the centroid The average radius of dispersion s is calculated using the following formula: ; Where N is the total number of corner points in the corner coordinate set; For the first The x-coordinates of the corner points; For the first The ordinates of the corner points.

[0045] Then, according to A normalization transformation is performed so that the centroids of the corner points are located at the origin and the average distance to the centroid is a unit length. For the normalized first The x and y coordinates of each corner point; The coordinates are those of the centroid. The average discrete radius, This transformation eliminates the influence of image resolution on the cluster compactness threshold, and the transformation parameters... The data is recorded for use in the final inverse coordinate transformation. Finally, the target sampling angle and the target projection compaction parameter corresponding to the target sampling angle are used as data points for quadratic curve fitting. Quadratic curve fitting is performed to obtain the projection compaction fitting curve, and the target projection angle is determined based on the location of the minimum value of the projection compaction fitting curve. In some embodiments, dense sampling can be performed within the candidate interval, and five sampling points near the minimum value of the projection compaction parameter can be selected for quadratic curve fitting. The fitting quadratic polynomial... ,in, It is a quadratic polynomial function; The coefficients of the least squares fit are obtained by solving for... =0.1° sub-precision optimal projection angle.

[0046] In an optional embodiment, determining the target sampling angle and target projection compactness parameter based on the normalized corner coordinate set includes: acquiring multiple first projection angles within a preset first search angle range with a preset first step length; performing directional projection on each of the multiple first projection angles according to the normalized corner coordinate set, and determining the corresponding first projection compactness parameter based on the projected corner points; determining a second projection angle based on the first projection compactness parameter; and determining a target search angle range based on the second projection angle; sampling within the target search angle range with a preset second step length to obtain multiple sampling angles; and determining the second projection compactness parameter corresponding to the multiple sampling angles; wherein the second step length is less than the first step length; determining the minimum projection compactness parameter of the second projection compactness parameter; and determining the first sampling angle corresponding to the minimum projection compactness parameter; acquiring a preset number of multiple second sampling angles adjacent to the first sampling angle; determining the target sampling angle based on the first sampling angle and the multiple second sampling angles; and determining the target sampling angle based on the minimum projection compactness parameter and the projection compactness parameter corresponding to the multiple second sampling angles.

[0047] The first projection angle is a coarse-grained projection direction parameter obtained by long sampling in the first step within a large search range; the second projection angle is a candidate optimal projection direction determined based on the search results of the first stage, used to further narrow the angle search range; the target projection angle is the optimal projection direction determined after coarse search, fine search and curve fitting optimization, including the row direction projection angle used to characterize the row arrangement direction of the chessboard grid and the column direction projection angle used to characterize the column arrangement direction of the chessboard grid.

[0048] Specifically, within a preset first search angle range, multiple first projection angles are selected sequentially according to the first step length. Then, the corner points in the normalized corner coordinate set are projected according to each first projection angle to obtain the corner point projection distribution results under different projection directions. In some embodiments, the preset first search angle range is a column direction search range (30°, 150°) and a row direction search range (120°, 240°). The first step length is 5°. Then, a first projection compaction parameter is calculated based on the corner point projection distribution results corresponding to each projection direction, and a second projection angle is determined based on the first projection compaction parameters corresponding to multiple first projection angles. The smaller the first projection compaction parameter corresponding to the second projection angle, the closer the projection direction is to the actual arrangement direction of the checkerboard corner points. The formula for calculating the projection compaction parameter is: ; in, For angle The projection compactness parameters; This represents the projection rotation angle currently being tested; Corner point Classified by Kmeans to the th Cluster centers of a class; Corner point By angle Rotate the projected coordinates. This represents the total number of corner points; express and The squared value of the distance.

[0049] Then, the target search angle range is determined based on the second projection angle, and the target search range is: Within the target search angle range, fine sampling is performed at a second step size (0.1°) smaller than the first step size to obtain multiple sampling angles. Simultaneously, the second projection compaction parameter corresponding to each sampling angle is calculated. Further, the minimum projection compaction parameter is determined from the multiple second projection compaction parameters, and the first sampling angle corresponding to this minimum projection compaction parameter is obtained. The first sampling angle and a plurality of second sampling angles adjacent to the first sampling angle are defined as target sampling angles, and the projection compaction parameters corresponding to the first sampling angle and the plurality of second sampling angles are defined as target projection compaction parameters. In some embodiments, the target sampling angle includes the first sampling angle and the plurality of second sampling angles, and the target projection compaction parameter includes the projection compaction parameter corresponding to each target sampling angle.

[0050] It can be seen that by adopting a multi-stage projection angle search method from coarse to fine and combining it with a projection compact parameter evaluation mechanism, the adaptive determination of the corner point arrangement direction of the chessboard grid is achieved. At the same time, by performing a local fine search based on the coarse search results and further optimizing the angle estimation results by using quadratic term curve fitting, the calculation accuracy of the target projection angle can be improved, so that the subsequent corner point projection clustering process can obtain clearer row and column distribution characteristics, thereby improving the accuracy and robustness of the corner point index reconstruction and vehicle light calibration process.

[0051] In one optional embodiment, determining the plurality of second projection compact parameters corresponding to the plurality of sampling angles includes: projecting a direction onto each of the plurality of sampling angles in the normalized corner point coordinate set to obtain a plurality of projected corner points; clustering the plurality of projected corner points to obtain a plurality of projection clustering results; and determining the projection compact parameters corresponding to the plurality of projected corner points based on the plurality of projection clustering results to obtain the plurality of second projection compact parameters.

[0052] Among them, the projected corner point is a one-dimensional or two-dimensional spatial mapping result obtained by projecting the corner points in the normalized corner point coordinate set along the direction corresponding to the preset sampling angle, which is used to characterize the distribution characteristics of the corner points in the current projection direction; the projection clustering result is a set of multiple corner points divided according to the spatial distance relationship between the projected corner points, and each projection clustering result corresponds to a group of corner points with the same arrangement direction characteristics in the chessboard; the second projection compact parameter is a parameter used to evaluate the degree of corner point concentration in each projection clustering result in the projection result corresponding to the current sampling angle, which is used to reflect the degree of matching between the current sampling angle and the row and column arrangement direction of the chessboard.

[0053] Specifically, firstly, for each sampling angle obtained within the target search angle range, the corresponding projection direction is determined, and the corner points in the normalized corner point coordinate set are directionally projected according to the projection direction to obtain multiple projected corner points. Next, based on the positional relationship between the projected corner points corresponding to each sampling angle, cluster analysis is performed on the multiple projected corner points to divide the projected corner points with similar distribution characteristics in the projection space into the same cluster, obtaining the projection clustering result corresponding to the current sampling angle. Then, based on the positional distribution of the projected corner points in each projection clustering result, the distance relationship between each projected corner point and the center of its cluster is determined, and the projection compaction parameter corresponding to the current sampling angle is calculated based on the distance relationship. Finally, the multiple sampling angles are traversed, and the projection compaction parameter corresponding to each sampling angle is obtained respectively. The projection compaction parameters corresponding to the multiple sampling angles are determined as multiple second projection compaction parameters for subsequent optimization determination of the target projection angle.

[0054] It can be seen that by projecting the corner points at each candidate sampling angle and calculating the projection compactness parameter using the clustering results of the projected corner points, the projection angle evaluation process can fully combine the actual spatial distribution characteristics of the checkerboard corner points. In this way, the clarity of the checkerboard row and column structure under different projection angles can be accurately reflected. When the sampling angle is close to the actual checkerboard arrangement direction, the projected corner points can form a more compact and stable cluster structure, and the corresponding projection compactness parameter is smaller, thereby improving the accuracy of corner point index recovery and vehicle headlight calibration process.

[0055] In an optional embodiment, the projection result includes multiple projection coordinates. The step of clustering based on the projection result to obtain multiple clusters includes: determining the number of clusters for a preset clustering algorithm based on the specifications of the checkerboard grid; the specifications of the checkerboard grid are the number of intersections of the checkerboard grid; using the target projection coordinates as initial cluster centers and calculating the minimum distance between the multiple projection coordinates and the target projection coordinates to obtain multiple minimum clustering distances; the target projection coordinates are any one of the multiple projection coordinates; determining the maximum projection coordinate corresponding to the maximum value among the multiple minimum clustering distances; using the maximum projection coordinate as the next initial cluster center and iterating; stopping the iteration when the number of selected initial cluster centers equals the number of clusters; after each initial cluster center is selected, iteratively performing assignment and cluster center update on the multiple projection coordinates until the clustering result converges to obtain the multiple clusters.

[0056] Among them, the number of clusters is a parameter used to limit the number of clusters for projected coordinates, which is determined according to the specifications of the chessboard. The specifications of the chessboard include the number of intersections along the row and column directions, representing the arrangement structure of the theoretical corner points in the chessboard. The initial cluster center is an initial reference point used to represent the spatial position of each cluster. The minimum cluster distance is the minimum distance between any projected coordinate and all the currently determined initial cluster centers, used to represent the degree of spatial correlation between the projected coordinate and the existing cluster centers. The cluster is a set of projected corner points obtained by dividing according to the distance relationship between projected coordinates, and each cluster corresponds to the corner point distribution of a certain row or column in the projected chessboard.

[0057] Specifically, firstly, the number of clusters K corresponding to the clustering algorithm is determined based on the specifications of the chessboard grid. If the chessboard grid includes M intersections along a certain projection direction, then the number of clusters K=M in that direction is determined, ensuring the clustering result is consistent with the actual arrangement of the chessboard grid. Next, any target projection coordinate is selected from multiple projection coordinates as the first initial cluster center, denoted as […]. And calculate the remaining projected coordinates. Distance from the initial cluster center ,in, Indicates the first The Euclidean distance between each projected coordinate and the current cluster center is calculated. Then, the next initial cluster center is determined based on the minimum cluster distance corresponding to each projected coordinate. When multiple initial cluster centers already exist, for any projected coordinate... Calculate the distance between it and all selected cluster centers, determine the minimum distance, further determine the maximum value among multiple minimum cluster distances, and assign the maximum projected coordinates to it. This serves as the new initial cluster centers. This ensures that each newly added cluster center is located outside the coverage area of ​​the current cluster center, thereby improving the spatial separation between the initial cluster centers. Further, the initial cluster center selection process is repeated until the number of selected initial cluster centers reaches the preset number of clusters K, at which point the initial center selection operation stops. Subsequently, based on the determined K initial cluster centers, all projected coordinates are assigned to clusters, i.e., the distance between each projected coordinate and each cluster center is calculated, and the projected coordinates are assigned to the nearest cluster. Finally, the cluster centers are recalculated based on the distribution of projected coordinates within each cluster, and the projected coordinate assignment and cluster center update process is repeated until the change in cluster center position is less than a preset threshold or the clustering result no longer changes, resulting in the final multiple clusters.

[0058] For easier understanding, please refer to Figure 5 , Figure 5 This is a schematic diagram of corner point normalization and projection clustering provided in an embodiment of this application. As can be seen, firstly, corner point detection is performed on the image containing the checkerboard projection area, resulting in multiple detected corner points. An original corner point set is then formed based on the positional relationship of each corner point in the image coordinate system. In the coordinate system, the horizontal axis represents the x-direction in the image coordinate system, the vertical axis represents the y-direction, solid dots represent detected corner points, and dashed dots represent missing corner points that were not detected due to environmental interference, projection occlusion, or image quality issues. Since the acquired images may be affected by shooting distance, camera resolution, and changes in the projection area during actual vehicle headlight calibration, the corner point sets obtained in different scenarios may have different spatial scales. Therefore, it is necessary to first normalize the original corner point set. Furthermore, the centroids of the corresponding corner points are calculated based on the original set of corner points, and the centroids are used as the origin of the coordinate transformation. By calculating the average discrete radius of the corner point set relative to the centroid, the corner point coordinates are translated and scaled to ensure that the normalized set of corner points satisfies a distribution with an average discrete radius s=1 with the origin O as the origin. Figure 5 As shown in the diagram, "translation + scale normalization" and "origin O is the origin, average discrete radius s=1," after normalization, the influence of different image scales on subsequent cluster compactness calculations can be eliminated, allowing corner points to be projected and analyzed within a unified scale space. Furthermore, after normalizing the corner point coordinates, an optimal projection direction search is performed on the normalized set of corner points. For example... Figure 5 The optimal projection direction is obtained through a two-stage search. As shown, the system calculates the projection direction for both column and row directions. First, a coarse-grained angle search is performed within a preset angle range. By comparing the compactness of corner point clustering results under different projection angles, a range of candidate projection directions is determined. Then, a fine-grained angle search is performed within the candidate range, and the column projection direction is determined by combining the results with fitting calculations. and line projection direction This allows us to obtain the optimal projection direction that makes the corner point projection distribution more concentrated and facilitates clustering. Furthermore, based on the column direction projection angle... The normalized set of corner points is subjected to column-direction projection processing, and column-direction clustering is performed based on the projection results. For example... Figure 5 As shown in the "Column Direction Projection" diagram, each corner point is projected along the column direction to the corresponding projection axis. Based on the projection position, the corner points are clustered to obtain multiple column cluster centers C1, C2, ... The column cluster centers (sorted in ascending order of x) can be used to deduce column indices 0, 1, ... At the same time, based on the projection angle of the row direction. The normalized set of corner points is then subjected to row-direction projection processing, followed by row-direction clustering. For example... Figure 5 As shown in the “Row Direction Projection”, multiple row cluster centers R1, R2, etc. are obtained through row direction projection. The cluster centers of each row are arranged in ascending order along the y-axis and correspond to row indices 0, 1, ... Through the row-direction clustering and column-direction clustering described above, the row index and column index of each detected corner point in the chessboard grid can be determined. Further, a corner point index mapping relationship is established based on the row index and column index, and the index information and clustering confidence score corresponding to each corner point are output. Figure 5 As shown on the right, after projection clustering, a corner index matrix is ​​formed, which includes row and column indices, where the row indices are 0, 1, ... ; Column indexes are 0, 1, ... Each corner point outputs: (row index, column index, cluster confidence score). Specifically, each position in the matrix corresponds to a chessboard corner position, and the corresponding corner state is identified based on the actual detection results. Simultaneously, for each corner point, the corresponding "row index, column index, and cluster confidence score" are output, allowing subsequent modules to further optimize the corner index results based on nearest neighbor voting verification, global index sequence consistency verification, and singular corner identification. In this way, without relying on the complete chessboard corner detection results, the initial index reconstruction is completed using the spatial distribution characteristics between corner points, providing a reliable data foundation for subsequent index consistency verification and confidence-weighted calibration solutions. This processing achieves the initial row and column index allocation of corner points through corner coordinate normalization, two-stage projection direction search, and K-means clustering.

[0059] It can be seen that determining the number of clusters by the structural parameters of the projected checkerboard eliminates the need for manual parameter setting during the clustering process, improving the algorithm's adaptability to checkerboards of different sizes. Simultaneously, the initial cluster center selection strategy ensures that each initial cluster center is evenly distributed in the projected coordinate space, reducing the instability of the clustering results. Furthermore, by clustering the corner coordinates after directional projection, the disordered corner points in the two-dimensional image space are transformed into multiple clusters with clear arrangements, thereby improving the accuracy of corner matching and the robustness of the calibration results during vehicle headlight calibration.

[0060] Step S403: Determine the row and column indices and cluster confidence scores corresponding to the corner points based on the multiple clusters; filter the corner points based on the row and column indices and the cluster confidence scores to obtain a target corner point set.

[0061] Among them, the row and column indexes are index information used to characterize the spatial arrangement position of corner points in the projected checkerboard structure, including the row index for indicating the row position of the corner point and the column index for indicating the column position of the corner point; the cluster confidence is a parameter used to evaluate the reliability of the cluster to which the corner point belongs, and is used to characterize the spatial consistency between the corner point and the center of the corresponding cluster; the target corner point set is the set of valid corner points retained after index verification and confidence filtering, and is used to establish the correspondence between corner points in the image coordinate system and checkerboard intersection points in the world coordinate system.

[0062] Specifically, firstly, the cluster centers of each cluster are determined based on the spatial distribution characteristics of multiple clusters. Then, the clusters are sorted according to the arrangement of their centers along the target projection direction to determine their row and column positions. Next, each corner point is assigned a corresponding row and column index based on the sorting results, ensuring each corner point is associated with a preset structural position in the projected chessboard. Then, the clustering confidence of each corner point is determined based on the projection compactness parameter of its corresponding cluster. This parameter characterizes the distance between the corner point's projected coordinates and the corresponding cluster center; a smaller distance indicates higher clustering consistency and confidence. Finally, the detected corner points are filtered based on the row and column indices and the clustering confidence, removing those with abnormal indices or low clustering reliability, and retaining those that meet the preset filtering criteria to obtain the target corner point set.

[0063] It can be seen that by combining the spatial distribution characteristics of clustering and the clustering confidence of corner points, a structured reconstruction of the unordered set of corner points is achieved. Compared with the traditional method that relies on the detection results of the complete checkerboard and determines the corner point index according to a fixed scanning order, this method can adaptively restore the row and column relationships corresponding to the corner points based on the actual detected corner point distribution, and use the clustering confidence to identify and remove abnormal corner points. This reduces the impact of corner point detection errors, local missing values, and projection distortion on the corner point matching results, and improves the accuracy and stability of the subsequent world coordinate mapping and vehicle headlight calibration solution process.

[0064] In an optional embodiment, determining the row and column index and cluster confidence score corresponding to the corner point based on the plurality of clusters includes: determining a plurality of cluster centers corresponding to the plurality of clusters; assigning row and column index numbers to the plurality of cluster centers to obtain a plurality of cluster center row and column indices; determining the index of the corner point based on the cluster center row and column indices to obtain the row and column index corresponding to the corner point; determining the cluster confidence score corresponding to the corner point based on the projection compactness parameter corresponding to the cluster to which the corner point belongs; wherein the projection compactness parameter is the mean of the squares of the distances between the projected coordinates of the corner point and the cluster centers of its respective clusters.

[0065] The cluster center row and column index is an index number determined according to the arrangement order of multiple cluster centers in the projection space, used to describe the row and column positions of each cluster in the checkerboard structure; the row and column index corresponding to the corner point is the index information used to represent the actual arrangement position of a single corner point in the projected checkerboard, including the row index and column index; the projection compactness parameter is a parameter used to evaluate the density of the distribution of corner points within the cluster to which the corner point belongs, which is calculated based on the distance between the projected coordinates of each corner point in the cluster and the corresponding cluster center; the cluster confidence is used to characterize the reliability of the cluster to which the corner point belongs. The smaller the projection compactness parameter, the higher the positional consistency between the corner point and the center of its cluster, and the higher the corresponding cluster confidence.

[0066] Specifically, firstly, the cluster center of each cluster is determined based on the projected coordinates contained in the multiple clusters. Next, the multiple cluster centers are sorted according to their arrangement in the projection space, and a corresponding row and column index number is assigned to each cluster center. Specifically, the cluster centers can be sorted according to their coordinates projected in the row direction to determine the row index of each cluster center; simultaneously, they can be sorted according to their coordinates projected in the column direction to determine the column index of each cluster center, thus obtaining the row and column indexes of each cluster center. Then, based on the correspondence between the cluster to which a corner point belongs and the cluster center, the row and column indexes corresponding to the cluster centers are mapped to each corner point in that cluster to determine the row and column indexes corresponding to each corner point. Specifically, if a corner point... Belongs to the Clusters Then the row and column index corresponding to that corner point is determined by the first... The row and column indices of the cluster centers for each cluster are determined, enabling the disordered detection corner points to be restored to their structural positions corresponding to the projected checkerboard pattern. Further, the cluster confidence level for each corner point is determined based on the projection compactness parameter of its respective cluster. A smaller projection compactness parameter indicates that the projected corner points within that cluster are more concentrated around the cluster center, suggesting that the corner points of that cluster better conform to the checkerboard pattern. Conversely, a larger projection compactness parameter indicates that the corner point distribution within that cluster is more dispersed, potentially indicating corner point detection offset or cluster anomalies. Therefore, normalization based on the projection compactness parameter yields the corresponding cluster confidence level, which can be used for subsequent corner point filtering and index correction processes.

[0067] As can be seen, this embodiment automatically generates corner indexes based on the spatial arrangement features of clusters, which can adapt to complex situations such as missing corners, tilted projections, and local detection anomalies during vehicle headlight calibration. Furthermore, by introducing a projection compaction parameter calculated based on the mean squared distance between corners and cluster centers, the reliability of the cluster to which each corner belongs is quantitatively evaluated, improving the accuracy of corner matching and the stability of the vehicle headlight calibration results.

[0068] In one optional embodiment, assigning row and column index numbers to the plurality of cluster centers to obtain plurality of cluster center row and column indices includes: sorting the plurality of clusters along the column index direction according to the coordinates of each cluster center in the horizontal reference direction to obtain a column sorting sequence; and sorting the plurality of clusters along the row index direction according to the coordinates of each cluster center in the vertical reference direction to obtain a row sorting sequence; determining the row index of the cluster center corresponding to the corner point in the row direction according to the row sorting sequence; and determining the column index of the cluster center corresponding to the corner point in the column direction according to the column sorting sequence; and determining the row and column index corresponding to the corner point according to the row index and the column index.

[0069] The horizontal reference direction is used to characterize the column arrangement direction of the projected chessboard grid, corresponding to the horizontal direction in the image coordinate system; the vertical reference direction is used to characterize the row arrangement direction of the projected chessboard grid, corresponding to the vertical direction in the image coordinate system; the column sorting sequence is a sequence obtained by sorting multiple cluster centers according to the coordinate size relationship in the horizontal reference direction, used to determine the column direction position corresponding to different clusters; the row sorting sequence is a sequence obtained by sorting multiple cluster centers according to the coordinate size relationship in the vertical reference direction, used to determine the row direction position corresponding to different clusters; the cluster center row and column index is used to describe the arrangement number of each cluster in the projected chessboard grid structure, including the row index and column index; the corner point corresponding row and column index is the corner point structure position index determined according to the cluster center row and column index of the cluster to which the corner point belongs, used to establish the correspondence between the detected corner point and the theoretical intersection point of the chessboard grid.

[0070] Specifically, firstly, multiple cluster centers corresponding to multiple clusters are obtained, and the coordinate information of each cluster center in the horizontal and vertical reference directions is determined. Since the clusters after directional projection already have obvious one-dimensional arrangement characteristics, the cluster centers corresponding to clusters in different column directions have different positional distributions in the horizontal direction, and the cluster centers corresponding to clusters in different row directions have different positional distributions in the vertical direction. Next, for multiple clusters in the column index direction, they are sorted according to the coordinate values ​​of each cluster center in the horizontal reference direction, resulting in a column sorting sequence. Specifically, if the... The cluster centers corresponding to each cluster are represented as follows: Then based on the x-coordinate Sort multiple cluster centers in ascending or descending order: ; ; in, Represents the sorting function; This represents the column sorting sequence. The position of the sorted sequence is used to determine the index number of the corresponding cluster in the column direction.

[0071] Simultaneously, for multiple clusters along the row index direction, they are sorted according to the coordinate values ​​of each cluster center in the vertical reference direction, resulting in a row sorting sequence. Specifically, based on the ordinate of the cluster center... Sort: ; in, This represents the row sorting sequence. The position of the sorted sequence is used to determine the index number of the corresponding cluster in the row direction.

[0072] Then, the row index corresponding to the cluster to which each corner point belongs is determined based on the row sorting sequence, and the column index corresponding to the cluster to which each corner point belongs is determined based on the column sorting sequence. Specifically, for any corner point... If it belongs to the first Clusters First, determine the cluster centers corresponding to the clusters. Then, determine the corresponding index based on the position of the cluster center in the row sort sequence and the column sort sequence: ; in, For indexing functions; Indicates the first The row index corresponding to each corner point Indicates the first The column index corresponding to each corner point.

[0073] Finally, the row and column indices corresponding to the corner points are determined based on the combination of the row and column indices: , Indicates the first The two-dimensional row and column indices correspond to each corner point. In this way, the unordered projected corner points obtained by clustering can be mapped to the structural positions corresponding to the chessboard grid, restoring the spatial topological relationships between the corner points.

[0074] As can be seen, this embodiment determines the row and column indices of corner points by utilizing the spatial ordering relationship of cluster centers in the horizontal and vertical directions. This enables adaptive establishment of row and column index relationships based on the spatial distribution of actual projected corner points, effectively reducing index errors caused by projection rotation, viewing angle changes, and missing corner points during vehicle headlight calibration. Furthermore, by determining the index based on the cluster center position, the influence of single corner point detection deviations on the overall arrangement relationship can be avoided, improving the stability of corner point matching.

[0075] In an optional embodiment, the step of filtering the corner points according to the row and column indexes and the clustering confidence to obtain a target corner point set includes: dividing the other corner points into up, down, left, and right directional regions according to their relative azimuth angles to the first corner point, and determining the neighboring corner point corresponding to the minimum distance from the first corner point within each directional region, denoted as the second corner point; the first corner point is any one of the corner points; the other corner points are the corner points excluding the first corner point; determining the first row and column index corresponding to the first corner point according to the row and column indexes; and determining the second row and column index corresponding to the second corner point; root The voting result of the second corner point on the first corner point is determined based on the topological relationship between the first row and column indexes and the second row and column indexes; the voting result represents the support of the second corner point for the row and column indexes corresponding to the first corner point; the nearest neighbor voting weight corresponding to the second corner point is determined based on the cluster confidence of the cluster to which the second corner point belongs; the voting consistency score of the first corner point is determined based on the voting result and the nearest neighbor voting weight; the comprehensive confidence of the first corner point is determined based on the voting consistency score and the cluster confidence; the row and column indexes of the first corner point are corrected based on the comprehensive confidence to obtain the target corner point.

[0076] Among them, the relative azimuth angle is a parameter used to describe the directional relationship of other corner points relative to the first corner point in the image coordinate space, and is used to determine whether other corner points are located above, below, to the left, or to the right of the first corner point; the second corner point is the nearest neighboring corner point to the first corner point in the corresponding directional region, and is used to represent the local adjacency relationship of the first corner point in the checkerboard topology; the topological relationship is the positional association relationship between corner points based on the checkerboard arrangement pattern, including row-direction adjacency and column-direction adjacency; the voting result is the result determined based on the support of the row and column index of the second corner point to the current row and column index of the first corner point, and is used to evaluate the rationality of the index of the first corner point; the nearest neighbor voting weight is a weight parameter determined based on the clustering confidence of the cluster to which the second corner point belongs, and is used to measure the degree of influence of different neighboring corner points on the index correction process; the voting consistency score is an evaluation parameter obtained by combining the voting results of multiple neighboring corner points; the comprehensive confidence is a corner point evaluation index obtained by fusing the voting consistency score and the corner point clustering confidence, and is used to determine whether the index corresponding to the current corner point is reliable.

[0077] Specifically, firstly, for any first corner point in the set of corner points to be filtered, obtain all other corner points except the first corner point and calculate the relative azimuth angles of the other corner points relative to the first corner point. Based on the interval of the relative azimuth angle, divide the other corner points into four directional regions: up, down, left, and right. Calculate the Euclidean distance between the other corner points and the first corner point within each directional region. Then, select the corner point with the smallest distance from the first corner point in each directional region as the second corner point, thus obtaining the local neighborhood structure corresponding to the first corner point. Next, based on the determined corner point row and column indices, obtain the first row and column indices corresponding to the first corner point and the second row and column indices corresponding to the second corner point. Since adjacent corner points in the projected chessboard have fixed topological relationships—for example, for a point on the chessboard, the column number of the point to the right must be the coordinate of this point + 1; the row number of the point below must be the row number of this point + 1—each corner point can have its four neighbors "provide evidence." Therefore, the relationship between the first and second row and column indices can be used to determine whether the second corner point supports the current index of the first corner point. Furthermore, the voting result corresponding to the second corner point is determined based on the spatial directional relationship between the first and second corner points and the theoretical chessboard grid arrangement rules. For example, when the second corner point is located in the area to the right of the first corner point, if the column index corresponding to the second corner point satisfies: If the column index result of the second corner point is positively voted on by the first corner point, then if the above relationship is not satisfied, then it is determined to be a negative vote. Similarly, for the vertical region, the corresponding voting result is determined according to the row index change relationship. Then, the electronic device determines the corresponding nearest neighbor voting weight based on the clustering confidence of the cluster to which the second corner point belongs. Specifically, if the projection compactness parameter of the cluster to which the second corner point belongs is... The weights can then be determined based on the inverse relationship between the projection compactness parameter and the confidence level. .in, This indicates the nearest neighbor voting weight corresponding to the second corner point. This represents a function that maps the projection compactness parameter to the weight values. A smaller projection compactness parameter indicates a more concentrated cluster to which the second corner point belongs, and consequently, a higher voting weight. Further, the electronic device calculates the voting consistency score of the first corner point based on the voting results of each neighboring corner point and the nearest neighbor voting weight. It then integrates the cluster confidence score of the first corner point with the voting consistency score to determine the overall confidence score corresponding to the first corner point. ; in, This represents the overall confidence level corresponding to the first corner point. This represents the cluster confidence level corresponding to the first corner point. Indicates the first The confidence level corresponding to each cluster; This represents the fusion weighting coefficient.

[0078] Finally, the overall confidence level is used to determine whether the current row and column index of the first corner point meets the preset reliability conditions. When the overall confidence level is high, the current index information is maintained. When the overall confidence level is low, the row and column index of the first corner point is corrected according to the topological relationship of the neighboring corner points to obtain the corrected target corner point.

[0079] As can be seen, by combining the local neighborhood topological relationships of corner points with clustering confidence, the reliability evaluation and adaptive correction of corner point row and column indexes are achieved. Compared with methods that rely solely on clustering results to determine corner point indexes, this embodiment further utilizes the natural vertical and horizontal adjacency relationships between checkerboard corner points. By using a weighted voting method with multiple neighborhood corner points, the rationality of the index is judged, effectively identifying index errors caused by false detections, missed detections, or cluster boundary offsets. Simultaneously, by adjusting the voting contributions of different neighboring corner points using clustering confidence, reliable corner points have a higher influence weight on the correction process, improving the accuracy of index recovery.

[0080] In an optional embodiment, the step of correcting the row and column indices of the first corner point based on the comprehensive confidence score to obtain the target corner point includes: determining whether the first row and column indices corresponding to the first corner point meet a preset index consistency condition based on the comprehensive confidence score; if the first row and column indices meet the index consistency condition, then maintaining the first row and column indices corresponding to the first corner point; determining the target corner point based on the first row and column indices; if the first row and column indices do not meet the index consistency condition, then determining the relative positional relationship between the first corner point and the second corner point; determining at least one expected row and column indices corresponding to the first corner point based on the relative positional relationship and the second row and column indices; determining the target expected row and column indices corresponding to the first corner point based on the at least one expected row and column indices; replacing the first row and column indices corresponding to the first corner point with the target expected row and column indices; and updating the index information corresponding to the first corner point to obtain the target corner point set.

[0081] The index consistency condition is used to determine whether the current row and column indices of a corner point conform to the spatial topological rules of the projected checkerboard, and can be determined based on the comprehensive confidence level corresponding to the first corner point. The expected row and column index is the index result derived from the relative positional relationship between neighboring corner points and the second row and column index corresponding to the second corner point, used to determine the expected position of the first corner point in the projected checkerboard. The target expected row and column index is the final row and column index determined based on at least one expected row and column index, used to correct the current row and column index of the first corner point. The index information is information used to describe the structural position of the corner point, including the row index, column index, and confidence level information corresponding to the corner point. The target corner point is the valid corner point after index correction, whose corresponding row and column indexes satisfy the arrangement rules of the projected checkerboard, and can be used to establish the correspondence between the image coordinate system and the world coordinate system.

[0082] Specifically, firstly, the overall confidence score corresponding to the first corner point is obtained, and then the first row and column index corresponding to the first corner point is determined based on the overall confidence score to see if it meets the preset index consistency condition. Specifically, the overall confidence score of the first corner point can be... Compared with the preset confidence threshold Comparison: When the overall confidence level meets the preset conditions, it indicates that the clustering results and neighborhood topology of the first corner point have high reliability. Therefore, the first row and column index of the first corner point is determined to meet the index consistency condition, and the first row and column index remains unchanged. The target corner point is then determined based on the first row and column index. When the overall confidence level is less than the preset confidence threshold, it indicates that the current index of the first corner point may be affected by factors such as corner detection error, clustering offset, or local missing data, resulting in inconsistencies between its row and column index and the topology of surrounding corner points. Therefore, the relative positional relationship between the first and second corner points is further determined. Specifically, the spatial relationship between the two is determined based on the directional region of the second corner point. For example, when the second corner point is to the right of the first corner point, it is determined that the second corner point and the first corner point satisfy a forward adjacency relationship in the column direction; when the second corner point is to the left of the first corner point, it is determined that the two satisfy a reverse adjacency relationship in the column direction; when the second corner point is above or below the first corner point, it is determined that the two satisfy a row adjacency relationship.

[0083] Then, based on the relative positional relationship and the second row and column index corresponding to the second corner point, at least one expected row and column index corresponding to the first corner point is determined. Specifically, when the first corner point corresponds to a second corner point, an expected row and column index corresponding to the first corner point is derived based on the relative positional relationship between the second corner point and the first corner point and the second row and column index corresponding to the second corner point. If the second corner point is located to the right of the first corner point, and the second row and column index corresponding to the second corner point is: Then, based on the adjacency relationship of the chessboard grid, the expected row and column index of the first corner point is determined as follows: Similarly, if the second corner point is located to the left of the first corner point, then: If the second corner point is located above or below the first corner point, the corresponding expected row and column indices are determined based on the row index change relationship. Using this method, the correct structural position of the first corner point can be restored by utilizing the spatial topological constraints between adjacent corner points.

[0084] Furthermore, when a first corner point corresponds to multiple second corner points, multiple expected row and column indices can be determined based on the relative positions of the multiple second corner points and the first corner point, as well as the second row and column indices corresponding to the multiple second corner points. A consistency check can be performed on the multiple expected row and column indices, and the target expected row and column index corresponding to the first corner point can be determined based on the support of the multiple expected row and column indices. For example, the expected row and column index with the most support can be determined as the target expected row and column index, or the expected row and column index with the highest comprehensive weight can be determined as the target expected row and column index based on the comprehensive weights corresponding to the multiple second corner points. When a first corner point corresponds to only one second corner point, the expected row and column index corresponding to that second corner point can be directly determined as the target expected row and column index. Finally, the original first row and column index of the first corner point is replaced with the target expected row and column index, and the index information corresponding to the first corner point is updated synchronously, so that the corrected corner point index satisfies the chessboard arrangement pattern, thus obtaining the target corner point set.

[0085] As can be seen, this embodiment introduces an index correction mechanism based on comprehensive confidence, which, while retaining the high-reliability corner index results, performs topological constraint correction on the low-reliability corners, thus achieving adaptive optimization of the corner index results. Compared to the method of directly deleting abnormal corners, this embodiment can utilize the inherent spatial arrangement rules between chessboard corners to recover information on some abnormal corners, increasing the number of effective corners. Simultaneously, by combining the positional relationships of neighboring corners for index reasoning, the impact of local false detections, corner offsets, and clustering errors on the calibration results can be reduced, improving the completeness and accuracy of the target corner set.

[0086] Step S404: Determine the correspondence of the target corner point set in the world coordinate system; perform calibration and solution on all target corner points in the target corner point set according to the correspondence to obtain calibration parameters; the calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

[0087] Among them, the world coordinate system is a spatial coordinate system established with the calibration surface or the preset reference position of the projection checkerboard, which is used to describe the position of each intersection point in the projection checkerboard in the actual physical space; the correspondence relationship is the mapping relationship between the pixel coordinates of the target corner point in the image coordinate system and its actual spatial coordinates in the world coordinate system; the calibration solution is the calculation process of determining the transformation relationship between the camera coordinate system, the calibration surface coordinate system and the optical parameters of the tested lamp based on the correspondence relationship; the calibration parameters are the parameters used to evaluate the spatial attitude of the projected beam of the tested lamp, including the optical axis deflection angle and the illumination distance of the tested lamp.

[0088] Specifically, firstly, based on the row and column index information corresponding to each target corner point in the target corner point set, the structural position of each target corner point in the projected checkerboard is determined, and combined with the actual size parameters of the checkerboard, the physical coordinates of each target corner point in the world coordinate system are determined; nextly, based on the pixel coordinates of the target corner points in the calibration image and their corresponding world coordinates, a point-to-point mapping relationship between the image coordinate system and the world coordinate system is established to form a target corner point correspondence relationship for calibration; then, based on the correspondence relationship, all target corner points in the target corner point set are jointly solved to calculate the spatial transformation parameters required for the calibration process, and based on the spatial transformation parameters, the angular deviation between the projected beam of the tested lamp and the preset reference direction and the beam propagation distance are further determined; finally, the calibration parameters are output, wherein the calibration parameters include the optical axis deflection angle and illumination distance of the tested lamp to complete the vehicle lamp calibration process.

[0089] It can be seen that by establishing a reliable correspondence between image coordinates and world coordinates using the target corner point set after index reconstruction and confidence filtering, and by performing joint calibration based on multiple valid corner points, the error impact of abnormal corner points and missing corner points on the calibration results can be reduced, thereby improving the accuracy and stability of the calibration parameter solution. Simultaneously, by outputting key parameters such as optical axis deflection angle and illumination distance, a quantitative evaluation of the vehicle headlight projection performance is achieved, providing reliable data support for subsequent headlight adjustments, quality inspection, and automated production control.

[0090] For easier understanding, please refer to Figure 6 , Figure 6This is a functional module flowchart of a vehicle headlight calibration method based on a projected checkerboard pattern provided in this application embodiment. As can be seen, in the corner detection result input stage, the vehicle headlight calibration system first acquires the corner coordinate results collected by the camera and processed by corner detection. First, the "Module A: Initial Corner Index Allocation" process is executed. Specifically, Module A includes three processing steps: coordinate normalization, two-stage projection search, and K-means index allocation. Coordinate normalization is used to unify the scale of the input corner coordinates, mapping corner coordinates at different image scales and shooting distances to a unified coordinate space, thereby reducing the impact of image scale changes on subsequent projection angle search and clustering processes. After coordinate normalization, a two-stage projection search is performed. Specifically, first, multiple candidate projection directions are searched within a preset range, and a better projection direction is determined based on the distribution characteristics of the projected corners under different projection directions; further, the search range is narrowed near the better projection direction, and a second search is performed using a finer search step size, thereby determining the target projection direction that reflects the actual arrangement direction of the checkerboard pattern. By employing a two-stage projection search, the index offset problem caused by traditional image coordinate-based sorting methods can be mitigated when perspective tilt occurs in the checkerboard pattern due to camera installation angle limitations. After determining the target projection direction, K-means index allocation is further performed. Specifically, the corner coordinates are oriented and projected according to the target projection direction, and cluster analysis is performed based on the projection results to assign corners with the same orientation characteristics to corresponding clusters. Subsequently, the initial row and column indices corresponding to the corners are determined based on the spatial arrangement relationship of each cluster, resulting in the initial index results. These initial index results serve as input for the subsequent multi-level index verification process. After module A processes the initial allocation of corner indices, the resulting initial indexes are transferred to module B, where the "Module B: Multi-level Index Verification" step is executed. Specifically, module B includes nearest neighbor voting verification, global sequence verification, and singularity identification processes. Among these, nearest neighbor voting verification is used to determine the consistency of the initial index results based on the local spatial topological relationship between corners. Specifically, for any corner point to be verified, neighboring corner points are determined based on the spatial relationship between other corner points and this corner point. The theoretical index relationship of the current corner point is inferred based on the index information corresponding to the neighboring corner points. Simultaneously, the voting influence of different neighboring corner points is determined by combining the confidence information corresponding to the neighboring corner points, thereby obtaining the local consistency result of the current corner point index. After completing the nearest neighbor voting verification, a global sequence verification is further performed. Specifically, by analyzing the overall arrangement pattern of the chessboard corner points, the continuity of the corner point index sequence is checked to determine whether the current index result satisfies the continuous arrangement characteristics of the chessboard in the row and column directions. When local corner point missingness or abnormal detection causes the index sequence to become disordered or jump-like, the abnormal index is further verified through the global sequence relationship to improve the overall reliability of the corner point index result.After completing nearest neighbor voting verification and global sequence verification, singularity identification is performed. Specifically, by fusing local neighborhood relationships and global permutation relationships, corner points that may have index anomalies or positional anomalies are identified to reduce the impact of abnormal corner points on the subsequent calibration and solution process. After processing by modules A and B, the verified cluster set (Pk, ωk) is output, and the cluster set undergoes "refined set" processing, where Pk represents the corner point set after index recovery and consistency verification, and ωk represents the reliability weight information of the corresponding corner point or cluster. Subsequently, based on the cluster set (Pk, ωk), the confidence-weighted calibration solution (weighted PnP objective function optimization) step is performed. Specifically, in the confidence-weighted calibration solution stage, the confidence information corresponding to the corner points is introduced as a weight parameter into the calibration objective function. By applying differentiated constraints to corner points with different levels of reliability, reliable corner points have a greater impact on the calibration results, while reducing the interference of abnormal corner points or corner points in missing areas, thus obtaining more accurate vehicle lamp calibration parameters. After completing the confidence-weighted calibration solution, it is further determined whether the "reprojection error meets the standard". If the determination result is "yes", that is, when the reprojection error meets the requirements, the calibration result is output; the calibration result includes calibration parameters such as the vehicle lamp axis deflection angle and illumination distance calculated based on the target corner point set. If the determination result is "no", that is, when the reprojection error does not meet the requirements, the step of "Module C: Stepped Region Reduction (reducing the effective region in sequence, re-executing Module A and Module B)" is executed. Specifically, module C adjusts the effective area of ​​the chessboard grid involved in the calibration calculation step by step according to the strategy of reducing the effective area. By reducing the impact of abnormal or low-quality areas on the overall calibration process, the fault tolerance of the calibration process is improved. After the effective area adjustment is completed, a "loop retry" process is executed to re-execute the corner point index initialization allocation and multi-level index verification process in modules A and B. Based on the newly obtained corner point set, the confidence-weighted calibration solution is performed again, forming a loop iterative process until the calibration result that meets the accuracy requirements is output.

[0091] As can be seen, the embodiments of this application combine corner point index recovery, index consistency verification and calibration error control, avoiding the problem of subsequent overall index offset of corner points due to corner point loss in traditional methods. This makes the vehicle headlight calibration method applicable to complex industrial production environments such as limited shooting angles, significant changes in illumination and missing parts of the chessboard pattern, thereby improving the stability of the vehicle headlight calibration process and the accuracy of the calibration results.

[0092] In an optional embodiment, after calibrating and solving all target corner points in the target corner point set according to the correspondence to obtain calibration parameters, the method further includes: obtaining a first calibration result in response to the calibration parameters; when the first calibration result does not meet preset vehicle headlight calibration conditions, reducing the calibration region corresponding to the calibration image according to a preset step reduction strategy to obtain a reduced calibration region; determining a first corner point coordinate set corresponding to the reduced calibration region; and re-determining the projection angle, row and column index, and cluster confidence based on the first corner point coordinate set to obtain a first corner point set; determining the first... A first correspondence relationship of a set of corner points in the world coordinate system is established, and all corner points in the first set of corner points are calibrated and solved according to the first correspondence relationship to obtain a second calibration result; it is judged whether the second calibration result meets the vehicle lamp calibration conditions to obtain a judgment result; if the judgment result is yes, the calibration parameter corresponding to the second calibration result is determined as the target calibration parameter, and the lamp under test is calibrated according to the target calibration parameter; if the judgment result is no, the step of reducing the calibration area corresponding to the calibration image according to the preset step reduction strategy to obtain the reduced calibration area is executed.

[0093] The stepped reduction strategy involves progressively reducing the calibration region of the calibration image according to the reduction magnitude. Each reduced calibration region is then used to re-execute corner detection, projection angle determination, row and column index determination, cluster confidence determination, and calibration parameter solving. The headlight calibration conditions are used to determine whether the calibration results obtained under the current calibration region meet the calibration accuracy or calibration validity requirements.

[0094] Specifically, firstly, after solving for the calibration parameters based on the target corner point set in the current calibration image, the first calibration result corresponding to the calibration parameters is obtained, and it is determined whether the first calibration result meets the preset vehicle lamp calibration conditions. When the first calibration result meets the vehicle lamp calibration conditions, it indicates that the current calibration area can obtain a calibration result that meets the requirements, and the lamp under test can be directly calibrated according to the calibration parameters; when the first calibration result does not meet the vehicle lamp calibration conditions, it indicates that the corner point data corresponding to the current calibration area may still be affected by factors such as local corner point loss, abnormal corner point detection, or image quality fluctuations, resulting in the current calibration result not meeting the preset requirements. At this time, the step reduction strategy is activated. Specifically, the current calibration area is reduced to the first level according to the step reduction strategy to obtain the reduced calibration area, and the corresponding first corner point coordinate set is determined from the calibration image based on the reduced calibration area. Then, using the first set of corner point coordinates as new corner point data input, the projection angle, row and column indices, and cluster confidence scores are redefined, and the first set of corner points is determined based on the redefined row and column indices and cluster confidence scores. Further, the first correspondence of the first set of corner points in the world coordinate system is determined, and all corner points in the first set are calibrated based on this first correspondence to obtain the second calibration result. Next, the second calibration result is used to determine the vehicle lamp calibration conditions. When the second calibration result meets the vehicle lamp calibration conditions, it indicates that the currently reduced calibration area can obtain the required calibration result. The calibration parameters corresponding to the second calibration result are then determined as the target calibration parameters, and the tested lamp is calibrated based on the target calibration parameters. When the second calibration result does not meet the headlight calibration conditions, it indicates that the current reduced calibration area still cannot obtain a satisfactory calibration result. In this case, the current calibration area is further reduced to the next level according to the step reduction strategy. Based on the further reduced calibration area, the corner coordinate set, projection angle, row and column index, and cluster confidence are re-determined, and then the calibration solution and headlight calibration condition judgment are performed again. In some embodiments, the step reduction strategy can also set a minimum calibration area. When the current calibration area reaches the minimum calibration area and the corresponding calibration result still does not meet the headlight calibration conditions, the step reduction process is terminated, and a calibration failure result is output.

[0095] As can be seen, the calibration result corresponding to the current calibration region is used as the judgment basis for each iteration. When the calibration result meets the headlight calibration conditions, the region reduction process terminates. When the calibration result does not meet the headlight calibration conditions, the next level of region reduction and recalibration process continues until a calibration result that meets the headlight calibration conditions is obtained. This forms an iterative closed loop of "calibration solution - result judgment - region reduction - corner point reconstruction - recalibration - result judgment", which enables the calibration region to be adaptively adjusted according to the calibration result. While ensuring the number of effective corner points, it reduces the impact of abnormal regions on the calibration result, improving the fault tolerance and calibration stability of the headlight calibration process.

[0096] For easier understanding, please refer to Figure 7 , Figure 7This is a flowchart illustrating another vehicle headlight calibration method based on a projected checkerboard grid, provided in this application embodiment. The method includes steps such as obtaining the checkerboard grid corner detection coordinate set {Pi}, isotropic normalization of corner coordinates, solving for the optimal projection angle in two stages, K-means++ clustering and initial row and column index allocation, four-directional nearest neighbor weighted voting verification, global index sequence continuity verification, elimination of out-of-order and gaps, calculation of dual-dimensional comprehensive confidence, and singular point identification, generating point-by-point weights, and solving the confidence-weighted calibration objective function. Based on the calibration results, it determines whether the error requirements are met and whether degradation processing is needed, thereby achieving corner point missing fault tolerance in the vehicle headlight calibration process under complex factory environments. Specifically, in step S1, the checkerboard grid corner detection coordinate set {Pi} is obtained. The vehicle headlight calibration system acquires a checkerboard image projected onto the calibration surface using a camera and performs corner detection on the checkerboard image to obtain a set of corner coordinates {Pi} corresponding to multiple checkerboard grid intersections. The corner detection coordinate set {Pi} is used to characterize the pixel positions of each intersection of the checkerboard grid in the calibration image, providing basic data for subsequent projection direction determination, cluster analysis, and corner index recovery. In step S2, the corner coordinates are normalized isotropically. Since the camera installation position in the actual production environment may be limited, the checkerboard grid in the acquired image may undergo perspective changes. Furthermore, different shooting distances and image scale variations may affect the spatial distribution of corner points. Therefore, the acquired corner coordinate set is normalized to map corner coordinates at different scales to a unified coordinate space, reducing the impact of image scale variations on projection angle search and cluster calculation, and improving the stability of subsequent calculations. In step S3, the optimal projection angle is solved in a two-stage process. Specifically, based on the normalized corner coordinate set, multiple candidate projection angles are searched within a preset search range, and corresponding evaluation parameters are calculated according to the corner projection distribution under different projection angles. A coarse-grained search determines the general trend of the corner arrangement direction; further, a fine search is performed within the determined target search range using a smaller step size to obtain a more accurate target projection angle. By employing a two-stage search approach, the indexing errors caused by traditional fixed-direction sorting when the chessboard orientation shifts due to camera tilt can be avoided. In step S4, K-means++ clustering and initial row and column index allocation are performed. Specifically, the corner coordinates are projected according to the target projection angle, and clustering is performed based on the projected corner distribution. Initial cluster centers are determined using K-means++ to improve the rationality of cluster center selection. The row and column distribution relationships corresponding to different corner points are determined based on the clustering results, further completing the initial row and column index allocation so that each corner point has corresponding index information. In step S5, four-directional nearest neighbor weighted voting is used to verify and correct the index.Specifically, for any corner point to be verified, based on the spatial directional relationship of other corner points relative to this corner point, neighboring corner points are divided into four directional regions: up, down, left, and right. The nearest neighboring corner point is then obtained within each directional region. The theoretical index relationship corresponding to the current corner point is inferred based on the existing row and column index relationships of neighboring corner points. The corresponding voting weight is determined by combining the clustering confidence of neighboring corner points, and a weighted voting method is used to determine whether the current corner point index satisfies the chessboard topological pattern. In step S6, the global index sequence continuity is verified to eliminate misorders and gaps. Specifically, after completing the local nearest neighbor verification, the continuity of the corner point index sequence is further detected based on the overall chessboard arrangement. When a jump, misalignment, or index anomaly due to missing corner points is detected, the abnormal index is corrected according to the global sequence continuity constraint, thereby avoiding the problem of a single missing corner point causing an overall index shift in subsequent corner points. In step S7, the dual-dimensional comprehensive confidence is calculated, and singular corner points are identified, generating point-by-point weights. Specifically, by combining the clustering confidence score, nearest neighbor voting results, and global index consistency results of the corner points, the comprehensive confidence score of the corner points is calculated from two dimensions: local spatial relationship and overall arrangement relationship, and singular corner points that may be abnormal are identified. Simultaneously, corresponding corner point weights are generated based on the comprehensive confidence score to differentiate corner points with different reliability levels during subsequent calibration. In step S8, the confidence score-weighted calibration objective function is solved. Specifically, based on the selected target corner point set, the correspondence between the target corner points and the world coordinate system is established, and the comprehensive confidence score of the corner points is introduced as a weight parameter into the calibration objective function to solve for the vehicle lamp calibration parameters, thereby obtaining the calibration parameters such as the optical axis deflection angle and illumination distance corresponding to the tested lamp. After completing step S8, it is further determined whether the reprojection error meets the standard. If the determination result is "yes," that is, when the reprojection error meets the requirements, step S9 is executed to output the calibration results and metadata. The calibration results include the solved vehicle lamp optical parameters, and the metadata is used to record relevant information in the current calibration process for subsequent traceability and management. If the judgment result is "No," meaning the reprojection error does not meet the requirements, further determine whether the degradation sequence has been exhausted. If the judgment result is "Yes," then execute step S10, report the failure, and require manual intervention. This means that the current calibration conditions cannot meet the accuracy requirements through automatic processing, and send an anomaly message to relevant personnel. If the judgment result is "No," meaning the starting point of the degradation sequence has not been reached, then execute step S11, reducing the effective checkerboard area according to a stepwise strategy. Specifically, by progressively reducing the effective checkerboard area participating in the calibration calculation, the impact of local abnormal areas or missing corner points on the overall calibration result is reduced. The process then returns to the aforementioned processing flow to re-recover the corner point index and solve the calibration problem, further improving the system's adaptability to complex shooting environments. After executing step S11, retry steps S1-S11 repeatedly until convergence.

[0097] It can be seen that by optimizing the direction of the corner points of the projected chessboard, restoring the cluster index, verifying the topological consistency, and solving the confidence-weighted calibration, the correspondence between the corner points and the world coordinates can still be accurately established and the headlight calibration can be completed even under conditions such as shooting tilt, missing corner points, and changes in illumination. This improves the robustness of the headlight calibration process and the accuracy of the calibration results.

[0098] As can be seen, the above-described vehicle headlight calibration method based on a projection checkerboard pattern involves: acquiring the coordinate set of corner points detected in the calibration image; determining the target projection angle based on the corner point coordinate set; projecting the corner points in the coordinate set along the target projection angle to obtain the projection result; clustering the projection result to obtain multiple clusters; determining the row and column indices and cluster confidence scores of the corner points based on these clusters; filtering the corner points based on the row and column indices and cluster confidence scores to obtain the target corner point set; determining the correspondence of the target corner point set in the world coordinate system; and calibrating and solving for all target corner points in the target corner point set based on the correspondence to obtain calibration parameters, including the optical axis deflection angle and illumination distance of the tested headlight. This method can improve the accuracy of vehicle headlight calibration in environments with limited space, such as production lines.

[0099] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0100] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0101] When dividing each function into modules according to its corresponding function. Figure 8This is a functional module block diagram of a vehicle headlight calibration device based on a projected checkerboard pattern, provided in an embodiment of this application. It is an electronic device applied in a vehicle headlight calibration fault-tolerant system. The vehicle headlight calibration device 800 based on a projected checkerboard pattern includes: The acquisition module 810 is used to acquire the set of corner coordinates detected in the calibration image; the set of corner coordinates includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image; Control module 820 is used to determine the target projection angle based on the corner coordinate set; project the corner points in the corner coordinate set along the target projection angle to obtain the projection result; and perform clustering based on the projection result to obtain multiple clusters. The determining module 830 is used to determine the row and column indices and cluster confidence scores corresponding to the corner points based on the multiple clusters; and to filter the corner points based on the row and column indices and the cluster confidence scores to obtain a target corner point set. The calculation module 840 is used to determine the correspondence of the target corner point set in the world coordinate system; and to perform calibration and solution on all target corner points in the target corner point set according to the correspondence to obtain calibration parameters; the calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

[0102] In an optional embodiment, the determining module 830, in determining the row and column index and cluster confidence score corresponding to the corner point based on the plurality of clusters, is specifically configured to: determine the plurality of cluster centers corresponding to the plurality of clusters; assign row and column index numbers to the plurality of cluster centers to obtain the plurality of cluster center row and column indices; determine the index of the corner point based on the cluster center row and column indices to obtain the row and column index corresponding to the corner point; determine the cluster confidence score corresponding to the corner point based on the projection compactness parameter corresponding to the cluster to which the corner point belongs; wherein the projection compactness parameter is the mean of the squares of the distances between the projected coordinates of the corner point and the cluster centers of its respective clusters.

[0103] In an optional embodiment, the determining module 830, in assigning row and column index numbers to the plurality of cluster centers to obtain plurality of cluster center row and column indices, is specifically configured to: sort the plurality of clusters in the column index direction according to the coordinates of each cluster center in the horizontal reference direction to obtain a column sorting sequence; and sort the plurality of clusters in the row index direction according to the coordinates of each cluster center in the vertical reference direction to obtain a row sorting sequence; determine the row index of the cluster center corresponding to the corner point in the row direction according to the row sorting sequence; and determine the column index of the cluster center corresponding to the corner point in the column direction according to the column sorting sequence; and determine the row and column index corresponding to the corner point according to the row index and the column index.

[0104] In an optional embodiment, the determining module 830, in the step of filtering the corner points according to the row and column index and the clustering confidence to obtain a target corner point set, is specifically configured to: divide the other corner points into up, down, left, and right directional regions according to the relative azimuth angles of the other corner points relative to the first corner point, and determine the neighboring corner point corresponding to the minimum distance from the first corner point within the directional region, denoted as the second corner point; the first corner point is any one of the corner points; the other corner points are the corner points excluding the first corner point; determine the first row and column index corresponding to the first corner point according to the row and column index; and determine the first row and column index corresponding to the second corner point. The process involves two row and column indices; determining the voting result of the second corner point on the first corner point based on the topological relationship between the first and second row and column indices; the voting result representing the support of the second corner point for the row and column indices corresponding to the first corner point; determining the nearest neighbor voting weight of the second corner point based on the cluster confidence of the cluster to which the second corner point belongs; determining the voting consistency score of the first corner point based on the voting result and the nearest neighbor voting weight; determining the comprehensive confidence of the first corner point based on the voting consistency score and the cluster confidence; and correcting the row and column indices of the first corner point based on the comprehensive confidence to obtain the target corner point.

[0105] In an optional embodiment, the determining module 830, in correcting the row and column indices of the first corner point according to the comprehensive confidence level to obtain the target corner point, is specifically configured to: determine whether the first row and column indices corresponding to the first corner point meet a preset index consistency condition based on the comprehensive confidence level; if the first row and column indices meet the index consistency condition, then maintain the first row and column indices corresponding to the first corner point; determine the target corner point based on the first row and column indices; if the first row and column indices do not meet the index consistency condition, then determine the relative positional relationship between the first corner point and the second corner point; determine at least one expected row and column indices corresponding to the first corner point based on the relative positional relationship and the second row and column indices; determine the target expected row and column indices corresponding to the first corner point based on the at least one expected row and column indices; replace the first row and column indices corresponding to the first corner point with the target expected row and column indices; and update the index information corresponding to the first corner point to obtain the target corner point.

[0106] In an optional embodiment, the control module 820, in determining the target projection angle based on the corner coordinate set, is specifically configured to: normalize the corner coordinate set to obtain a normalized corner coordinate set; determine the target sampling angle and the target projection compaction parameter based on the normalized corner coordinate set; perform quadratic term curve fitting on the target sampling angle and the target projection compaction parameter to obtain a projection compaction fitting curve; and determine the target projection angle based on the projection compaction fitting curve; the target projection angle includes the projection angle in the row direction and the projection angle in the column direction.

[0107] In an optional embodiment, the control module 820, in determining the target sampling angle and target projection compact parameter based on the normalized corner coordinate set, is specifically configured to: acquire multiple first projection angles within a preset first search angle range with a preset first step length; perform directional projection on each of the multiple first projection angles according to the normalized corner coordinate set, and determine the corresponding first projection compact parameter based on the projected corner points; determine a second projection angle based on the first projection compact parameter; and determine a target search angle range based on the second projection angle; sample within the target search angle range with a preset second step length to obtain multiple sampling angles; and determine the second projection compact parameter corresponding to the multiple sampling angles; wherein the second step length is less than the first step length; determine the minimum projection compact parameter of the second projection compact parameter; and determine the first sampling angle corresponding to the minimum projection compact parameter; acquire a preset number of multiple second sampling angles adjacent to the first sampling angle; determine the target sampling angle based on the first sampling angle and the multiple second sampling angles; and determine the target sampling angle based on the minimum projection compact parameter and the projection compact parameter corresponding to the multiple second sampling angles.

[0108] In an optional embodiment, the control module 820, in determining the plurality of second projection compact parameters corresponding to the plurality of sampling angles, is specifically configured to: project each of the plurality of sampling angles into the normalized corner coordinate set to obtain a plurality of projected corner points; cluster the plurality of projected corner points to obtain a plurality of projection clustering results; and determine the projection compact parameters corresponding to the plurality of projected corner points based on the plurality of projection clustering results to obtain the plurality of second projection compact parameters.

[0109] In an optional embodiment, the projection result includes multiple projection coordinates. Specifically, the control module 820, in the process of clustering based on the projection result to obtain multiple clusters, is configured to: determine the number of clusters for a preset clustering algorithm based on the specifications of the checkerboard grid; the specifications of the checkerboard grid are the number of intersections of the checkerboard grid; use the target projection coordinates as initial cluster centers and calculate the minimum distance between the multiple projection coordinates and the target projection coordinates to obtain multiple minimum clustering distances; the target projection coordinates are any one of the multiple projection coordinates; determine the maximum projection coordinate corresponding to the maximum value among the multiple minimum clustering distances; use the maximum projection coordinate as the next initial cluster center and iterate; stop iterating when the number of selected initial cluster centers equals the number of clusters; after each initial cluster center is selected, iteratively perform assignment and cluster center update on the multiple projection coordinates until the clustering result converges to obtain the multiple clusters.

[0110] In an optional embodiment, after the control module 820 performs calibration and solves for all target corner points in the target corner point set according to the correspondence to obtain calibration parameters, it is further configured to: obtain a first calibration result in response to the calibration parameters; when the first calibration result does not meet the preset vehicle headlight calibration conditions, reduce the calibration area corresponding to the calibration image according to a preset step reduction strategy to obtain a reduced calibration area; determine the first corner point coordinate set corresponding to the reduced calibration area; and re-determine the projection angle, row and column index, and cluster confidence based on the first corner point coordinate set to obtain the first corner point set; A first correspondence is established in the world coordinate system for the first set of corner points, and all corner points in the first set of corner points are calibrated and solved according to the first correspondence to obtain a second calibration result; it is judged whether the second calibration result satisfies the vehicle lamp calibration condition to obtain a judgment result; if the judgment result is yes, the calibration parameter corresponding to the second calibration result is determined as the target calibration parameter, and the lamp under test is calibrated according to the target calibration parameter; if the judgment result is no, the step of reducing the calibration area corresponding to the calibration image according to the preset step reduction strategy to obtain the reduced calibration area is executed.

[0111] As can be seen, this application provides a vehicle lamp calibration device 800 based on a projected checkerboard grid, which is applied to an electronic device in a vehicle lamp calibration fault-tolerant system. This device acquires the coordinate set of corner points detected in a calibration image. The corner point coordinate set includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image. Next, the target projection angle is determined based on the corner point coordinate set. The corner points in the coordinate set are then projected along the target projection angle to obtain the projection result. Then, clustering is performed based on the projection result to obtain multiple clusters. The row and column indices and cluster confidence scores corresponding to the corner points are determined based on the multiple clusters. The corner points are then filtered based on the row and column indices and cluster confidence scores to obtain a target corner point set. Finally, the correspondence of the target corner point set in the world coordinate system is determined. The target corner points in the target corner point set are calibrated based on the correspondence to obtain calibration parameters. The calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

[0112] Thus, by determining the target projection angle based on the corner coordinate set and projecting the corner points in the coordinate set along the target projection angle to obtain the projection result, and then clustering based on the projection result to obtain multiple clusters, the corner index allocation process does not depend on the complete corner set. Even if some corner points are missing, the corner index relationship can still be established based on the spatial distribution relationship between the remaining corner points, thereby reducing the risk of overall index offset due to missing corner points. Furthermore, the row and column indices and cluster confidence scores corresponding to the corner points are determined based on the multiple clusters; the corner points are filtered based on the row and column indices and the cluster confidence scores to obtain the target corner set, and a correspondence is established between the target corner points in the target corner set and the world coordinates. This improves the accuracy of corner point correspondence in the input calibration solution process, thereby improving the accuracy of vehicle headlight calibration results under environmentally constrained conditions.

[0113] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.

[0114] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.

[0115] It should be noted that, for the sake of simplicity, the above embodiments are all described as a series of actions. Those skilled in the art should understand that this application is not limited to the described order of actions, as some steps in the embodiments of this application can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions, steps, modules, or units involved are not necessarily essential to the embodiments of this application.

[0116] In the above embodiments, the descriptions of each embodiment in this application have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0118] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for calibrating vehicle lights based on a projected checkerboard pattern, characterized in that, An electronic device applied to a vehicle lighting calibration fault-tolerant system, the method comprising: Obtain the set of corner coordinates detected in the calibration image; the set of corner coordinates includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image; The target projection angle is determined based on the set of corner coordinates; the corner points in the set of corner coordinates are projected along the target projection angle to obtain the projection result; and the projection result is clustered to obtain multiple clusters. The row and column indices and cluster confidence scores corresponding to the corner points are determined based on the multiple clusters; the nearest neighbor voting results among the corner points are determined based on the row and column indices, and the comprehensive confidence score corresponding to the corner points is determined based on the nearest neighbor voting results and the cluster confidence scores; the row and column indices corresponding to the corner points are corrected based on the comprehensive confidence scores to obtain the target corner point set. Determine the correspondence of the target corner point set in the world coordinate system; perform calibration and solution on all target corner points in the target corner point set according to the correspondence to obtain calibration parameters; the calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

2. The method as described in claim 1, characterized in that, The step of determining the row and column indices and cluster confidence scores corresponding to the corner points based on the multiple clusters includes: Determine the multiple cluster centers corresponding to the multiple clusters; Assign row and column index numbers to the multiple cluster centers to obtain multiple cluster center row and column indices; The index of the corner point is determined based on the cluster center row and column index, and the row and column index corresponding to the corner point is obtained. The cluster confidence level corresponding to the corner point is determined based on the projection compactness parameter of the cluster to which the corner point belongs; the projection compactness parameter is the mean of the squares of the distances between the projected coordinates of the corner point and the cluster center of its respective cluster.

3. The method as described in claim 2, characterized in that, Assigning row and column index numbers to the multiple cluster centers to obtain multiple cluster center row and column indices includes: For multiple clusters along the column index direction, sort them according to the coordinates of each cluster center in the horizontal reference direction to obtain a column sorting sequence; and for multiple clusters along the row index direction, sort them according to the coordinates of each cluster center in the vertical reference direction to obtain a row sorting sequence. The row index of the cluster center corresponding to the corner point in the row direction is determined according to the row sorting sequence; and the column index of the cluster center corresponding to the corner point in the column direction is determined according to the column sorting sequence. The row and column indices corresponding to the corner point are determined based on the row index and the column index.

4. The method as described in claim 1, characterized in that, The step of determining the nearest neighbor voting results among the corner points based on the row and column indices, and determining the comprehensive confidence level corresponding to the corner point based on the nearest neighbor voting results and the clustering confidence level, includes: Based on the relative azimuth angles of other corner points with respect to the first corner point, the other corner points are divided into up, down, left, and right directional regions, and the neighboring corner point corresponding to the minimum distance from the first corner point within the directional region is determined and denoted as the second corner point; the first corner point is any one of the corner points; the other corner points are the corner points excluding the first corner point. The first row and column index corresponding to the first corner point is determined based on the row and column index; and the second row and column index corresponding to the second corner point is determined. The nearest neighbor voting result of the second corner point to the first corner point is determined based on the topological relationship between the first row and column index and each of the second row and column indices; the nearest neighbor voting result represents the support of the second corner point for each row and column index corresponding to the first corner point. The nearest neighbor voting weight corresponding to the second corner point is determined based on the cluster confidence of the cluster to which the second corner point belongs. The voting consistency score of the first corner point is determined based on the nearest neighbor voting results and the nearest neighbor voting weights. The overall confidence level is determined based on the voting consistency score and the clustering confidence level.

5. The method as described in claim 4, characterized in that, The step of correcting the row and column indices corresponding to the corner points based on the comprehensive confidence level to obtain the target corner point set includes: Based on the comprehensive confidence level, determine whether the row and column indexes corresponding to the corner point meet the preset index consistency conditions; If the row and column indexes satisfy the index consistency condition, then the row and column indexes corresponding to the corner points are maintained; the target corner point set is determined based on the row and column indexes. If the row and column indexes do not meet the index consistency condition, then at least one expected row and column index corresponding to the corner point is determined based on the nearest neighbor voting results corresponding to the corner point; the target expected row and column index corresponding to the corner point is determined based on the at least one expected row and column index; the row and column index corresponding to the corner point is replaced with the target expected row and column index; and the index information corresponding to the corner point is updated to obtain the target corner point set.

6. The method according to any one of claims 1-5, characterized in that, Determining the target projection angle based on the corner coordinate set includes: The corner coordinate set is normalized to obtain a normalized corner coordinate set; The target sampling angle and target projection compaction parameters are determined based on the normalized corner coordinate set. A quadratic curve is fitted to the target sampling angle and the target projection compaction parameter to obtain the projection compaction fitting curve. The target projection angle is determined based on the projection compact fitting curve; the target projection angle includes the projection angle in the row direction and the projection angle in the column direction.

7. The method as described in claim 6, characterized in that, The step of determining the target sampling angle and target projection compact parameters based on the normalized corner coordinate set includes: Within a preset first search angle range, acquire multiple first projection angles with a preset first step length; Based on the normalized corner coordinate set, each of the plurality of first projection angles is directionally projected, and the corresponding first projection compaction parameter is determined based on the projected corner points. The second projection angle is determined based on the first projection compaction parameter; and the target search angle range is determined based on the second projection angle. Within the target search angle range, sampling is performed with a preset second step size to obtain multiple sampling angles; and a second projection compaction parameter corresponding to the multiple sampling angles is determined; the second step size is smaller than the first step size. Determine the minimum projection compaction parameter of the second projection compaction parameter; and determine the first sampling angle corresponding to the minimum projection compaction parameter; Obtain a preset number of second sampling angles adjacent to the first sampling angle; A target sampling angle is determined based on the first sampling angle and the plurality of second sampling angles; and the target sampling angle is determined based on the minimum projection compact parameter and the projection compact parameter corresponding to the plurality of second sampling angles.

8. The method as described in claim 7, characterized in that, Determining the second projection compaction parameters corresponding to the plurality of sampling angles includes: In the normalized corner point coordinate set, each of the plurality of sampled angles is projected in a direction to obtain a plurality of projected corner points; Clustering is performed on the multiple projected corner points to obtain multiple projection clustering results; Based on the multiple projection clustering results, the projection compaction parameters corresponding to the multiple projection corner points are determined, and the second projection compaction parameters are obtained.

9. The method according to any one of claims 1-5, characterized in that, The projection result includes multiple projection coordinates, and the clustering based on the projection result yields multiple clusters, including: The number of clusters in the preset clustering algorithm is determined based on the specifications of the chessboard grid; the specifications of the chessboard grid are the number of intersections of the chessboard grid. The target projected coordinates are used as the initial cluster centers, and the minimum distance between the plurality of projected coordinates and the target projected coordinates is calculated to obtain a plurality of minimum cluster distances; the target projected coordinates are any one of the plurality of projected coordinates. Determine the maximum projected coordinates corresponding to the maximum value among the plurality of minimum clustering distances; The maximum projected coordinates are used as the next initial cluster centers, and the process is iterated. The iteration stops when the number of selected initial cluster centers equals the number of clusters. After the initial cluster centers are selected, the multiple projected coordinates are iteratively assigned and the cluster centers are updated until the clustering results converge to obtain the multiple clusters.

10. The method as described in claim 1, characterized in that, After calibrating and solving all target corner points in the target corner point set according to the correspondence to obtain calibration parameters, the method further includes: Obtain the first calibration result in response to the calibration parameters; When the first calibration result does not meet the preset vehicle headlight calibration conditions, the calibration area corresponding to the calibration image is reduced according to the preset step reduction strategy to obtain the reduced calibration area. Determine the first corner point coordinate set corresponding to the reduced calibration area; and redetermine the projection angle, row and column index, and cluster confidence based on the first corner point coordinate set to obtain the first corner point set; Determine the first correspondence of the first corner point set in the world coordinate system, and perform calibration and solution on all corner points in the first corner point set according to the first correspondence to obtain the second calibration result; The second calibration result is judged to determine whether it meets the vehicle lamp calibration conditions, and the judgment result is obtained. If the judgment result is yes, then the calibration parameter corresponding to the second calibration result is determined as the target calibration parameter, and the lamp under test is calibrated according to the target calibration parameter; If the judgment result is negative, then the step of reducing the calibration region corresponding to the calibration image according to the preset step reduction strategy to obtain the reduced calibration region is executed.

11. A vehicle headlight calibration device based on a projected checkerboard pattern, characterized in that, An electronic device applied to a vehicle lighting calibration fault-tolerant system, the device comprising: The acquisition module is used to acquire the set of corner coordinates detected in the calibration image; the set of corner coordinates includes the pixel coordinates of multiple intersections of the checkerboard grid projected onto the calibration surface in the calibration image; The control module is used to determine the target projection angle based on the corner coordinate set; project the corner points in the corner coordinate set along the target projection angle to obtain the projection result; and perform clustering based on the projection result to obtain multiple clusters. The determination module is used to determine the row and column indices and cluster confidence scores corresponding to the corner points based on the multiple clusters; determine the nearest neighbor voting results among the corner points based on the row and column indices; determine the comprehensive confidence score corresponding to the corner points based on the nearest neighbor voting results and the cluster confidence scores; and correct the row and column indices corresponding to the corner points based on the comprehensive confidence scores to obtain the target corner point set. The calculation module is used to determine the correspondence of the target corner point set in the world coordinate system; and to perform calibration and solution on all target corner points in the target corner point set according to the correspondence to obtain calibration parameters; the calibration parameters include the optical axis deflection angle and illumination distance of the lamp under test.

12. A vehicle-mounted chip SoC, characterized in that, include: The processor, memory, communication interface, and program stored in the memory; when the program is executed by the processor, the vehicle-mounted chip SoC performs the method as described in any one of claims 1-10.