Zoom camera focusing curve full-scene rapid calibration method

By using a step-driven zoom component and combining contrast detection and high-frequency image component calculations to obtain a sharpness index, a baseline focus curve is generated and fitted with the theoretical curve. This solves the focusing error problem of zoom cameras at different object distances, achieving efficient and accurate all-scene focus calibration, and improving image quality and applicability.

CN121842507APending Publication Date: 2026-04-10深圳森云智能科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-09
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, zoom cameras have errors in focusing curve calibration at different object distances. In particular, in close-up or long-distance scenes, lens assembly errors and optical distortion lead to large errors in the calculation of sharpness indicators, which affect image quality.

Method used

The zoom component is driven by a stepping method. The sharpness index is calculated by combining contrast detection and high-frequency components of the image to generate a reference focus curve. This curve is then fitted with a weighted average of the theoretical focus curve. A three-dimensional focus surface covering the entire scene is generated by expanding the curve with constant parameters and iteratively adjusting it to compensate for deviations.

Benefits of technology

It significantly improves the imaging accuracy and applicability of zoom cameras in all scenarios, reduces data acquisition and calibration time, lowers equipment and time costs, and achieves efficient dynamic focusing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121842507A_ABST
    Figure CN121842507A_ABST
Patent Text Reader

Abstract

The invention relates to the field of camera focusing, and discloses a zoom camera focusing curve full-scene rapid calibration method comprising the following steps: S101, selecting a single object distance as a calibration reference, and acquiring focusing data by driving a zoom group and a focusing group to obtain a reference focusing curve, the reference focusing curve represents the corresponding relation between the zoom magnification and the focusing position under the fixed object distance, and the method comprises the steps that firstly, in the aspects of the focusing precision and quality of the zoom camera, a multi-point testing environment under the fixed object distance is constructed, and step driving is combined with contrast detection and definition index calculation based on image high-frequency components; the corresponding data of the zoom magnification and the focusing position are accurately collected, weighted average fitting is carried out by combining a theoretical focusing curve, a deviation value is calculated and adjusted to form an initial curved surface model, and finally a three-dimensional zoom focusing curved surface covering the whole scene object distance is generated, so that the overall imaging precision and applicability of the lens system are remarkably improved, and the imaging quality is improved. And efficient dynamic focusing in a full scene is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of camera focusing, and more particularly to a method for rapid calibration of the focusing curve of a zoom camera in all scenarios. Background Technology

[0002] With the rapid development of image processing and semiconductor technologies, zoom cameras, due to their ability to flexibly change focal length to adapt to the needs of different shooting scenarios, have been widely used in many fields such as security monitoring, smartphones, drone aerial photography, autonomous driving, and industrial inspection. One of the core functions of zoom cameras is to achieve accurate and fast focusing to ensure that clear and sharp images can be obtained at different focal lengths.

[0003] In actual production scenarios, due to limitations in equipment and time costs, only a suitable object distance can usually be selected for data collection. A reference focus curve is obtained by stepping the zoom group and focus group. However, single object distance data cannot directly reflect the focusing characteristics at other object distances. Especially in close-range or long-range scenarios, lens assembly errors and optical distortion can cause significant deviations between the theoretical focus curve and the actual data. In addition, interference factors such as lighting conditions in the production environment, differences in the surface texture of the target object, and equipment vibration further increase the error in the sharpness index calculation, directly affecting the accuracy of the reference curve. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method for rapid calibration of the focus curve of a zoom camera across all scenarios, thus solving the above problems.

[0005] To achieve the above objectives, the present invention provides a method for rapid calibration of the focus curve of a zoom camera across all scenes, comprising the following steps: S101. Select a single object distance as the calibration reference, and collect focusing data by driving the zoom group and the focus group to obtain the reference focus curve. The reference focus curve represents the correspondence between the zoom magnification and the focus position under a fixed object distance. S102. The zoom group is driven to gradually increase from the initial magnification using a stepping method. After each step increase, the position of the zoom group is fixed. Based on the current position, the focus group is driven to move through contrast detection, and image data is collected and the sharpness index is calculated. S103. If the sharpness index reaches its peak, the corresponding position of the focus group is recorded as a data point. It is determined whether the zoom group has completed all steps. If not, the zoom group is driven to add one more step and the acquisition process is repeated. S104. If the zoom group completes all steps, the reference focus curve is obtained by fitting the recorded data points, and the sharpness index is calculated based on the high-frequency components of the image. S105. The theoretical focusing curve provided by the zoom lens system is fitted with the reference focusing curve to generate a zoom focusing surface covering the object distance of the entire scene. The zoom focusing surface is used to describe the dynamic relationship between zoom ratio, focusing position and object distance. S106. Calculate the deviation between the reference focusing curve and the theoretical focusing curve, adjust the theoretical focusing curve according to the deviation to form an initial surface model, and expand the initial surface model to multiple object distance ranges through constant parameters to generate a three-dimensional surface. S107. Verify the applicability of the three-dimensional surface under different object distances. If the deviation exceeds the preset threshold, iteratively adjust the constant parameter and output the three-dimensional surface as the final zoom focusing surface for calibration applications.

