Optical imaging zoom point selection correction method and system
Through the optical imaging zoom point selection correction method, three-stage sampling, gradient descent method and median filtering are used to solve the problem of insufficient imaging accuracy of zoom network cameras in dynamic environments, and high-definition and stable imaging effects are achieved.
Patent Information
- Application Number
- CN202510887005.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In the prior art, it is difficult for zoom network cameras to continuously provide high-definition images in dynamically changing working environments, and there is a problem of insufficient accuracy.
The optical imaging zoom point selection correction method is adopted, and through technologies such as three-stage sampling, gradient descent, adaptive step size search, offset vector calculation and median filtering, the deviation of the theoretical model and the actual lens characteristics are corrected in real time, and a high-precision focus curve is generated, which eliminates the influence of noise and mechanical vibration, and quickly locks the actual peak point.
The stability and high definition of focus in a dynamic environment are achieved, the imaging quality of the zoom network camera is improved, the individual differences of different lenses are adapted to reduce test time, and the calibration efficiency is improved.
Smart Images

Figure CN120390148A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of monitoring technologies, and in particular, to an optical imaging zoom point selection and correction method and system. Background Art
[0002] Defects in existing products and technical fields:
[0003] In today's field of monitoring technologies, zoom network cameras have achieved efficient monitoring of a wide range of distances and diverse field-of-view scenarios by equipping complex optical zoom lens systems with software programmable control capabilities. In order to ensure that the imaging device can continuously capture high-definition images during the optical zoom operation, a precise zoom tracking control strategy must be introduced and implemented.
[0004] In the existing technical field, in the face of the problem of insufficient accuracy when the imaging device relies on a preset theoretical focus trajectory for focusing during operation, no practical solution strategy has been proposed and implemented so far. The existence of this technical problem highlights the challenge of how to ensure that the optical imaging system can continuously and stably provide high-definition images in a dynamically changing working environment.
[0005] In summary, an optical imaging zoom point selection and correction method and system are needed to solve the deficiencies in the existing technology. Summary of the Invention
[0006] In view of the deficiencies of the existing technology, the present invention provides an optical imaging zoom point selection and correction method and system, aiming to solve the above problems.
[0007] To achieve the above object, the present invention provides the following technical solution: An optical imaging zoom point selection and correction method, comprising the following steps:
[0008] Step S1: Data acquisition, by means of primary sampling and encrypted sampling, imaging data sampling is performed on the optical zoom range with three-level sampling points set, and the collected data is integrated into a multi-dimensional matrix;
[0009] Step S2: Calculate the coordinates of the theoretical focus peak point through the initial data and the gradient descent method, and control the system to drive the zoom motor and the focusing group to move to the coordinates of the theoretical focus peak point;
[0010] Step S3: Adaptive step size search, set an initial step size, move successively in the gradient ascent direction and collect the picture clarity data. When the clarity reaches the peak, lock the current coordinates as the actual zoom position;
[0011] Step S4: Reverse optimization and error calculation. Perform reverse jitter search to determine the peak point of the defocus tolerance boundary, calculate the offset vector △Z between the actual peak point and the theoretical value, and achieve dynamic compensation for non-linear error through the offset;
[0012] Step S5: Substitute the offset △Z into the system to narrow the calibration points. Obtain the focus peak points of L discrete variable focus points through the peak point tracking algorithm, and calculate the slopes of adjacent points to supplement the focus points of the missing test points in the theoretical curve;
[0013] Step S6: Use median filtering to process the discrete data in the fitted curve, generate a smooth zoom and focus curve with required accuracy, and achieve zoom point selection correction.
[0014] Optionally, in step S1, the reference points of the three-level sampling points within the optical zoom range are the wide-angle end, the medium focal length, and the telephoto end. The primary sampling collects data at a fixed step size, and the encrypted sampling collects data at an equal-divided fixed step size.
[0015] Optionally, in step S3, the adaptive step size search is performed in the following way:
[0016] Move successively in the gradient ascent direction with the initial step size. Collect the picture clarity data after each move. When the clarity data shows an upward and then downward trend, it reaches the peak region, and lock the current coordinates as the actual zoom position.
[0017] Optionally, the offset vector in step S4 is calculated in the following way:
[0018] Compare the coordinates of the two actually measured peak points (Zv3, Zf1), (Zv4, Zf2) with the theoretical values (Zv1, Zf1), (Zv2, Zf2) of the corresponding zoom positions to obtain two offsets △Zv1, △Zv2, and calculate the offset vector △Zv through the average offset;
[0019] △Zv = (△Zv1 + △Zv2) / 2.
[0020] Optionally, the slope △k of adjacent points in step S5 is calculated in the following way:
[0021] Set the variable focus positions of adjacent points as (Zv5, Zf3), (Zv6, Zf4),
[0022] △k = (Zf3 - Zf4) / (Zv5 - Zv6).
[0023] Optionally, the discrete data processing in step S6 is performed in the following way:
[0024] Select K adjacent data points and take the median as the smoothed value.
[0025] ,
[0026] ,
[0027] where K is an odd number, W F is an adjacent array, is the focused position after smoothing, G is the index or position number of any one data point in the set W F , and F is the focused position that needs to be smoothed currently.
[0028] Optionally, the dimensions of the imaging data collected in step S1 include but are not limited to focal length, focus motor steps, and defocus amount.
[0029] An optical imaging zoom point selection and correction system, adopting the optical imaging zoom point selection and correction method, includes a data acquisition module, a focus peak point tracking and error compensation module, and a curve calibration and smoothing optimization module;
[0030] The data acquisition module is used to collect theoretical data within the zoom range and construct a multi-dimensional data matrix;
[0031] The focus peak point tracking and error compensation module is used to perform peak point tracking algorithm and dynamic error compensation based on the theoretical data;
[0032] The curve calibration and smoothing optimization module is used to generate a smooth and high-precision zoom focus curve through error parameters and discrete test points.
[0033] Optionally, the data acquisition module includes a sampling reference point unit, a primary sampling unit, and an encrypted sampling unit;
[0034] The sampling reference point unit is used to set fixed reference points at the wide-angle end, mid-focal length segment, and telephoto end;
[0035] The primary sampling unit is used to collect data of the entire zoom range at a fixed step;
[0036] The encrypted sampling unit is used to perform encrypted sampling at the focal length connection and key regions of the focus value inflection points.
[0037] Optionally, the focus peak point tracking and error compensation module includes a theoretical coordinate calculation unit, an adaptive step size search unit, and an error compensation unit;
[0038] The theoretical coordinate calculation unit is used to calculate the theoretical focus peak point coordinates from the data matrix by using the gradient descent method;
[0039] The adaptive step size search unit is used to collect the picture sharpness data in real time through the initial step size and lock the actual peak point;
[0040] An error compensation unit for calculating the offset between the actual peak point and the theoretical peak point, and dynamically correcting the theoretical model through an offset vector.
[0041] Advantages of the present invention:
[0042] 1. In the present invention, through the peak point tracking algorithm and offset vector calculation in the second stage, the deviation between the theoretical model and the actual lens characteristics is corrected in real time, effectively solving the individual error problem caused by lens assembly tolerances, material refractive index differences, etc. The hierarchical sampling strategy (reference point + encrypted sampling) in the first stage combined with the slope interpolation in the third stage fills in the untested points in the theoretical curve, generates a high-precision focusing curve, covers the entire zoom range, and avoids local focusing failure caused by traditional uniform sampling;
[0043] 2. In the present invention, median filtering is introduced in the third stage to filter outlier data, eliminate curve jitter caused by test noise or mechanical vibration, output a smooth zoom focusing curve, improve the anti-interference ability in actual control, avoid frequent jitter of the focusing motor, and in the second stage, an adaptive step size in the gradient ascent direction is adopted, combined with clarity data to dynamically adjust the search strategy, quickly lock the actual peak point, and avoid overshoot or slow convergence problems caused by traditional fixed step sizes;
[0044] 3. In the present invention, the calibration points in the third stage are reduced to 1 / 5 of the total number of points and evenly distributed, and the remaining points are supplemented by slope interpolation, greatly reducing the test time. On the premise of ensuring accuracy, the calibration efficiency is increased by more than 80%. Through dynamic error compensation and actual peak point tracking, it adapts to the individual differences of different lenses, does not rely on a unified theoretical model, is applicable to complex optical systems with high tolerance requirements, solves the pain point of inaccurate focusing of zoom network cameras in dynamic environments, and ensures full HD imaging from wide angle to telephoto. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of a method of the present invention.
[0046] Figure 2 It is a theoretical zoom focusing diagram of the present invention.
[0047] Figure 3 It is an actual zoom focusing diagram of the present invention.
[0048] Figure 4 It is a clarity data change diagram of the present invention.
[0049] Figure 5 It is a fitting curve diagram containing Liqun data of the present invention.
[0050] Figure 6It is a fitting curve graph after median filtering of the present invention. Detailed implementation manners
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0052] As Figures 1 to 6 shown, an optical imaging zoom point selection and correction method includes the following steps:
[0053] Step S1: Data acquisition. By means of primary sampling and encrypted sampling, imaging data sampling is performed on the optical zoom range with three-level sampling points, and the collected data is integrated into a multi-dimensional matrix.
[0054] Step S2: Calculate the coordinates of the theoretical focus peak point through the initial data and the gradient descent method, and the control system drives the zoom motor and the focus group to move to the coordinates of the theoretical focus peak point.
[0055] Step S3: Adaptive step size search. Set the initial step size, move successively in the gradient ascent direction and collect the picture sharpness data. When the sharpness reaches the peak, lock the current coordinates as the actual zoom position.
[0056] Step S4: Reverse optimization and error calculation. Perform reverse dithering, determine the peak point of the defocus tolerance boundary, calculate the offset vector △Z between the actual peak point and the theoretical value, and realize the dynamic compensation of the non-linear error through the offset.
[0057] Step S5: Substitute the offset △Z into the system, reduce the calibration point position, obtain the focus peak points of L discrete zoom points through the peak point tracking algorithm, and calculate the slopes of adjacent points to supplement the focus point positions of the missing test points in the theoretical curve.
[0058] Step S6: Use median filtering to process the discrete data in the fitting curve, generate a smooth zoom and focus curve with the required accuracy, and realize zoom point selection and correction.
[0059] The specific implementation content is as follows:
[0060] The first stage: Theoretical data acquisition is carried out by using the hierarchical sampling method.
[0061] According to the specifications such as the curves, depth of focus parameters, and zoom ratios provided by the manufacturer, a three - level sampling strategy is set within the optical zoom range: First, benchmark points are set at the wide - angle end, mid - focal length, and telephoto end. Subsequently, primary sampling is carried out with n zoom steps. For key areas, such as the junction of focal lengths and the inflection points of the focus values, the sampling density is encrypted to half or even one - third of the original. A data matrix containing dimensions such as focal length, focus motor steps, and defocus amount is constructed from the collected data.
[0062] The second stage: In the process of optimizing the focus of the device's optical system, a focus peak point tracking algorithm is used to implement precise focusing.
[0063] The technical architecture is based on the data matrix constructed in the first stage. This matrix not only contains core parameters such as zoom motor step values and focus group displacement amounts. By introducing a calculation model with the gradient descent method, the system will automatically solve the two - dimensional space coordinates corresponding to the theoretically optimal focus peak point, including the zoom ring position Zv and the focus group displacement Zf.
[0064] During the optical correction process of the device, the control system first drives the zoom motor and the focus group to move to the theoretical coordinate point with a positioning accuracy of millimeters (such as Figure 2 ), and at this time, the clarity data of the current image is obtained through the system.
[0065] Subsequently, the system starts an adaptive step - size search mechanism: In the initial stage, it moves successively in the predicted gradient - rising direction with a precise step - size of 0.1mm. After each zoom displacement, the system automatically obtains the clarity data of the current image. After obtaining M fields of clarity data, when the data shows a trend of rising and then falling (such as Figure 3 ); the system determines that it has reached the steady - state zoom peak area (such as Figure 3 ), and at this time, it will automatically lock the current mechanical coordinates as the actual optimal zoom position.
[0066] After completing the peak positioning, the system will execute a reverse optimization process to determine the defocus tolerance boundary, and determine the optimal zoom peak point at the boundary position in the same way; thus, two landmark coordinates of the zoom process are obtained.
[0067] In this stage, through the deep data fusion with the theoretical model in the first stage, dynamic compensation for non - linear errors is achieved. Specifically, the system compares the actual measured peak point coordinates (Zv3, Zf1), (Zv4, Zf2) of the two with the theoretical values (Zv1, Zf1), (Zv2, Zf2) corresponding to the zoom positions, obtains two offsets △Zv1, △Zv2, and calculates the offset vector △Zv through the average offset.
[0068] △Zv = (△Zv1 + △Zv2) / 2.
[0069] The third stage: Calibration of the optical zoom system.
[0070] First, the offset error parameter △Zv obtained from the second-stage analysis is input into the system. Secondly, in order to reduce the curve calibration speed, we reduce the calibration points to 1 / 5 of the total number of three segments, and evenly select points from the three segments; the system will read the L variable focus positions placed in the third stage, and through the focus peak point tracking algorithm, obtain the focus peak points of each variable focus position; this results in L discrete two-dimensional arrays, which show a certain degree of coincidence with the first stage; at this time, through the theoretical curve obtained in the first stage, calculate the slope △k of two adjacent variable focus positions (Zv5, Zf3), (Zv6, Zf4), so as to obtain the focus positions in the remaining untested points in the supplementary theoretical curve, and obtain an actual test zoom and focus curve;
[0071] △k = (Zf3 - Zf4) / (Zv5 - Zv6)
[0072] After fitting the test points into a curve, due to reasons such as test errors, the problem of curve unevenness may occur, thus affecting the subsequent actual use effect (such as Figure 5 ).
[0073] In order to make the fitted data smoother, a median filtering module is introduced after curve fitting to filter out individual outlier data and ensure that the fitted curve is smooth enough. For each focus position Zf, select W F adjacent arrays, and the number of selected arrays is K, where K is an odd number. After smoothing it is
[0074]
[0075] Among them, the adjacent arrays are defined as:
[0076] ,
[0077] In the formula, K is an odd number, W F is the adjacent array, is the focus position after smoothing, G is the index or position number of any data point in the set W F , and F is the focus position that needs to be smoothed currently
[0078] After filtering, a smooth and relatively accurate zoom and focus curve can be obtained (such as Figure 6 ).
[0079] An optical imaging zoom point selection and correction system, which adopts an optical imaging zoom point selection and correction method, includes a data acquisition module, a focus peak point tracking and error compensation module, and a curve calibration and smoothing optimization module;
[0080] The data acquisition module is used to acquire the theoretical data within the zoom range and construct a multi-dimensional data matrix;
[0081] The focus peak point tracking and error compensation module is used to perform peak point tracking algorithm and dynamic error compensation based on the theoretical data;
[0082] The curve calibration and smoothing optimization module is used to generate a smooth and high-precision zoom focus curve through error parameters and discrete test points.
[0083] The data acquisition module includes a sampling reference point unit, a primary sampling unit, and an encrypted sampling unit;
[0084] The sampling reference point unit is used to set fixed reference points at the wide-angle end, mid-telephoto segment, and telephoto end;
[0085] The primary sampling unit is used to acquire data for the entire zoom range at a fixed step size;
[0086] The encrypted sampling unit is used to perform encrypted sampling at the key areas of the focal length connection and the inflection point of the focus value.
[0087] The focus peak point tracking and error compensation module includes a theoretical coordinate calculation unit, an adaptive step size search unit, and an error compensation unit;
[0088] The theoretical coordinate calculation unit is used to calculate the theoretical focus peak point coordinates from the data matrix using the gradient descent method;
[0089] The adaptive step size search unit is used to acquire the picture sharpness data in real time through the initial step size and lock the actual peak point;
[0090] The error compensation unit is used to calculate the offset between the actual peak point and the theoretical peak point, and dynamically correct the theoretical model through the offset vector.
[0091] The curve calibration and smoothing optimization module includes a discrete data acquisition unit, a slope interpolation calculation unit, and a median filter smoothing unit;
[0092] The discrete data acquisition unit is used to acquire the discrete data on the fitting curve;
[0093] The slope interpolation calculation unit is used to supplement the focus positions of the untested points according to the slopes of adjacent points;
[0094] The median filter smoothing unit is used to perform median filtering on the discrete data in the fitting curve and output a smooth zoom focus curve.
[0095] Through the peak point tracking algorithm and offset vector calculation in the second stage, the present invention can correct in real time the deviation between the theoretical model and the actual lens characteristics, effectively solving the problem of individual errors caused by lens assembly tolerances, material refractive index differences, etc. The hierarchical sampling strategy (reference point + encrypted sampling) in the first stage, combined with the slope interpolation in the third stage, fills the untested points in the theoretical curve, generates a high-precision focusing curve, covers the full zoom range, and avoids local focusing failure caused by traditional uniform sampling;
[0096] In the third stage, median filtering is introduced to filter outlier data, eliminate curve jitter caused by test noise or mechanical vibration, output a smooth zoom focusing curve, improve the anti-interference ability in actual control, and avoid frequent jitter of the focusing motor. In the second stage, an adaptive step size in the gradient ascent direction is adopted, combined with clarity data to dynamically adjust the search strategy, quickly lock the actual peak point, and avoid overshoot or slow convergence problems caused by traditional fixed step sizes;
[0097] In the third stage, the calibration points are reduced to 1 / 5 of the total number of points, evenly distributed, and the remaining points are supplemented by slope interpolation, greatly reducing the test time. On the premise of ensuring accuracy, the calibration efficiency is increased by more than 80%. Through dynamic error compensation and actual peak point tracking, it adapts to the individual differences of different lenses, does not rely on a unified theoretical model, is applicable to complex optical systems with high tolerance requirements, solves the pain point of inaccurate focusing of zoom network cameras in dynamic environments, and ensures full HD imaging from wide angle to telephoto.
[0098] In the engineering practice of complex optical imaging systems, due to the superposition of multiple factors such as lens assembly tolerances, optical material refractive index deviations, and mechanical transmission mechanism fit clearances, the dynamic optical characteristics of each independent lens show significant individual difference characteristics; to achieve continuous and stable imaging quality during zooming, it is necessary to precisely calibrate and optimize the zoom tracking curve of each lens. Through three stages, the errors caused by multiple factors can be corrected to ensure stable imaging of the lens during zooming.
[0099] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent replacements, or improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
[0100] The above-described embodiments are only a preferred solution of this application and do not impose any form of limitation on this application. There are other variations and modifications without exceeding the technical solutions described in the claims.
Claims
1. A method for correcting optical imaging zoom point selection, characterized in that: The following steps are involved: Step S1: Data acquisition, through primary sampling and encrypted sampling, imaging data sampling is performed on the optical zoom range with three sampling points set, and the collected data is integrated into a multi-dimensional matrix; Step S2: Calculate the coordinates of the theoretical focus peak point using the initial data and the gradient descent method, and the control system drives the zoom motor and the focus group to move to the coordinates of the theoretical focus peak point; Step S3: Adaptive step search, set the initial step size, move in the gradient ascending direction and collect picture clarity data, and when the clarity reaches the peak, lock the current coordinate as the actual zoom position; Step S4: reverse optimization and error calculation, performing reverse jitter search, determining the peak point of the defocus tolerance boundary, calculating the offset vector △Z between the actual peak point and the theoretical value, and realizing dynamic compensation of nonlinear error through the offset; Step S5: Bring the offset ΔZ into the system, narrow the calibration points, obtain the focus peak points of L discrete focus points through the peak point tracking algorithm, and calculate the slopes of adjacent points to fill in the focus points of the missing test points in the theoretical curve; Step S6: Use median filtering to process the discrete data in the fitting curve to generate a smooth zoom focus curve with the required accuracy, thereby achieving zoom point correction.
2. The optical imaging zoom point selection and correction method according to claim 1, wherein The reference points of the three-level sampling points within the optical zoom range in step S1 are the wide-angle end, the medium-short focal length, and the telephoto end. The primary sampling collects data in a fixed step size, and the encrypted sampling collects data in a fixed step size that is equally divided.
3. The optical imaging zoom point selection correction method according to claim 1, characterized in that: The adaptive step length search in step S3 is performed in the following manner: Move in the direction of gradient ascent with an initial step size, collecting picture clarity data after each movement. When the clarity data shows an upward and then downward trend, in order to reach the peak area, lock the current coordinate as the actual zoom position.
4. The optical imaging zoom point selection and correction method according to claim 1, wherein, The calculation of the offset vector in step S4 is as follows: Compare the actual measured two peak point coordinates (Zv3, Zf1), (Zv4, Zf2) with the theoretical values of the corresponding focus positions (Zv1, Zf1), (Zv2, Zf2) to obtain two offsets △Zv1, △Zv2. Calculate the offset vector △Zv by averaging the offsets. △Zv=(△Zv1+△Zv2) / 2.
5. The optical imaging zoom point selection correction method according to claim 4, characterized in that: The slope Δk of adjacent points in step S5 is calculated as follows: Set the adjacent points to (Zv5, Zf3), (Zv6, Zf4), △k=(Zf3-Zf4) / (Zv5-Zv6).
6. The optical imaging zoom point selection and correction method according to claim 1, characterized in that The discrete data processing in step S6 is performed in the following manner: Select K adjacent data points and take the median as the smoothed value. , , Where K is an odd number, and W F is an adjacent array, is the focused position after smoothing, G is the index or position number of any data point in the set W F , and F is the focused position currently to be smoothed.
7. The optical imaging zoom point selection and correction method according to claim 1, wherein The dimensions of the imaging data collected in step S1 include but are not limited to focal length, focus motor steps and defocus amount.
8. An optical imaging zoom point selection and correction system, which adopts the optical imaging zoom point selection and correction method according to any one of claims 1-7, characterized in that, It includes data acquisition module, focus peak point tracking and error compensation module and curve calibration and smoothing optimization module; Data acquisition module, used to collect theoretical data within the zoom range and construct a multi-dimensional data matrix; Focus peak point tracking and error compensation module, used for peak point tracking algorithm and dynamic error compensation based on theoretical data; The curve calibration and smoothing optimization module is used to generate a smooth and high-precision zoom focus curve through error parameters and discrete test points.
9. The optical imaging zoom point selection and correction system according to claim 8, wherein, The data acquisition module includes a sampling reference point unit, a primary sampling unit and an encrypted sampling unit; Sampling reference point unit, used to set fixed reference points at the wide-angle end, mid-focus end, and telephoto end; A primary sampling unit for collecting data across the entire zoom range with a fixed step size; The encrypted sampling unit is used to perform encrypted sampling in the key areas of focal length connection and focus value inflection point.
10. The optical imaging zoom point selection and correction system according to claim 8, characterized in that, The focus peak point tracking and error compensation module includes a theoretical coordinate calculation unit, an adaptive step length search unit and an error compensation unit; A theoretical coordinate calculation unit, used to calculate the coordinates of the theoretical focus peak point from the data matrix using a gradient descent method; Adaptive step search unit, used to collect picture clarity data in real time through the initial step length and lock the actual peak point; The error compensation unit is used to calculate the offset between the actual peak point and the theoretical peak point, and dynamically correct the theoretical model through the offset vector.
Citation Information
Patent Citations
Method and device for correcting zoom tracking curve
CN104301611A
Calibration method and device of zooming tracking curve
CN105611159A
Zoom tracking curve acquisition system and method thereof
CN105704362A
Lens correction method and device
CN106507102A
Fast correction method for zoom tracking curve
CN106657787A
Cited By
Focusing control system and method based on sensor fusion and adaptive PID
CN120568199A
Super-long-focus movement curve calibration method and tool
CN122027787A
A method and tool for calibrating a curve of an ultra-long focus movement
CN122027787B