High-speed ball machine near-infrared partition light supplementing and online calibration method based on focal length state and road longitudinal depth partition
Patent Information
- Application Number
- CN202611512603.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
若仅采用近区暗则增加近距灯、远区暗则增加远距灯的独立规则,容易产生通道耦合、反复调节或局部过曝
本申请通过统一状态向量和时序同步,使焦距、云台姿态、曝光、增益、补光命令、实际电流和温度均在后续步骤中具有明确用途,避免控制特征悬空。通过安装参数、道路地面标定点、映射模型验证和焦距插值,形成可重复获得的道路有效区域和纵深分区,而不是仅进行概括性区域划分。将亮度、欠曝、过曝、对比度、纹理和噪声统一转换为有符号区域误差,区域质量指标直接进入补光输出求解和反馈验证,形成明确数据闭环。
Smart Images

Figure CN123020987A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent traffic monitoring technology, specifically to a method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning. Background Technology
[0002] High-speed PTZ cameras typically integrate a continuous zoom mechanism, a gimbal, and a near-infrared illumination component. They can cover multiple road directions via preset cruise positions and observe road targets at different distances through optical zoom. When a high-speed PTZ camera zooms from wide-angle to telephoto, the field of view, the main observation distance, and the road range per pixel change synchronously. The corresponding near-infrared illumination angle, effective illumination distance, and light energy distribution should also be adjusted accordingly. If fixed illumination parameters are shared across different focal lengths, the wide-angle mode is prone to overly bright reflections from nearby road surfaces, guardrails, or greenery, while the telephoto mode is prone to insufficient illumination for distant vehicles, pedestrians, and road boundaries.
[0003] Current focal length-linked fill lighting typically switches preset light groups or power levels based on the zoom position, and some devices also perform SMART IR adjustment based on the average brightness of the entire image. This approach usually fails to integrate the effects of gimbal presets, road spatial depth, regional image quality, and cross-illumination between different fill lighting units. Near-field areas occupy a large portion of the image, while distant targets are smaller, which may result in situations where the overall average brightness is normal, but distant roads are still underexposed.
[0004] Multiple near-infrared illumination units typically have different illumination angles and effective distances, but their illumination contributions are not independent of each other. Wide-angle illumination units may affect both the near and mid-range areas simultaneously, while narrow-angle illumination units may also contribute to the mid-range area. Road slope, camera tilt angle, shield transmittance, and road surface reflectivity will also alter the actual range of influence of each illumination unit. Adopting only independent rules—such as increasing the number of low-range lights when the near-range is dark and increasing the number of high-range lights when the far-range is dark—can easily lead to channel coupling, repeated adjustments, or localized overexposure.
[0005] Furthermore, changes in camera exposure and gain directly alter image brightness statistics; incomplete gimbal positioning, lens zooming or focusing, vehicle passage, reflective markings, rain / fog scattering, and contamination of the protective cover can also cause abnormal quality indicators. If the focal length, gimbal, exposure, gain, and fill light settings obtained in the previous step are not used in subsequent steps, or if the quality indicators are only calculated but not converted into actual fill light control errors, an executable control chain cannot be formed. Summary of the Invention
[0006] In order to solve the above-mentioned technical problems, this application proposes the following technical solution: This application provides a method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning, including: According to the unified timestamp, the current preset position, focal length, gimbal attitude, exposure gain parameters, road image and driving status of each near-infrared supplementary light unit of the high-speed PTZ camera are obtained to form a unified state vector. Based on the preset position and focal length, the current road space mapping and reference parameters are generated, and the current mapping parameters are updated using the gimbal attitude and focal length, and the current road space mapping parameters are output. The effective area of the current road is determined using the mapping parameters, and the effective area of the road is divided into multiple road depth areas. The area mask and area confidence of each road depth area are output. The road image is normalized according to the exposure gain parameter, and the imaging quality index of each depth region is calculated by combining the region mask and region confidence, and a signed region error vector is generated after comparing with the target interval. Based on the influence of the preset position and focal length loading of each near-infrared supplementary lighting unit on the illumination of each depth area, the target output of each near-infrared supplementary lighting unit is solved by taking the signed region error vector as the control target and combining the driving state and safety constraints of each near-infrared supplementary lighting unit. The target output is converted into driving commands for each near-infrared supplementary lighting unit and executed. After reading back the actual driving state, the road image is re-acquired, and the imaging quality after the supplementary lighting adjustment is compared. Feedback response is given to this supplementary lighting adjustment based on the comparison results.
[0007] In one possible implementation, the step of obtaining the current preset position, focal length, gimbal attitude, exposure gain parameters, road image, and driving state of each near-infrared illumination unit of the high-speed PTZ camera according to a unified timestamp, forming a unified state vector, includes: The zoom encoding position, focal length status, exposure time and gain are read from the camera interface, the gimbal horizontal angle, gimbal pitch angle, preset position number and gimbal rotation status are read from the gimbal control interface, the command output, actual current and temperature of each near-infrared supplementary light unit are read from the supplementary light drive interface, and the road image and corresponding frame timestamp are read from the image acquisition interface. Based on the frame timestamp of the road image, time matching or linear interpolation is performed on each read state quantity. If the time difference between any state quantity and the frame timestamp exceeds the allowable threshold, it is marked as invalid. The zoom-encoded position is converted to the current focal length using the following formula: in, The current focal length, This is the current variable-scaling position. and Enclosing in the focal length calibration table Adjacent coding nodes, and The measured focal length corresponding to the encoding node; The gimbal horizontal angle, gimbal pitch angle, exposure time, gain, and command outputs, actual currents, and temperatures of each near-infrared supplementary lighting unit are uniformly converted and combined into a unified state vector.
[0008] In one possible implementation, based on the preset position and focal length, a current road space mapping and reference parameters are generated, and the current mapping parameters are updated using the gimbal attitude and focal length, outputting the current road space mapping parameters, including: Acquire and record the installation height of the PTZ camera's optical center relative to the road reference plane, the reference horizontal angle and pitch angle, image resolution, lens calibration parameters, available preset position numbers, and representative focal length nodes; At each preset position and representative focal length node, select multiple non-collinear ground calibration points on the road centerline, lane boundary, or road side, obtain the road ground coordinates or longitudinal distance relative to the PTZ camera for each calibration point, and record the corresponding pixel coordinates in the road image; Based on the correspondence between the road ground coordinates and the image pixel coordinates, the homography mapping model of the preset position and focal length nodes is solved; The reprojection error of the homography mapping model is calculated using the verification calibration points that were not involved in the solution process, using the following formula: in, This refers to the reprojection error of the mapping model at the verification calibration points. To verify the number of points, Let r be the road surface coordinates of the r-th verification point. These are the measured pixel coordinates of the image. This indicates homogeneous coordinate normalization. This is a homography mapping model corresponding to the preset position p and the focal length node k; When the reprojection error is less than a preset threshold, the mapping model is associated with the corresponding preset position and focal length node and saved to the parameter library; Select the corresponding parameter unit based on the current preset position and determine the position of the current focal length in the parameter library; if the current focal length is between adjacent calibration nodes, interpolate the mapping model of the adjacent nodes; if the current focal length coincides with the calibration node, directly use the mapping model of the calibration node. Based on the deviation between the current gimbal pitch angle and the calibrated pitch angle, the attitude of the mapping model is corrected, and the corrected mapping model is used as the current road space mapping parameter.
[0009] In one possible implementation, if the current focal length lies between adjacent calibration nodes, the formula for interpolating the mapping model of adjacent nodes is: in, This is the initial mapping model corresponding to the current focal length. These are the focal length interpolation coefficients. This is a homography mapping model corresponding to the preset position p and the focal length node k+1. The current focal length, and This represents the measured focal length corresponding to the encoding node.
[0010] In one possible implementation, the mapping parameters are used to determine the current effective road area, which is then divided into multiple road depth regions. The region mask and region confidence level of each road depth region are output, including: Using the current preset position and focal length as an index, load the reference road mask, reference vanishing point, reference lane line or road boundary position, fixed reference position, and preset actual distance thresholds for near, middle and far areas from the parameter library as the initial reference for determining the effective area of the current road. Edge detection and straight line segment extraction are performed on the road image. Candidate lane lines and road boundaries are obtained by combining the baseline road mask constraint. The positions of candidate reference objects are obtained by feature point matching or template matching for fixed reference objects. Candidate vanishing points are obtained based on the intersection of straight lines extending from multiple roads, which serve as the structural features of the current image. The extracted current structural features are correlated with the loaded baseline structural features. Random sampling consistency or least squares with robust loss is used to remove abnormal correspondences caused by vehicles, shadows, and erroneous edges. A correction transformation, limited to a small range of homography, affine, or translational scaling, is then calculated using the following formula: in, This is a correction transformation of the current frame relative to the reference road structure. For the r-th baseline lane line endpoint, road boundary point, or fixed reference feature coordinates; These are the coordinates of the corresponding feature matched in the current image; To match confidence weights; To limit the regularization coefficients that restrict the transformation from deviating from the unity transform I, The candidate geometric transformations to be determined during the optimization process, Let the square of the Euclidean norm of the two-dimensional coordinate residuals be denoted as . The square of the Frobenius norm of the matrix; The confidence score of structural features is calculated based on the number of effective matches, reprojection error, vanishing point offset consistency, lane boundary coverage length, and continuous frame stability, using the following formula: in, For structural feature confidence, To restrict the results to a monotonic mapping from 0 to 1; This represents the number of interior points after a robust matching. This represents the number of candidate matches. This represents the average reprojection error; and These are the current vanishing point and the baseline vanishing point, respectively. The length of the image diagonal; The total length of the current effective road boundary or lane lines. As the reference length, , , , These are the weighting coefficients for the interior point ratio term, the reprojection error penalty term, the vanishing point offset penalty term, and the road boundary coverage ratio term, respectively. The confidence level of the structural feature is compared with a preset confidence threshold. When the confidence level of the structural feature is lower than the preset confidence threshold, the loaded reference road mask and reference depth region boundary are maintained, and the regional confidence level of the corresponding road depth region is reduced. When the confidence level of the structural feature reaches or exceeds the preset confidence threshold, the reference road mask and depth boundary are updated using the correction transformation; Using the corrected current road space mapping parameters, the preset actual distance thresholds of the near, middle and far regions are mapped to the image coordinate system respectively. Multiple regions are generated in the near, middle and far regions arranged along the road depth direction within the determined effective road area, forming a region mask for each road depth region. Based on the calculated structural feature confidence level and the implementation of corrections, regional confidence levels are assigned to each road longitudinal region.
[0011] In one possible implementation, the road image is normalized according to the exposure gain parameter, and the imaging quality index of each depth region is calculated by combining the region mask and region confidence, and a signed region error vector is generated after comparing it with the target interval, including: Using the exposure gain parameter as input, after calculating the normalization coefficient by calling the pre-calibrated grayscale response function, the brightness value of each pixel in the road image is normalized to generate a normalized image under reference exposure and reference gain conditions. The formula is as follows: in, For normalized brightness, The brightness of the current image pixels; Black level; and These are the grayscale response functions corresponding to exposure time and gain, respectively; and The reference exposure and reference gain are set in the parameter library; The maximum gray level of the image. This refers to the exposure time during the current control cycle; The gain for the current control cycle; This represents the truncation function; Moving target detection is performed on the normalized image, and the inter-frame difference method is used to identify moving targets in the current road image to generate a moving target mask; The normalized image is subjected to abnormal brightness detection. Combined with brightness threshold, low texture features, geometric shape analysis and temporal stability criteria, vehicle lights, reflective markings and local high reflectivity road surface are identified to generate an abnormal brightness mask. The effective pixel weights for each depth region are calculated based on the moving target mask, the abnormal highlight mask, the region mask, and the region confidence level. For each road depth region, the effective pixel weights are used as statistical weights to perform weighted statistics on the brightness values of each pixel in the output normalized image, and the weighted median of the effective pixel brightness of each region is calculated. Based on the effective pixel brightness weighted median, effective pixel weight, and normalized image, the underexposure ratio and overexposure ratio of each road depth region are calculated respectively. Simultaneously, the effective pixel weights and normalized images are used to calculate the texture visibility and robust local contrast of each road depth region; Load the target quality range of each region corresponding to the current preset position and focal length node from the parameter library, and use the calculated quality index of each region to determine the signed supplementary lighting error of each region; The signed supplementary lighting errors of each determined region are combined to form a region error vector.
[0012] In one possible implementation, the formula for calculating the effective pixel weights of each depth region based on the moving target mask, the abnormal highlight mask, the region mask, and the region confidence level is as follows: in, Let be the pixel weight of the i-th depth region; For area masking; For regional credibility; For moving target mask; Masking for vehicle lights, reflective markings, and areas with abnormally high reflectivity; Additional weights set based on texture reliability.
[0013] In one possible implementation, based on the preset position and focal length, the illumination influence of each near-infrared supplementary lighting unit on each depth region is calculated. Using the signed region error vector as the control target, and combining the driving state and safety constraints of each near-infrared supplementary lighting unit, the target output of each near-infrared supplementary lighting unit is solved, including: Using the current preset position and focal length as indices, the lighting influence relationships of adjacent focal length nodes are read from the parameter library, and the current lighting influence matrix is generated based on the focal length interpolation coefficients. The formula is as follows: in, This is the lighting influence matrix for the current control cycle; and The influence matrix stored for the adjacent focal length nodes of the preset position p. These are the focal length interpolation coefficients; Read the current output, actual current and temperature of each supplementary lighting unit, calculate the upper limit of the unit output after temperature derating based on the temperature of each supplementary lighting unit, and eliminate unusable supplementary lighting units in combination with the drive fault status; Using the signed region error vector as the control objective and the current lighting influence matrix as the prediction model, a constrained optimization objective function is established, which includes prediction region error, output adjustment magnitude, and smoothness between adjacent periods as objectives. Candidate output adjustment values are then calculated using the following formula: in, Adjust the candidate output for each supplementary lighting unit; This is the region weight matrix; The lighting effect matrix; This is the region error vector; The weighting coefficients for the output adjustment magnitude regularization term; These are the weighting coefficients for the smoothing terms of adjacent control cycles; To optimize variables; This is the output adjustment amount that was accepted in the previous control cycle.
[0014] In one possible implementation, the current output, actual current, and temperature of each supplementary lighting unit are read. The formula for calculating the upper limit of the unit output after temperature derating for each supplementary lighting unit is as follows: in, For the j-th supplementary lighting unit at temperature The upper limit of allowed output; This is the rated output; This is the temperature derating factor; To begin reducing the dereferencing temperature, To force the temperature to shut down.
[0015] In one possible implementation, the target output is converted into driving commands for each near-infrared illumination unit and executed. After reviewing the actual driving state, the road image is reacquired, and the imaging quality after illumination adjustment is compared. Based on the comparison result, a feedback response is given to the current illumination adjustment, including: Based on the target output of each supplementary lighting unit and the current temperature, the current level that meets the output requirements and has the smallest quantization error is selected from the pre-calibrated drive mapping table, and the corresponding PWM duty cycle is calculated under the selected current level; after limiting and grading the changes in current level and PWM duty cycle, drive commands are sent to each supplementary lighting unit through the drive communication interface. After waiting for the preset electrical and optical stabilization time, the actual current, temperature and fault status of each supplementary light unit are read back through the drive communication interface, and the actual equivalent output is estimated based on the read-back actual current and temperature. If the deviation between the target output and the estimated actual output exceeds the threshold, or if overheating, overcurrent, open circuit, short circuit, or communication timeout occurs, the corresponding supplementary lighting unit will be marked as unavailable or derating, a hardware abnormality flag will be output, and the remaining available units will be used to resolve or switch safety parameters. If the deviation between the target output and the estimated actual output is within the preset range, re-acquire road images, and recalculate the adjusted regional error and overall imaging quality according to the determined effective road area and depth division. The adjusted overall imaging quality is compared with the calculated overall imaging quality before adjustment. If the overall imaging quality is improved and the hard constraints are not broken, the current output is maintained, and the output deviation under continuous and stable improvement is used to generate online calibration candidate versions. If the overall imaging quality is not improved or the hard constraints are broken, the control step size is reduced and the solution is recalculated or the output before supplemental lighting is restored.
[0016] Compared with the prior art, the beneficial effects of this application are as follows: This application ensures that focal length, gimbal attitude, exposure, gain, fill light command, actual current, and temperature all have clear uses in subsequent steps through unified state vectors and timing synchronization, avoiding vacant control features. By using installation parameters, road ground calibration points, mapping model verification, and focal length interpolation, a repeatable effective road area and depth partitioning are formed, rather than just a generalized area division. Brightness, underexposure, overexposure, contrast, texture, and noise are uniformly converted into signed regional errors, and regional quality indicators are directly incorporated into the fill light output solution and feedback verification, forming a clear data closed loop.
[0017] This application utilizes the lighting influence relationship to handle the cross-contributions of multiple near-infrared supplementary lighting units to the near, mid, and far regions. Under constraints of power, temperature, and rate of change, the output is calculated. Unlike simple independent switching light groups or fixed-focal-length power meters, this method further converts the target output into actual current levels and PWM duty cycles, and reads current, temperature, and fault status. This allows the algorithm's calculation results to be implemented in near-infrared LED hardware and the execution effect to be verified. After supplementary lighting, the overall quality is recalculated using the same road mask, normalization, and quality evaluation process, which can distinguish between genuine visibility improvement and pseudo-improvements such as increased brightness, noise, or overexposure. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning, provided in this application embodiment; Figure 2 A schematic diagram illustrating the effective road area and the division of near, middle, and far road depth areas in an embodiment of this application; Figure 3 The following is a luminance statistical histogram before and after exposure gain normalization provided in the embodiments of this application; Figure 4 This is a schematic diagram of the temperature derating curve of the near-infrared supplementary lighting unit provided in the embodiments of this application. Detailed Implementation
[0019] The present solution will now be described in conjunction with the accompanying drawings and specific embodiments.
[0020] Figure 1 A flowchart illustrating a method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning, as provided in this application embodiment, is shown below. Figure 1 This embodiment provides a method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning, comprising: S101 obtains the current preset position, focal length, gimbal attitude, exposure gain parameters, road image, and driving status of each near-infrared supplementary light unit of the high-speed PTZ camera according to a unified timestamp, forming a unified state vector.
[0021] In this embodiment, a high-speed PTZ camera installed at a high position on the side of the road is used. The camera module can be a 4-megapixel, 36x continuous optical zoom integrated network module with a focal length range of approximately 6.8–245mm. The entire unit is equipped with three near-infrared supplementary lighting units with different illumination angles, and the effective supplementary lighting distance at night can be configured to approximately 150m. The zoom code position, focal length status, exposure time, and gain are read from the camera module interface; the pan-tilt angle, pan-tilt angle, preset position number, and pan-tilt rotation status are read from the pan-tilt control interface; the command output, actual current, temperature, and fault status of each near-infrared supplementary lighting unit are read from the supplementary lighting drive interface; and the road image and corresponding frame timestamp are read from the image acquisition interface.
[0022] Based on the frame timestamp of the road image, the most recent time matching or linear interpolation is performed on each read state quantity. If the time difference between a certain state quantity and the image frame timestamp exceeds the allowable threshold, the state quantity is marked as invalid and online calibration is prohibited in that control cycle.
[0023] The formula for converting the zoom-encoded position to the current focal length is as follows: in, The current focal length, This is the current variable-scaling position. and Enclosing in the focal length calibration table Adjacent coding nodes, and This represents the measured focal length corresponding to the encoded node. This calibration table is obtained by reading the zoom code and recording the lens focal length during the camera movement manufacturing or system integration stage. If the camera movement can directly output the focal length, no calculation is required.
[0024] The gimbal horizontal angle, gimbal pitch angle, exposure time, gain, and command outputs, actual currents, and temperatures of each near-infrared supplementary lighting unit are uniformly converted and combined into a unified state vector.
[0025] Based on the changes in focal length, gimbal angle, exposure, gain, and fill light output within adjacent control cycles, as well as the focus completion indicator and day / night mode, the stability index is calculated using the following formula: in, For stability indicators; , , , , and These are the changes in focal length, horizontal angle, pitch angle, exposure, gain, and fill light output in adjacent control cycles, all obtained by state vector difference. , , , , and To correspond to the normalized scale, it is derived from equipment specifications or on-site configuration; , , , , and The stability weights are set through field stable scenario experiments. When the value is below the stabilization threshold and focusing is complete, a stabilization flag is output. Otherwise, real-time illumination may only load basic parameters, but quality feedback calibration and parameter writing will not be performed.
[0026] S102 generates the current road space mapping and reference parameters based on the preset position and focal length, updates the current mapping parameters using the gimbal attitude and focal length, and outputs the current road space mapping parameters.
[0027] This embodiment includes five sub-processes: installation parameter input, on-site calibration point acquisition, mapping model solution, model verification, and focal length interpolation. First, the installation height of the PTZ camera's optical center relative to the road reference plane, the reference horizontal angle and pitch angle, image resolution, lens calibration intrinsic parameters, available preset position numbers, and representative focal length nodes are acquired and recorded. The installation height can be obtained through a rangefinder, construction drawings, or on-site measurement. The reference gimbal angle is read by the gimbal encoder, and the image intrinsic parameters are obtained by the camera body calibration data or calibration board calibration.
[0028] At each preset position and representative focal length node, multiple non-collinear ground calibration points are selected on the road centerline, lane boundary, or road side. The road ground coordinates or longitudinal distance relative to the PTZ camera of the calibration points are obtained by laser ranging, total station, road mileage markers, or known construction coordinates. The pixel coordinates are then manually or automatically recorded in the corresponding road image.
[0029] For roads that are locally approximate planes, the homography matrix is solved using road ground coordinates and image pixel coordinates. For roads with slopes, curves, or significant undulations, multiple homography models are established in segments according to the longitudinal distance of the road, or a pixel row-road distance lookup table model is directly established.
[0030] The reprojection error of the homography mapping model is calculated using the verification calibration points that were not involved in the solution process, using the following formula: in, This refers to the reprojection error of the mapping model at the verification calibration points. To verify the number of points, Let r be the road surface coordinates of the r-th verification point. These are the measured pixel coordinates of the image. This indicates homogeneous coordinate normalization. For the homography mapping model corresponding to the preset position p and focal length node k, when the reprojection error is less than the preset threshold, the mapping model is associated with the corresponding preset position and focal length node and saved to the parameter library.
[0031] Select the corresponding parameter unit based on the current preset position, and determine the position of the current focal length in the parameter library. If the current focal length is located between adjacent calibration nodes, interpolate the mapping model of the adjacent nodes using the following formula: in, This is the initial mapping model corresponding to the current focal length. These are the focal length interpolation coefficients. This is a homography mapping model corresponding to the preset position p and the focal length node k+1. The current focal length, and The current focal length corresponds to the measured focal length of the encoding node. If the current focal length coincides with the calibration node, the mapping model of the calibration node is used directly. For homography parameters that cannot be directly interpolated linearly, interpolation can be performed on the resulting region vertices or distance mapping table.
[0032] Based on the deviation between the current gimbal pitch angle and the calibrated pitch angle, the attitude of the mapping model is corrected, and the corrected mapping model is used as the current road space mapping parameter.
[0033] S103: Determine the effective area of the current road using mapping parameters, divide the effective area of the road into multiple road depth areas, and output the area mask and area confidence of each road depth area.
[0034] In this embodiment, using the current preset position and focal length as indexes, the reference road mask, reference vanishing point, reference lane line or road boundary position, fixed reference object position, and preset actual distance thresholds for near, middle, and far regions are loaded from the parameter library as the initial reference for determining the effective area of the current road. Edge detection and straight line segment extraction are performed on the road image. Candidate lane lines and road boundaries are obtained by combining the reference road mask constraints. The positions of candidate reference objects are obtained by feature point matching or template matching for the fixed reference objects. Candidate vanishing points are obtained based on the intersection of straight lines extending from multiple roads, which serve as the structural features of the current image. A correspondence is established between the extracted current structural features and the loaded reference structural features. Abnormal corresponding points generated by vehicles, shadows, and erroneous edges are removed using random sampling consistency or least squares method with robust loss. Correction transformations limited to small-range homography, affine, or translational scale transformations are obtained. The formula is: in, This is a correction transformation of the current frame relative to the reference road structure. The coordinates of the r-th baseline lane line endpoint, road boundary point, or fixed reference feature are derived from the installation calibration image; These are the coordinates of the corresponding feature matched in the current image; The confidence weights for matching are derived from line segment length, matching distance, or template similarity. The regularization coefficients limit the transformation from the unit transform I, used to prevent large mask drift caused by vehicles and local anomalies. The candidate geometric transformation to be determined during the optimization process is used to map the baseline structural features to the current image coordinate system; It is the square of the Euclidean norm of the two-dimensional coordinate residual, used to measure the geometric matching error between the current feature coordinates and the reference feature coordinates after the candidate transformation. The squared Frobenius norm of the matrix is used to measure the degree of deviation of the candidate transformation T from the identity transformation I; The confidence score of structural features is calculated based on the number of effective matches, reprojection error, vanishing point offset consistency, lane boundary coverage length, and continuous frame stability, using the following formula: in, For structural feature confidence, To restrict the results to a monotonic mapping from 0 to 1; This represents the number of interior points after a robust matching. This represents the number of candidate matches. This represents the average reprojection error; and These are the current vanishing point and the baseline vanishing point, respectively. The length of the image diagonal; The total length of the current effective road boundary or lane lines. As the reference length, , , , These are the weighting coefficients for the in-point ratio, reprojection error penalty, vanishing point offset penalty, and road boundary coverage ratio, respectively. Each weighting coefficient is used to adjust the contribution of the corresponding evaluation item to the confidence of the structural features, and is determined through on-site stable scene sample debugging.
[0035] The structural feature confidence level is compared with a preset confidence threshold. When the structural feature confidence level is lower than the preset confidence threshold, the loaded baseline road mask and baseline depth region boundary are maintained, and the regional confidence level of the corresponding road depth region is reduced. When the structural feature confidence level reaches or exceeds the preset confidence threshold, the baseline road mask and depth boundary are updated using a correction transformation. The formula is as follows: in, This represents the candidate boundary for the i-th depth region that has undergone time-domain smoothing but has not yet been subjected to displacement limiting. This represents the current boundary of the i-th depth region; This is the boundary of the previous control cycle; The reference boundary for loading; This is the boundary smoothing coefficient; This indicates that the datum boundary is updated using a corrective transformation; The maximum permissible boundary displacement is derived from the preset mechanical repeatability accuracy and the permissible error of on-site calibration. Only when... The above formula is applied when the threshold is reached; otherwise... .
[0036] Using the corrected current road spatial mapping parameters, the preset actual distance thresholds for near, middle, and far regions are mapped onto the image coordinate system. Within the defined effective road area, multiple regions are generated from the near, middle, and far distance regions arranged along the road's depth direction, forming region masks for each road depth region. See also... Figure 2 , Figure 2 Taking the perspective contour of the effective road area as an example, the diagram shows the near-distance region Z1, the middle-distance region Z2, and the far-distance region Z3 formed based on the actual longitudinal distance threshold of the road. The near / middle and middle / far boundaries are obtained by mapping the preset actual distance threshold to the image coordinate system using the current road space mapping parameters. When the structural feature confidence level meets the requirements, the boundaries of each partition are updated with amplitude limiting during the correction transformation; when the structural feature confidence level is insufficient, the baseline partition boundaries are maintained. Figure 2Used to describe the spatial relationships of the road's longitudinal areas, without limiting the road shape, number of zones, or specific distance values.
[0037] Based on the calculated structural feature confidence level and the implementation of corrections, regional confidence levels are assigned to each road longitudinal region.
[0038] S104: Normalize the road image based on the exposure gain parameter, calculate the imaging quality index of each depth region by combining the region mask and region confidence, and generate a signed region error vector after comparing it with the target interval.
[0039] In this embodiment, a day / night mode check is first performed. The supplementary lighting loop is only executed when the device is in black-and-white night vision mode or in a mode that allows near-infrared supplementary lighting. In color daytime mode, near-infrared supplementary lighting is turned off and online calibration is stopped. Using the exposure gain parameter as input, a pre-calibrated grayscale response function is called to calculate the normalization coefficient. Then, the brightness value of each pixel in the road image is normalized to generate a normalized image under reference exposure and reference gain conditions. The formula is: in, For normalized brightness, The brightness of the current image pixels; The black level is derived from mechanism calibration or dark field measurement. and These are the grayscale response functions corresponding to exposure time and gain, respectively, derived from uniform illumination calibration during the factory or system integration stage; and The reference exposure and reference gain are set in the parameter library; The maximum gray level of the image. This refers to the exposure time during the current control cycle; The gain for the current control cycle; This represents a truncation function used to limit the normalized pixel brightness to between 0 and 1. Within the range, The exposure gain normalization coefficient is determined by the current exposure time, the current gain, the reference exposure, and the grayscale response corresponding to the reference gain. Moving target detection is performed on the normalized image using inter-frame differencing to identify moving targets in the current road image and generate a moving target mask. Abnormal highlight detection is performed on the normalized image, combining brightness thresholds, low-texture features, geometric shape analysis, and temporal stability criteria to identify vehicle lights, reflective markings, and locally highly reflective road surfaces, generating an abnormal highlight mask. Moving target detection is performed on the normalized image using inter-frame differencing to identify moving targets in the current road image and generate a moving target mask. Abnormal highlight detection is performed on the normalized image, combining brightness thresholds, low-texture features, geometric shape analysis, and temporal stability criteria to identify vehicle lights, reflective markings, and locally highly reflective road surfaces, generating an abnormal highlight mask.
[0040] See Figure 3 , Figure 3 A schematic brightness histogram is used to illustrate the statistical comparability before and after exposure gain normalization. Before normalization, the same scene can form brightness distributions with different locations under different exposure times or gain states. After conversion using the grayscale response function and normalization coefficient, the brightness statistics of each state are converted to reference exposure and reference gain conditions, so that the median brightness, underexposure ratio, and overexposure ratio of the area can be compared under a unified benchmark. Figure 3 The distribution curves in the figure are only used to illustrate the effect of normalization and do not represent actual measured data for specific road scenarios.
[0041] The effective pixel weights for each depth region are calculated based on the moving target mask, abnormal highlight mask, region mask, and region confidence level, using the following formula: in, Let be the pixel weight of the i-th depth region; For area masking; For regional credibility; For moving target mask; Masking for vehicle lights, reflective markings, and areas with abnormally high reflectivity; Additional weights are set based on texture reliability. Each mask has a weight between 0 and 1, and pixels with a weight of 0 are not included in subsequent statistics.
[0042] For each road depth region, the brightness values of each pixel in the output normalized image are weighted and statistically analyzed using the effective pixel weight as the statistical weight, and the weighted median of the effective pixel brightness of each region is calculated to avoid a small number of bright targets significantly changing the statistical results.
[0043] Based on the effective pixel brightness-weighted median, effective pixel weights, and normalized image, the underexposure and overexposure ratios for each road depth region are calculated using the following formulas: in, and These represent the underexposure ratio and overexposure ratio of the i-th road depth region, respectively; This is the set of pixels in that region; Effective pixel weights; and The thresholds for underexposure and overexposure are derived from the grayscale range of the camera module and on-site visibility testing. This is an indicator function that takes the value 1 if the condition is true and 0 otherwise. This is the normalized brightness.
[0044] Underexposure ratio and overexposure ratio are used to identify the proportion of invisible dark pixels and the proportion of near-saturated pixels in a region, respectively.
[0045] Simultaneously, the texture visibility and robust local contrast of each road's depth region are calculated using effective pixel weights and normalized images, with the following formula: in, For robust local contrast in region i; and These are the 90th and 10th weighted luminance quantiles of the effective pixels, respectively. To prevent small positive numbers with a denominator of zero, the quantiles are calculated using normalized brightness and pixel weights. For texture visibility; To normalize the image gradient; An effective gradient threshold is determined using clear road image samples; an increased value typically indicates that road boundaries and textures are more discernible.
[0046] Local contrast is used to determine whether increased brightness brings effective detail, while texture visibility is used to determine whether lane boundaries, road textures, and target outlines are discernible. Temporal noise or inter-frame brightness fluctuations are calculated on stable background pixels to limit spurious brightness improvements caused solely by high gain or frequent fill light changes.
[0047] Load the target quality range of each region corresponding to the current preset position and focal length node from the parameter library, use the calculated quality index of each region to determine the signed supplementary lighting error of each region, and form a region error vector according to the region confidence and control priority of the determined signed supplementary lighting error of each region. At the same time, generate overexposure, underexposure and noise hard constraint flags.
[0048] S105, based on the preset position and focal length loading of each near-infrared supplementary lighting unit and the illumination influence relationship of each depth area, takes the signed region error vector as the control target, and combines the driving state and safety constraints of each near-infrared supplementary lighting unit to solve the target output of each near-infrared supplementary lighting unit.
[0049] In this embodiment, the lighting influence relationship between adjacent focal length nodes is read from the parameter library using the current preset position and focal length as indexes, and the current lighting influence matrix is generated based on the focal length interpolation coefficients. The formula is as follows: in, This is the lighting influence matrix for the current control cycle; and The influence matrix stored for the adjacent focal length nodes of the preset position p. These are the focal length interpolation coefficients.
[0050] Read the current output, actual current, and temperature of each supplementary lighting unit. Calculate the upper limit of the unit's output after temperature derating based on the unit's temperature. The calculation formula is as follows: in, For the j-th supplementary lighting unit at temperature The upper limit of allowed output; This is the rated output; This is the temperature derating factor; To begin reducing the dereferencing temperature, The forced shutdown temperature is derived from both device thermal design and reliability testing, and is combined with the drive failure state to eliminate unusable supplementary lighting units.
[0051] See Figure 4 When the temperature of the supplementary lighting unit is lower than the temperature at which derating begins At that time, the temperature derating factor Maintain a value of 1, corresponding to the rated allowable output; temperature is located at With forced shutdown temperature Between these two points, the temperature derating coefficient gradually decreases as the temperature increases; when the temperature reaches or exceeds a certain level... When this occurs, the output is allowed to drop to 0 and the corresponding supplementary light unit is turned off. Figure 4 Used to illustrate temperature derating relationships. and The specific values are determined by the device's thermal design and reliability testing.
[0052] Using the signed region error vector as the control objective and the current lighting influence matrix as the prediction model, a constrained optimization objective function is established, encompassing prediction region error, output adjustment magnitude, and smoothness between adjacent periods. Candidate output adjustment values are then calculated using the following formula: in, Adjust the candidate output for each supplementary lighting unit; This is the region weight matrix; The lighting effect matrix; This is the region error vector; The weighting coefficients for the output adjustment amplitude regularization term are used to suppress excessive adjustment of single supplementary light output; These are the weighting coefficients for the smoothing term in adjacent control cycles, used to suppress sudden output changes between consecutive control cycles; To optimize the variables, we represent the candidate adjustment vectors of each near-infrared supplementary lighting unit relative to the current output in this control cycle; This represents the output adjustment already accepted in the previous control cycle. A feasibility check is performed on the solution results. If no feasible solution exists, the overtemperature and total power safety constraints are prioritized, and projection, scaling, or safety parameters are used as replacements according to region priority.
[0053] S106 converts the target output into driving commands for each near-infrared supplementary lighting unit and sends them out for execution. After reading back the actual driving status, it re-acquires the road image and compares the imaging quality after the supplementary lighting adjustment. Based on the comparison results, it provides feedback on the supplementary lighting adjustment.
[0054] In this embodiment, based on the target output of each supplementary lighting unit and the current temperature, the current level that meets the output requirements and has the smallest quantization error is selected from the pre-calibrated drive mapping table, and the corresponding PWM duty cycle is calculated under the selected current level. After limiting and grading the changes in current level and PWM duty cycle, drive commands are sent to each supplementary lighting unit through the drive communication interface.
[0055] After waiting for the preset electrical and optical stabilization time, the actual current, temperature and fault status of each supplementary light unit are read back through the drive communication interface. The actual equivalent output is estimated based on the read-back actual current and temperature. If the deviation between the target output and the estimated actual output exceeds the threshold, or if over-temperature, over-current, open circuit, short circuit or communication timeout occurs, the corresponding supplementary light unit is marked as unusable or derated, a hardware abnormality flag is output, and the remaining available units are used to resolve or switch safety parameters.
[0056] If the deviation between the target output and the estimated actual output is within the preset range, re-acquire road images, recalculate the adjusted regional error and overall imaging quality according to the determined effective road area and depth division, compare the adjusted overall imaging quality with the calculated overall imaging quality before adjustment, if the overall imaging quality improves and the hard constraint is not broken, maintain the current output, and use the output deviation under continuous and stable improvement to generate online calibration candidate versions, if the overall imaging quality does not improve or the hard constraint is broken, reduce the control step size and solve again or restore the output before supplementary lighting.
[0057] In this embodiment, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0058] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.
Claims
1. A method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning, characterized in that, include: According to the unified timestamp, the current preset position, focal length, gimbal attitude, exposure gain parameters, road image and driving status of each near-infrared supplementary light unit of the high-speed PTZ camera are obtained to form a unified state vector. Based on the preset position and focal length, the current road space mapping and reference parameters are generated, and the current mapping parameters are updated using the gimbal attitude and focal length, and the current road space mapping parameters are output. The effective area of the current road is determined using the mapping parameters, and the effective area of the road is divided into multiple road depth areas. The area mask and area confidence of each road depth area are output. The road image is normalized according to the exposure gain parameter, and the imaging quality index of each depth region is calculated by combining the region mask and region confidence, and a signed region error vector is generated after comparing with the target interval. Based on the influence of the preset position and focal length loading of each near-infrared supplementary lighting unit on the illumination of each depth area, the target output of each near-infrared supplementary lighting unit is solved by taking the signed region error vector as the control target and combining the driving state and safety constraints of each near-infrared supplementary lighting unit. The target output is converted into driving commands for each near-infrared supplementary lighting unit and executed. After reading back the actual driving state, the road image is re-acquired, and the imaging quality after the supplementary lighting adjustment is compared. Feedback response is given to this supplementary lighting adjustment based on the comparison results.
2. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 1, characterized in that, The process involves obtaining the current preset position, focal length, gimbal attitude, exposure gain parameters, road image, and driving state of each near-infrared illumination unit of the high-speed PTZ camera according to a unified timestamp, forming a unified state vector, including: The zoom encoding position, focal length status, exposure time and gain are read from the camera interface, the gimbal horizontal angle, gimbal pitch angle, preset position number and gimbal rotation status are read from the gimbal control interface, the command output, actual current and temperature of each near-infrared supplementary light unit are read from the supplementary light drive interface, and the road image and corresponding frame timestamp are read from the image acquisition interface. Based on the frame timestamp of the road image, time matching or linear interpolation is performed on each read state quantity. If the time difference between any state quantity and the frame timestamp exceeds the allowable threshold, it is marked as invalid. The zoom-encoded position is converted to the current focal length using the following formula: in, The current focal length, This is the current variable-scaling position. and Enclosing in the focal length calibration table Adjacent coding nodes, and The measured focal length corresponding to the encoding node; The gimbal horizontal angle, gimbal pitch angle, exposure time, gain, and command outputs, actual currents, and temperatures of each near-infrared supplementary lighting unit are uniformly converted and combined into a unified state vector.
3. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 1, characterized in that, Based on the preset position and focal length, a current road space mapping and reference parameters are generated, and the current mapping parameters are updated using the gimbal attitude and focal length. The current road space mapping parameters are then output, including: Acquire and record the installation height of the PTZ camera's optical center relative to the road reference plane, the reference horizontal angle and pitch angle, image resolution, lens calibration parameters, available preset position numbers, and representative focal length nodes; At each preset position and representative focal length node, select multiple non-collinear ground calibration points on the road centerline, lane boundary, or road side, obtain the road ground coordinates or longitudinal distance relative to the PTZ camera for each calibration point, and record the corresponding pixel coordinates in the road image; Based on the correspondence between the road ground coordinates and the image pixel coordinates, the homography mapping model of the preset position and focal length nodes is solved; The reprojection error of the homography mapping model is calculated using the verification calibration points that were not involved in the solution process, using the following formula: in, This refers to the reprojection error of the mapping model at the verification calibration points. To verify the number of points, Let r be the road surface coordinates of the r-th verification point. These are the measured pixel coordinates of the image. This indicates homogeneous coordinate normalization. This is a homography mapping model corresponding to the preset position p and the focal length node k; When the reprojection error is less than a preset threshold, the mapping model is associated with the corresponding preset position and focal length node and saved to the parameter library; Select the corresponding parameter unit based on the current preset position and determine the position of the current focal length in the parameter library; if the current focal length is between adjacent calibration nodes, interpolate the mapping model of the adjacent nodes; if the current focal length coincides with the calibration node, directly use the mapping model of the calibration node. Based on the deviation between the current gimbal pitch angle and the calibrated pitch angle, the attitude of the mapping model is corrected, and the corrected mapping model is used as the current road space mapping parameter.
4. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 3, is characterized in that... If the current focal length is between adjacent calibration nodes, the formula for interpolating the mapping model of adjacent nodes is: in, This is the initial mapping model corresponding to the current focal length. These are the focal length interpolation coefficients. This is a homography mapping model corresponding to the preset position p and the focal length node k+1. The current focal length, and This represents the measured focal length corresponding to the encoding node.
5. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 1, characterized in that, The effective area of the current road is determined using the mapping parameters, and the effective area is divided into multiple road depth regions. The region mask and region confidence level of each road depth region are output, including: Using the current preset position and focal length as an index, load the reference road mask, reference vanishing point, reference lane line or road boundary position, fixed reference position, and preset actual distance thresholds for near, middle and far areas from the parameter library as the initial reference for determining the effective area of the current road. Edge detection and straight line segment extraction are performed on the road image. Candidate lane lines and road boundaries are obtained by combining the baseline road mask constraint. The positions of candidate reference objects are obtained by feature point matching or template matching for fixed reference objects. Candidate vanishing points are obtained based on the intersection of straight lines extending from multiple roads, which serve as the structural features of the current image. The extracted current structural features are correlated with the loaded baseline structural features. Random sampling consistency or least squares with robust loss is used to remove abnormal correspondences caused by vehicles, shadows, and erroneous edges. A correction transformation, limited to a small range of homography, affine, or translational scaling, is then calculated using the following formula: in, This is a correction transformation of the current frame relative to the reference road structure. For the r-th baseline lane line endpoint, road boundary point, or fixed reference feature coordinates; These are the coordinates of the corresponding feature matched in the current image; To match confidence weights; To limit the regularization coefficients that restrict the transformation from deviating from the unity transform I, The candidate geometric transformations to be determined during the optimization process, Let the square of the Euclidean norm of the two-dimensional coordinate residuals be denoted as . The square of the Frobenius norm of the matrix; The confidence score of structural features is calculated based on the number of effective matches, reprojection error, vanishing point offset consistency, lane boundary coverage length, and continuous frame stability, using the following formula: in, For structural feature confidence, To restrict the results to a monotonic mapping from 0 to 1; This represents the number of interior points after a robust matching. This represents the number of candidate matches. This represents the average reprojection error; and These are the current vanishing point and the baseline vanishing point, respectively. The length of the image diagonal; The total length of the current effective road boundary or lane lines. As the reference length, , , , These are the weighting coefficients for the interior point ratio term, the reprojection error penalty term, the vanishing point offset penalty term, and the road boundary coverage ratio term, respectively. The confidence level of the structural feature is compared with a preset confidence threshold. When the confidence level of the structural feature is lower than the preset confidence threshold, the loaded reference road mask and reference depth region boundary are maintained, and the regional confidence level of the corresponding road depth region is reduced. When the confidence level of the structural feature reaches or exceeds the preset confidence threshold, the reference road mask and depth boundary are updated using the correction transformation; Using the corrected current road space mapping parameters, the preset actual distance thresholds of the near, middle and far regions are mapped to the image coordinate system respectively. Multiple regions are generated in the near, middle and far regions arranged along the road depth direction within the determined effective road area, forming a region mask for each road depth region. Based on the calculated structural feature confidence level and the implementation of corrections, regional confidence levels are assigned to each road longitudinal region.
6. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 1, characterized in that, The road image is normalized based on the exposure gain parameter. The imaging quality index of each depth region is calculated by combining the region mask and region confidence level, and then compared with the target interval to generate a signed region error vector, including: Using the exposure gain parameter as input, after calculating the normalization coefficient by calling the pre-calibrated grayscale response function, the brightness value of each pixel in the road image is normalized to generate a normalized image under reference exposure and reference gain conditions. The formula is as follows: in, For normalized brightness, The current image pixel brightness; Black level; and These are the grayscale response functions corresponding to exposure time and gain, respectively; and The reference exposure and reference gain are set in the parameter library; The maximum gray level of the image; The exposure time for the current control cycle; This represents the gain for the current control cycle. This represents the truncation function; Moving target detection is performed on the normalized image, and the inter-frame difference method is used to identify moving targets in the current road image to generate a moving target mask; The normalized image is subjected to abnormal brightness detection. Combined with brightness threshold, low texture features, geometric shape analysis and temporal stability criteria, vehicle lights, reflective markings and local high reflectivity road surface are identified to generate an abnormal brightness mask. The effective pixel weights for each depth region are calculated based on the moving target mask, the abnormal highlight mask, the region mask, and the region confidence level. For each road depth region, the effective pixel weights are used as statistical weights to perform weighted statistics on the brightness values of each pixel in the output normalized image, and the weighted median of the effective pixel brightness of each region is calculated. Based on the effective pixel brightness weighted median, effective pixel weight, and normalized image, the underexposure ratio and overexposure ratio of each road depth region are calculated respectively. Simultaneously, the effective pixel weights and normalized images are used to calculate the texture visibility and robust local contrast of each road depth region; Load the target quality range of each region corresponding to the current preset position and focal length node from the parameter library, and use the calculated quality index of each region to determine the signed supplementary lighting error of each region; The signed supplementary lighting errors of each determined region are combined to form a region error vector.
7. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 6, is characterized in that... The formula for calculating the effective pixel weights of each depth region based on the moving target mask, the abnormal highlight mask, the region mask, and the region confidence level is as follows: in, Let be the pixel weight of the i-th depth region; For area masking; For regional credibility; For moving target mask; Masking for vehicle lights, reflective markings, and areas with abnormally high reflectivity; Additional weights set based on texture reliability.
8. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 1, characterized in that, Based on the influence of the preset position and focal length loading of each near-infrared supplementary lighting unit on the illumination of each depth region, and using the signed region error vector as the control target, combined with the driving state and safety constraints of each near-infrared supplementary lighting unit, the target output of each near-infrared supplementary lighting unit is solved, including: Using the current preset position and focal length as indices, the lighting influence relationships of adjacent focal length nodes are read from the parameter library, and the current lighting influence matrix is generated based on the focal length interpolation coefficients. The formula is as follows: in, This is the lighting influence matrix for the current control cycle; and The influence matrix stored for the adjacent focal length nodes of the preset position p. These are the focal length interpolation coefficients; Read the current output, actual current and temperature of each supplementary lighting unit, calculate the upper limit of the unit output after temperature derating based on the temperature of each supplementary lighting unit, and eliminate unusable supplementary lighting units in combination with the drive fault status; Using the signed region error vector as the control objective and the current lighting influence matrix as the prediction model, a constrained optimization objective function is established, which includes prediction region error, output adjustment magnitude, and smoothness between adjacent periods as objectives. Candidate output adjustment values are then calculated using the following formula: in, Adjust the candidate output for each supplementary lighting unit; This is the region weight matrix; For the lighting effect matrix, This is the region error vector; The weighting coefficients for the output adjustment magnitude regularization term; These are the weighting coefficients for the smoothing terms of adjacent control cycles; To optimize variables, This is the output adjustment amount that was accepted in the previous control cycle.
9. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 8, characterized in that, The formula for calculating the upper limit of the unit output after temperature derating for each supplementary lighting unit is as follows: Read the current output, actual current, and temperature of each supplementary lighting unit. in, For the j-th supplementary lighting unit at temperature The upper limit of allowed output; This is the rated output; This is the temperature derating factor; To begin reducing the dereferencing temperature, To force the temperature to shut down.
10. The method for near-infrared zonal illumination and online calibration of a high-speed PTZ camera based on focal length and road depth zoning as described in claim 1, characterized in that, The target output is converted into driving commands for each near-infrared illumination unit and executed. After reading back the actual driving state, the road image is re-acquired, and the imaging quality after illumination adjustment is compared. Based on the comparison results, feedback is provided for this illumination adjustment, including: Based on the target output of each supplementary lighting unit and the current temperature, the current level that meets the output requirements and has the smallest quantization error is selected from the pre-calibrated drive mapping table, and the corresponding PWM duty cycle is calculated under the selected current level; after limiting and grading the changes in current level and PWM duty cycle, drive commands are sent to each supplementary lighting unit through the drive communication interface. After waiting for the preset electrical and optical stabilization time, the actual current, temperature and fault status of each supplementary light unit are read back through the drive communication interface, and the actual equivalent output is estimated based on the read-back actual current and temperature. If the deviation between the target output and the estimated actual output exceeds the threshold, or if overheating, overcurrent, open circuit, short circuit, or communication timeout occurs, the corresponding supplementary lighting unit will be marked as unavailable or derating, a hardware abnormality flag will be output, and the remaining available units will be used to resolve or switch safety parameters. If the deviation between the target output and the estimated actual output is within the preset range, re-acquire road images, and recalculate the adjusted regional error and overall imaging quality according to the determined effective road area and depth division. The adjusted overall imaging quality is compared with the calculated overall imaging quality before adjustment. If the overall imaging quality is improved and the hard constraints are not broken, the current output is maintained, and the output deviation under continuous and stable improvement is used to generate online calibration candidate versions. If the overall imaging quality is not improved or the hard constraints are broken, the control step size is reduced and the solution is recalculated or the output before supplemental lighting is restored.