[0006] Preferably, in step S101, the specific steps for selecting a single object distance as the calibration reference are as follows: S1011. By constructing a multi-point test scenario with a fixed object distance, the zoom component and the focus component are driven to adjust synchronously, and the corresponding data of zoom magnification and focus position are obtained from different test points to obtain the initial dataset. S1012. Based on the initial dataset, the data points are filtered using a preset threshold range. If a data point is detected to exceed the threshold range, the data point is removed to obtain the filtered dataset. S1013. For the filtered dataset, the data is classified according to different locations in the test scenario through grouping processing to obtain the classified data groups. S1014. From the classified data groups, extract the corresponding data of zoom magnification and focus position for each point, and use linear interpolation to fill in the missing data to obtain a complete dataset. S1015. Based on the complete dataset, construct an independent mapping table between zoom magnification and focus position for each test point, and determine the data characteristics of each point. S1016. By integrating the data characteristics of each point, the overall data distribution under the multi-point test scenario is integrated to obtain a unified reference dataset of zoom magnification and focus position. S1017. For the reference dataset, generate a control parameter table suitable for multi-point test scenarios with a fixed object distance, and determine the benchmark data for drive control.

[0007] Preferably, in step S102, the specific steps for acquiring image data and calculating the sharpness index are as follows: S1021. Drive the zoom component to gradually increase from the initial magnification using a stepping method, and fix the current position after each increase to obtain the stable state data of the zoom component. S1022. Based on the acquired stable state data, the focus component is driven to adjust its position using a contrast detection method, and corresponding image data is acquired. S1023. The collected image data is processed using a preset sharpness calculation method to obtain the sharpness value for each location. S1024. If the obtained sharpness value does not reach the preset threshold range, the focus component is driven to fine-tune again based on the current position data to obtain new image data. S1025. Based on the fine-tuned image data, reprocess it using the sharpness calculation method to determine whether the adjusted sharpness value meets the requirements. S1026. After multiple adjustments to the sharpness values, the position data of each zoom component and focus component are stored in a recording manner to obtain a complete adjustment dataset. S1027. For the complete adjusted dataset, the data is divided into layers according to zoom level by a grouping processing method, the continuity between the data in each layer is determined, and the final matching record is obtained.

[0008] Preferably, in step S104, the reference focus curve is fitted using a quadratic polynomial regression algorithm, and the fitting equation is y=0.2x²+5x+500, where y is the focus position and x is the zoom ratio.

[0009] Preferably, in step S105, the theoretical focus curve is provided by the zoom lens system and is fitted by a weighted average with the reference focus curve. The theoretical curve has a weight of 0.6 and the reference curve has a weight of 0.4.

[0010] Preferably, in step S106, the constant parameters include a deviation scaling factor and an object distance expansion step size. The deviation between the reference curve and the theoretical curve is smoothed using a weighted average algorithm to generate an initial surface model.

[0011] Preferably, in step S106, the generation of the three-dimensional surface is achieved by constructing the relationship matrix between the object distance and the zoom ratio using a bilinear interpolation algorithm, and then by fitting the three-dimensional surface using a quadratic surface model z=ax²+by²+cxy+dx+ey+f, where a to f are fitting parameters.

[0012] Preferably, in step S107, the specific method for verifying the applicability of the three-dimensional curved surface is as follows: test points are selected in a range of 1.5 meters to 12.0 meters with a step size of 1.5 meters. If the deviation value exceeds the preset threshold of 3 steps, the constant parameter is iteratively adjusted by the gradient descent algorithm until the deviation value is ≤ 2.5 steps.

[0013] Preferably, in step S107, when iteratively adjusting the constant parameters, the light intensity is introduced as an auxiliary variable to analyze the focus shift under a light intensity variation of 500~2000 lux. Each 500 lux variation corresponds to a 0.5-step shift, and the surface parameters are automatically adjusted.

[0014] Preferably, the final zoom focusing surface is stored in the device firmware in the form of a mapping table. The mapping table contains the correspondence between object distance, zoom magnification and focus position, which is used for subsequent real-time focus compensation.

[0015] Beneficial effects This invention provides a method for rapid calibration of focus curves for zoom cameras across all scenes. Compared with existing technologies, it has the following advantages: In this invention, firstly, regarding the focusing accuracy and quality of zoom cameras, a multi-point test environment with a fixed object distance is constructed. A step-driven approach combined with contrast detection and sharpness index calculation based on high-frequency image components is used to accurately collect corresponding data for zoom magnification and focusing position. By combining theoretical focusing curves with weighted average fitting and calculating deviation values ​​to adjust and form an initial surface model, a three-dimensional zoom focusing surface covering all object distances is finally generated. This effectively compensates for focusing deviations caused by lens assembly errors, optical distortion, and environmental interference, significantly improving the overall imaging accuracy and applicability of the lens system and achieving efficient dynamic focusing in all scenarios. Secondly, regarding efficiency and cost, this method only requires collecting baseline data for a single object distance in a production environment. Through constant parameter expansion and iterative verification, a three-dimensional focusing surface covering multiple object distances can be quickly fitted, greatly reducing data acquisition and calibration time, significantly lowering equipment and time costs, and avoiding the tedious process of multiple calibrations for different object distance scenarios. Attached Figure Description

[0016] Figure 1 This is a flowchart of a method for rapid calibration of the focus curve of a zoom camera in all scenes, as proposed in this invention. Figure 2 This is a focus curve diagram of a zoom camera focus curve fast calibration method for all scenes proposed in this invention. Detailed Implementation

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

[0018] Please see Figures 1-2 The present invention provides two technical solutions, specifically including the following embodiments: Example 1: A method for rapid calibration of focus curves for zoom cameras across all scenes includes the following steps: S101. Select a single object distance as the calibration reference, and collect focusing data by driving the zoom group and the focus group to obtain the reference focus curve. The reference focus curve represents the correspondence between the zoom magnification and the focus position under a fixed object distance. In S101, the specific steps for selecting a single object distance as the calibration reference are as follows: S1011. By constructing a multi-point test scenario with a fixed object distance, the zoom component and the focus component are driven to adjust synchronously, and the corresponding data of zoom magnification and focus position are obtained from different test points to obtain the initial dataset. S1012. Based on the initial dataset, the data points are filtered using a preset threshold range. If a data point is detected to exceed the threshold range, the data point is removed to obtain the filtered dataset. S1013. For the filtered dataset, the data is classified according to different locations in the test scenario through grouping processing to obtain the classified data groups. S1014. From the classified data groups, extract the corresponding data of zoom magnification and focus position for each point, and use linear interpolation to fill in the missing data to obtain a complete dataset. S1015. Based on the complete dataset, construct an independent mapping table between zoom magnification and focus position for each test point, and determine the data characteristics of each point. S1016. By integrating the data characteristics of each point, the overall data distribution under the multi-point test scenario is integrated to obtain a unified reference dataset of zoom magnification and focus position. S1017. For the reference dataset, generate a control parameter table suitable for multi-point test scenarios with a fixed object distance, and determine the benchmark data for drive control.

[0019] Specifically, in the process of selecting a single object distance as the calibration benchmark and obtaining the benchmark focus curve, a fixed object distance, such as 2.5 meters, is first automatically set by the system as the calibration benchmark. The initial data at this object distance is recorded using a high-precision range sensor to ensure that the error is controlled within ±0.01 meters.

[0020] Next, the system drives the zoom group to gradually adjust from the minimum focal length (e.g., 1x) to the maximum focal length (e.g., 10x), collecting data in segments with a step size of 0.5x. At the same time, the linkage focuses the group to automatically search for the best focus position at each zoom level and records the corresponding focus motor step value. For example, the focus position is 500 steps at 1x zoom, 520 steps at 2x zoom, and so on, until the full range of data acquisition is completed.

[0021] During data acquisition, the system monitors image sharpness in real time and uses an image sharpness evaluation algorithm based on the Laplacian operator to calculate the sharpness value of each focus position. The position corresponding to the sharpness peak is selected as the optimal focus point to ensure data accuracy.

[0022] Subsequently, the system performs fitting analysis on the collected zoom ratio and focus position data, and uses a quadratic polynomial regression algorithm to calculate the baseline focus curve. For example, the fitting equation is y=0.2x²+5x+500, where y is the focus position and x is the zoom ratio. The correlation coefficient R² reaches more than 0.98, indicating that the curve fitting accuracy is high.

[0023] Finally, the system validates the fitted curve by randomly selecting a zoom ratio (e.g., 3.5x) at a fixed object distance of 2.5 meters to predict the focus position and comparing it with the actual collected data. The error is controlled within ±2 steps, thus verifying the reliability of the curve.

[0024] S102. The zoom group is driven to gradually increase from the initial magnification using a stepping method. After each step increase, the position of the zoom group is fixed. Based on the current position, the focus group is driven to move through contrast detection, and image data is collected and the sharpness index is calculated. In S102, the specific steps for acquiring image data and calculating the sharpness index are as follows: S1021. Drive the zoom component to gradually increase from the initial magnification using a stepping method, and fix the current position after each increase to obtain the stable state data of the zoom component. S1022. Based on the acquired stable state data, the focus component is driven to adjust its position using a contrast detection method, and corresponding image data is acquired. S1023. The collected image data is processed using a preset sharpness calculation method to obtain the sharpness value for each location. S1024. If the obtained sharpness value does not reach the preset threshold range, the focus component is driven to fine-tune again based on the current position data to obtain new image data. S1025. Based on the fine-tuned image data, reprocess it using the sharpness calculation method to determine whether the adjusted sharpness value meets the requirements. S1026. After multiple adjustments to the sharpness values, the position data of each zoom component and focus component are stored in a recording manner to obtain a complete adjustment dataset. S1027. For the complete adjusted dataset, the data is divided into layers according to zoom level by a grouping processing method, the continuity between the data in each layer is determined, and the final matching record is obtained.

[0025] S103. If the sharpness index reaches its peak, record the corresponding position of the focus group as a data point, determine whether the zoom group has completed all steps, and if not, continue to drive the zoom group to add one more step and repeat the acquisition process. S104. If the zoom group completes all steps, the reference focus curve is obtained by fitting the recorded data points. The sharpness index is calculated based on the high-frequency components of the image. In S104, the reference focus curve is obtained by using a quadratic polynomial regression algorithm. The fitting equation is y=0.2x²+5x+500, where y is the focus position and x is the zoom ratio. S105. By fitting the theoretical focusing curve provided by the zoom lens system with the reference focusing curve, a zoom focusing surface covering the object distance of the entire scene is generated. The zoom focusing surface is used to describe the dynamic relationship between zoom ratio, focus position and object distance. In S105, the theoretical focusing curve is provided by the zoom lens system and is fitted with a weighted average of the reference focusing curve. The weight of the theoretical curve is 0.6 and the weight of the reference curve is 0.4. S106. Calculate the deviation between the reference focus curve and the theoretical focus curve. Adjust the theoretical focus curve according to the deviation to form an initial surface model. Expand the initial surface model to multiple object distance ranges through constant parameters to generate a three-dimensional surface. In S106, the constant parameters include the deviation scaling factor and the object distance expansion step size. The deviation between the reference curve and the theoretical curve is smoothed by a weighted average algorithm to generate the initial surface model. The three-dimensional surface is generated by constructing the relationship matrix between object distance and zoom ratio using a bilinear interpolation algorithm and then fitting it with a quadratic surface model z=ax²+by²+cxy+dx+ey+f, where a to f are fitting parameters. S107. Verify the applicability of the 3D surface under different object distances. If the deviation exceeds the preset threshold, iteratively adjust the constant parameters and output the 3D surface as the final zoom focusing surface for calibration applications. The specific method for verifying the applicability of the 3D surface is as follows: select test points in the range of 1.5 meters to 12.0 meters with a step size of 1.5 meters. If the deviation value exceeds the preset threshold by 3 steps, iteratively adjust the constant parameters through the gradient descent algorithm until the deviation value is ≤2.5 steps. When iteratively adjusting the constant parameters, simultaneously introduce the light intensity as an auxiliary variable to analyze the focus shift under the light intensity variation of 500~2000 lux. Every 500 lux change corresponds to 0.5 steps of shift. Automatically adjust the surface parameters. The final zoom focusing surface is stored in the device firmware in the form of a mapping table. The mapping table contains the correspondence between object distance, zoom magnification and focus position for subsequent real-time focus compensation.

[0026] Example 2: Based on Example 1, in constructing a multi-point test environment with a fixed object distance and acquiring a reference focus curve, the system first establishes a test benchmark at a preset object distance of 3.0 meters using an automated ranging module. Initial distance data is acquired using a high-precision laser rangefinder, with the error controlled within ±0.02 meters. Subsequently, the system automatically adjusts the multi-point layout within the test environment, distributing test points at key nodes within the zoom range. For example, reference points are set at 1x, 5x, and 8x zoom magnifications. Then, the system drives the zoom group to gradually increase from 1x to 9x, performing segmented scanning in 1x increments. Simultaneously, the focus group... At different zoom levels, the system performs fine-tuning of the position using a preset stepper motor control algorithm, recording the motor stepping data for each point. For example, at 3x zoom, the system records 480 steps to the focus position and 510 steps at 6x zoom. The entire data acquisition process is completed automatically by the system. In the data processing stage, the system uses a gradient descent-based optimization algorithm to analyze the acquired multi-point data, calculate the focus position deviation at each zoom level, and generate a preliminary correspondence table. Subsequently, the system uses a cubic spline interpolation algorithm to smooth the data, forming a continuous mapping relationship. For example, after interpolation, the predicted focus position at 4.5x zoom is 495 steps. Next, the system uses weighted least squares to fit the data to obtain the reference focus curve equation, such as y=0.15x²+3.2x+470, where y represents the focus position and x represents the zoom ratio. The correlation coefficient after fitting reaches 0.97, ensuring mapping accuracy. Finally, the system associates the generated curve data with the lens calibration module, automatically stores it in the device's internal database, and interfaces with subsequent image processing operations to form a data-driven closed-loop control logic. The entire process is executed by an automated system to ensure data consistency and processing efficiency. Preferably, the system uses an automated control module to drive the zoom group in steps, starting from an initial 2.0x zoom ratio and gradually adjusting to 6.0x zoom ratio in increments of 0.5x. After each adjustment, the system uses a built-in positioning sensor to lock the zoom group position, with the error controlled within ±0.01x to ensure positional stability. Subsequently, based on the current zoom ratio, the system collects real-time image data through an image sensor and activates a contrast detection algorithm to drive the focus group movement. This algorithm calculates the contrast value of each pixel based on the image grayscale gradient, sets a threshold of 50, and gradually adjusts the focus group position, for example, starting from the initial position of 300 steps and increasing in increments of 10 steps to 400 steps, to find the contrast peak. Next, the system acquires multiple frames of image data at each zoom level, for example, 10 frames at 3.5x zoom. It calculates the sharpness index for each frame, uses an edge detection method based on the Laplacian operator to obtain an average sharpness score, for example, 78.5, and compares this data with historical records. If the score is lower than the preset value of 70, the system automatically triggers a secondary fine-tuning of the focus group position, reducing the adjustment step size to 5 steps until the score reaches the expected range. Finally, the system summarizes the sharpness index and corresponding focus position data for all zoom levels, analyzes the trend using a linear regression algorithm, for example, obtaining a correlation with a slope of 2.3, which is used for dynamic adjustments in the subsequent image optimization module. The entire process is executed automatically by the system, forming a complete closed-loop logic from zoom adjustment to sharpness evaluation.

[0027] Preferably, in the image processing system, when the sharpness index reaches its peak, the system automatically records the current position of the focus group as a key data point. For example, at a zoom ratio of 4.2x, when the sharpness index reaches its maximum value of 85.3, the focus group position is 520 steps. The system stores this position in the database and adds a timestamp and ambient light parameters such as a brightness value of 300 lux for subsequent analysis. Next, the system uses built-in logic to determine whether the zoom group has completed all preset steps. For example, if the total number of steps is set to 8 and only the 5th step has been completed, the system will automatically trigger the drive module to increase the zoom group by one step to a 4.7x zoom ratio, with the error controlled within 0.02x to ensure adjustment accuracy. Subsequently, the system repeats the image acquisition process, using the image sensor to acquire image data at the new zoom ratio. It then uses an edge strength evaluation algorithm based on the Sobel operator to calculate the average gradient value of the image. For example, if the threshold is set to 45, and the current value is 42.7, the system continues to adjust the focus group position, increasing the number of steps from 520 to 550 in increments of 15, monitoring the gradient value changes in real time until it approaches or exceeds the threshold. The entire process forms a closed-loop control. If the zoom group has completed all steps, the system automatically enters the data integration stage, performing curve fitting analysis on the data points at each zoom ratio. For example, it uses quadratic polynomial regression to obtain the peak distribution trend with a correlation coefficient of 0.95, which is used to optimize the parameter configuration of subsequent image processing modules.

[0028] Preferably, in the field of image processing, after the zoom group completes all preset steps, the system automatically performs a baseline focus curve fitting process based on the recorded data points. For example, assuming the total number of zoom group steps is 10, the system records the sharpness index value and focus group position data at each zoom magnification corresponding to each step (e.g., 3.5x to 5.5x, with a step size of 0.2x), obtaining a set of data points. For example, at 3.5x, the focus position is 480 steps with a sharpness value of 78.2; at 3.7x, the focus position is 495 steps with a sharpness value of 80.1. The system then calls the built-in curve fitting algorithm, using a cubic polynomial regression method to calculate the parameters of the fitted curve, obtaining the equation y=ax³+bx²+cx+d, where a, b, c, and d are the fitting coefficients. The calculation results show that the correlation coefficient reaches 0.98, indicating that the curve highly matches the actual data. Next, for the calculation of the sharpness index, the system analyzes the high-frequency components of the image. Specifically, it extracts the high-frequency energy value of the image through the Discrete Fourier Transform algorithm. For example, after decomposing the image into the frequency domain, the threshold for the proportion of high-frequency components is set to 30%. If the proportion of high-frequency energy in a certain frame is 32.5%, the sharpness index is set to 82.6. The system compares this value with historical data and automatically adjusts the weight parameters of the fitted curve to ensure the adaptability of the curve under different lighting conditions. To form a closed-loop logic, the system also associates the fitted curve data with the device calibration module and automatically generates a calibration parameter table. For example, it controls the focus position deviation within the range of 3.5 to 5.5 times within ±5 steps and stores the results in the system database for the initial configuration of subsequent image acquisition tasks. The entire process is driven by the algorithm, requiring no external intervention, and is logically rigorous and efficient.

[0029] Example 3: In image processing and zoom lens systems, the system first acquires theoretical focusing curve data. For example, with zoom magnification from 2.0x to 6.0x and a step size of 0.5x, the corresponding theoretical focusing positions are 300, 320, 350, 400, 460, and 550 steps, respectively. Simultaneously, it combines this with reference focusing curve data, such as measured focusing positions at the same magnification of 305, 325, 355, 405, 470, and 560 steps. By comparing the differences between the two sets of data, the system calculates the deviation value; for example, the deviation is 5 steps at 2.0x and 10 steps at 6.0x. Then, a weighted average algorithm is used to smooth the deviation, setting the theoretical curve weight to 0.6 and the reference curve weight to 0.4, resulting in corrected focusing position data; for example, the corrected position at 2.0x is 302 steps. Next, the system introduces an object distance variable, assuming an object distance range of 0.5 meters to 10 meters and a step size of 1.5 meters. For each combination of object distance and zoom magnification, the system generates a focus position matrix using an interpolation algorithm. For example, at an object distance of 0.5 meters and a zoom of 2.0x, the focus position is 310 steps, while at an object distance of 10 meters and a zoom of 6.0x, it is 580 steps. The matrix data is further refined using bilinear interpolation to ensure data continuity. Finally, the system calls a 3D surface fitting algorithm, employing a quadratic surface model to generate a zoom focus surface that describes the dynamic relationship between zoom magnification, focus position, and object distance. The fitting equation is in the form of z = ax² + by² + cxy + dx + ey + f, where a to f are the fitting parameters. The calculated correlation coefficient is 0.95. The system stores the surface data in a database and links it with the lens control module to automatically adjust parameters to adapt to different scenarios. The entire process achieves closed-loop processing through algorithms.

[0030] Preferably, during the development of the zoom lens system, the system first collects theoretical curve data through a built-in algorithm. Assuming the zoom magnification range is 1.5x to 5.5x with a step size of 0.8x, the corresponding theoretical focus position data are 250, 280, 320, 370, and 430 steps. Simultaneously, benchmark data is acquired, and the measured focus positions at the same magnification are 255, 285, 330, 380, and 445 steps. The system uses a difference analysis algorithm to calculate the offset between the two sets of data. For example, the offset is 5 steps at 1.5x and 15 steps at 5.5x. Then, a linear regression algorithm is used to smooth the offset, and a weighted ratio of correction coefficients of 0.7 and 0.3 is calculated to finally generate the adjusted focus position data, such as 252 steps at 1.5x. Next, the system introduces an object distance parameter, set within a range of 1.0 meter to 8.0 meters, with a step size of 1.0 meter. A multi-point interpolation algorithm is used to construct a matrix relating zoom magnification to object distance. For example, at an object distance of 1.0 meter and a zoom of 1.5x, the focusing position is determined by 260 steps, while at an object distance of 8.0 meters and a zoom of 5.5x, the step size is 460 steps. The matrix data is further optimized using a triangular interpolation algorithm to ensure a smooth data transition. Subsequently, the system utilizes multidimensional fitting technology, employing a cubic polynomial model to generate a zoom focusing surface. The fitting equation is z = px³ + qy³ + rxy² + sx²y + tx + uy + v, where p to v are the fitting parameters. After calculation, the fitting accuracy reaches 0.92. The system automatically stores the generated surface data in its internal cache and interacts with the lens drive module, dynamically adjusting lens parameters through algorithms to adapt to different shooting environments. The entire process is completed automatically by the system, forming a closed-loop data processing mechanism.

[0031] Preferably, in the optimization process of the zoom lens system, the system first analyzes the deviation between the reference focus curve and the theoretical focus curve using a built-in algorithm. Assuming the zoom magnification range is 2.0x to 6.0x with a step size of 1.0x, the corresponding theoretical focus positions are 300, 350, 410, and 480 steps, while the reference focus positions are 310, 365, 425, and 500 steps. The system uses a deviation calculation module to obtain deviation values ​​of 10, 15, 14, and 20 steps for each magnification. Then, a weighted average algorithm is used to smooth the deviation values, and the deviation correction factors are calculated with weight ratios of 0.6 and 0.4. The adjusted theoretical focus position, such as at 2.0x, is 304 steps, forming the initial surface model. Next, the system uses a surface extension algorithm to extend the initial surface model to multiple object distance ranges, setting the object distance to 2.0 meters to 10.0 meters with a step size of 2.0 meters. A bilinear interpolation algorithm is used to construct a matrix relating the object distance to the zoom ratio. For example, at an object distance of 2.0 meters and a zoom of 2.0x, the focusing position is determined in 315 steps, and at an object distance of 10.0 meters and a zoom of 6.0x, in 520 steps. The system further analyzes the matrix data, calculating the gradient rate of change between points to ensure the surface smoothness reaches a preset threshold of 0.85. Finally, the system calls the 3D modeling module to generate a 3D surface based on a quadratic polynomial fitting algorithm. The fitting equation is z = ax² + by² + cxy + dx + ey + f, where a to f are the fitting parameters. After calculation, the surface error is controlled within 0.05. The system automatically stores the surface data in the database and synchronizes it with the lens control unit, forming a closed-loop processing flow.

[0032] Preferably, during the verification and adjustment process of the zoom lens system, the system first evaluates the applicability of the generated 3D surface at different object distances through an automated verification module. The object distance range is set to 1.5 meters to 12.0 meters, with a step size of 1.5 meters. The theoretical focusing position at a test point with an object distance of 1.5 meters and a zoom magnification of 3.0 is 280 steps, while the actual collected focusing position is 285 steps, with a calculated deviation of 5 steps. The system compares this deviation with a preset threshold of 3 steps. If the deviation exceeds the threshold, an iterative adjustment mechanism is automatically triggered. The constant parameters are optimized using a gradient descent algorithm. The initial parameter value is 1.2, the adjustment step size is 0.1, and after iterative calculation, the parameter converges to 1.05. The surface data is regenerated, and the deviation value is verified to have decreased to 2.5 steps, meeting the threshold requirement. Subsequently, the system performed similar verifications at other object distances, such as 6.0 meters and 9.0 meters, obtaining deviation values ​​of 1.8 steps and 2.2 steps respectively, both within the threshold, confirming the applicability of the surface. To ensure comprehensiveness, the system also introduced light intensity as an auxiliary variable, analyzing the focus shift when the light intensity increased from 500 lux to 2000 lux. It set a 0.5-step shift corresponding to every 500 lux change, automatically adjusting the surface parameters to adapt to different scenes. Finally, the system output the adjusted 3D surface data, which was formatted into a standard calibration file through the data conversion module. This file contains the mapping relationship between object distance, magnification, and focus position. For example, an object distance of 1.5 meters and a magnification of 3.0x correspond to 283 steps. The data is automatically transmitted to the calibration application system, completing the closed-loop processing of the entire process.

[0033] In summary, this invention employs a step-by-step method to drive the zoom group to gradually increase the magnification. After each step, contrast detection drives the focus group to move and acquire image data to calculate the sharpness index. The peak position is recorded and fitted to a reference curve. Then, the deviation between the reference curve and the theoretical curve is calculated and adjusted to form an initial surface model. By using constant parameters, the model is extended to multiple object distance ranges and the iterative adjustment is verified. Finally, a three-dimensional surface is output for calibration applications. This method effectively solves the focusing deviation problem during zooming, improves the overall imaging accuracy and applicability of the lens system, and achieves efficient dynamic focusing in all scenarios.

[0034] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for rapid calibration of focus curves for zoom cameras across all scenes, characterized in that: Includes the following steps: S101. Select a single object distance as the calibration reference, and collect focusing data by driving the zoom group and the focus group to obtain the reference focus curve. The reference focus curve represents the correspondence between the zoom magnification and the focus position under a fixed object distance. S102. The zoom group is driven to gradually increase from the initial magnification using a stepping method. After each step increase, the position of the zoom group is fixed. Based on the current position, the focus group is driven to move through contrast detection, and image data is collected and the sharpness index is calculated. S103. If the sharpness index reaches its peak, the corresponding position of the focus group is recorded as a data point. It is determined whether the zoom group has completed all steps. If not, the zoom group is driven to add one more step and the acquisition process is repeated. S104. If the zoom group completes all steps, the reference focus curve is obtained by fitting the recorded data points, and the sharpness index is calculated based on the high-frequency components of the image. S105. The theoretical focusing curve provided by the zoom lens system is fitted with the reference focusing curve to generate a zoom focusing surface covering the object distance of the entire scene. The zoom focusing surface is used to describe the dynamic relationship between zoom ratio, focusing position and object distance. S106. Calculate the deviation between the reference focusing curve and the theoretical focusing curve, adjust the theoretical focusing curve according to the deviation to form an initial surface model, and expand the initial surface model to multiple object distance ranges through constant parameters to generate a three-dimensional surface. S107. Verify the applicability of the three-dimensional surface under different object distances. If the deviation exceeds the preset threshold, iteratively adjust the constant parameter and output the three-dimensional surface as the final zoom focusing surface for calibration applications.

2. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In step S101, the specific steps for selecting a single object distance as the calibration reference are as follows: S1011. By constructing a multi-point test scenario with a fixed object distance, the zoom component and the focus component are driven to adjust synchronously, and the corresponding data of zoom magnification and focus position are obtained from different test points to obtain the initial dataset. S1012. Based on the initial dataset, the data points are filtered using a preset threshold range. If a data point is detected to exceed the threshold range, the data point is removed to obtain the filtered dataset. S1013. For the filtered dataset, the data is classified according to different locations in the test scenario through grouping processing to obtain the classified data groups. S1014. From the classified data groups, extract the corresponding data of zoom magnification and focus position for each point, and use linear interpolation to fill in the missing data to obtain a complete dataset. S1015. Based on the complete dataset, construct an independent mapping table between zoom magnification and focus position for each test point, and determine the data characteristics of each point. S1016. By integrating the data characteristics of each point, the overall data distribution under the multi-point test scenario is integrated to obtain a unified reference dataset of zoom magnification and focus position. S1017. For the reference dataset, generate a control parameter table suitable for multi-point test scenarios with a fixed object distance, and determine the benchmark data for drive control.

3. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In step S102, the specific steps for acquiring image data and calculating the sharpness index are as follows: S1021. Drive the zoom component to gradually increase from the initial magnification using a stepping method, and fix the current position after each increase to obtain the stable state data of the zoom component. S1022. Based on the acquired stable state data, the focus component is driven to adjust its position using a contrast detection method, and corresponding image data is acquired. S1023. The collected image data is processed using a preset sharpness calculation method to obtain the sharpness value for each location. S1024. If the obtained sharpness value does not reach the preset threshold range, the focus component is driven to fine-tune again based on the current position data to obtain new image data. S1025. Based on the fine-tuned image data, reprocess it using the sharpness calculation method to determine whether the adjusted sharpness value meets the requirements. S1026. After multiple adjustments to the sharpness values, the position data of each zoom component and focus component are stored in a recording manner to obtain a complete adjustment dataset. S1027. For the complete adjusted dataset, the data is divided into layers according to zoom level by a grouping processing method, the continuity between the data in each layer is determined, and the final matching record is obtained.

4. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In step S104, the reference focus curve is fitted using a quadratic polynomial regression algorithm, and the fitting equation is y=0.2x²+5x+500, where y is the focus position and x is the zoom ratio.

5. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In step S105, the theoretical focus curve is provided by the zoom lens system and is fitted by a weighted average with the reference focus curve. The theoretical curve has a weight of 0.6 and the reference curve has a weight of 0.

4.

6. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In step S106, the constant parameters include the deviation scaling factor and the object distance expansion step size. The deviation between the reference curve and the theoretical curve is smoothed by a weighted average algorithm to generate an initial surface model.

7. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In step S106, the three-dimensional surface is generated by constructing the relationship matrix between the object distance and the zoom ratio using a bilinear interpolation algorithm, and then by fitting the three-dimensional surface using a quadratic surface model z=ax²+by²+cxy+dx+ey+f, where a to f are fitting parameters.

8. The method for rapid calibration of focus curves for zoom cameras across all scenes according to claim 1, characterized in that: In S107, the specific method for verifying the applicability of the three-dimensional curved surface is as follows: test points are selected in a range of 1.5 meters to 12.0 meters with a step size of 1.5 meters. If the deviation value exceeds the preset threshold of 3 steps, the constant parameter is iteratively adjusted by the gradient descent algorithm until the deviation value is ≤2.5 steps.

9. The method for rapid calibration of focus curves for a zoom camera across all scenes according to claim 1, characterized in that: In step S107, when iteratively adjusting the constant parameters, the light intensity is introduced as an auxiliary variable to analyze the focus shift under a light intensity variation of 500~2000 lux. Each 500 lux variation corresponds to a 0.5-step shift, and the surface parameters are automatically adjusted.

10. The method for rapid calibration of focus curves for a zoom camera across all scenes according to claim 1, characterized in that: The final zoom focusing surface is stored in the device firmware in the form of a mapping table. The mapping table contains the correspondence between object distance, zoom magnification and focus position, which is used for subsequent real-time focus compensation.