Resolution function-based temperature compensation focusing calibration method and device and storage medium

By using resolution function calculation and temperature-compensated focusing calibration methods, the accuracy of focusing calibration parameters for cameras at different temperatures was solved, enabling precise focusing and image quality maintenance under various temperature conditions.

CN119941866BActive Publication Date: 2025-11-11SHENZHEN KANDAO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411997735.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-11-11
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The accuracy of camera focusing calibration parameters in existing technologies is insufficient, especially in maintaining accurate focusing performance under different temperature conditions.

Method used

By using a temperature-compensated focusing calibration method based on a resolution function, multiple step distances and temperature data of the focusing calibration position are obtained, the ambient temperature difference of the device is calculated, step distance compensation is performed, and a focusing calibration function is constructed to ensure that the camera maintains accurate focusing under different temperatures.

Benefits of technology

It improves the accuracy and reliability of camera focus calibration, ensuring that the camera can maintain accurate focusing performance and image quality under different temperature conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941866B_ABST
    Figure CN119941866B_ABST
Patent Text Reader

Abstract

This application provides a temperature-compensated focusing calibration method, apparatus, and storage medium based on a resolution function. The method calculates the step distance error caused by changes in ambient temperature using first temperature data, compensates for the error in the first step distance, ensuring the camera maintains accurate focusing performance under different temperature conditions and improving the accuracy of camera focusing calibration. By using a focusing calibration formula, the first resolution corresponding to each first step distance at each focusing calibration position is calculated, achieving a quantitative evaluation of calibration quality and thus intuitively demonstrating the focusing calibration effect of each first step distance. By comparing the first resolution corresponding to each first step distance, the focusing calibration function corresponding to each focusing calibration position is calculated, thereby determining the optimal focusing calibration parameters for the camera at different focusing calibration positions, improving the data accuracy of the camera focusing calibration parameters, and further improving the accuracy and reliability of the camera's autofocus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera calibration technology, and in particular to a temperature-compensated focusing calibration method, device and storage medium based on a resolution function. Background Technology

[0002] Camera calibration is a fundamental skill in photogrammetry and computer vision. It involves determining the camera's intrinsic and extrinsic parameters, as well as the lens's distortion parameters, using known references (such as calibration boards). This process is crucial for tasks such as image measurement, machine vision applications, and 3D reconstruction. The purpose of camera calibration is to establish a geometric model of camera imaging, enabling accurate mapping of points in the 3D world onto the 2D image plane.

[0003] The core purpose of focus calibration is to determine the optimal focal length of the camera at different shooting distances, so as to achieve fast and accurate focusing in the autofocus system.

[0004] Therefore, improving the accuracy of camera focusing calibration parameters has become an urgent technical problem to be solved. Summary of the Invention

[0005] This application provides a temperature-compensated focusing calibration method, apparatus, and storage medium based on a resolution function, aiming to improve the accuracy of camera focusing calibration parameters.

[0006] In a first aspect, this application provides a temperature-compensated focusing calibration method based on a resolution function, the temperature-compensated focusing calibration method based on a resolution function comprising the following steps:

[0007] S01. Obtain the focus calibration position, multiple first step distances corresponding to the focus calibration position, and the first temperature data corresponding to the focus calibration position;

[0008] S02. Based on the resolution extraction method, calculate the first resolution corresponding to the multiple first step distances;

[0009] S03. Calculate the ambient temperature difference of the equipment based on the first temperature data;

[0010] S04. Based on the ambient temperature difference of the equipment, calculate the step distance compensation amount corresponding to the focusing calibration position;

[0011] S05. Based on the step distance compensation amount, correct the multiple first step distances to obtain multiple corrected second step distances;

[0012] S06. Based on the first temperature data, multiple second step distances, and multiple first resolutions corresponding to the first step distances, calculate the focus calibration function corresponding to the focus calibration position;

[0013] Repeat steps S01 to S06 to calculate the focus calibration function corresponding to the multiple focus calibration positions;

[0014] Obtain the current focus calibration position of the target camera, and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

[0015] Secondly, this application also provides a temperature-compensated focusing calibration device based on a resolution function, the temperature-compensated focusing calibration device based on a resolution function comprising:

[0016] The data acquisition module is used to acquire the focus calibration position, multiple first step distances corresponding to the focus calibration position, and the first temperature data corresponding to the focus calibration position;

[0017] The first resolution calculation module is used to calculate the first resolution corresponding to multiple first step distances based on the resolution extraction method;

[0018] The equipment ambient temperature difference calculation module is used to calculate the equipment ambient temperature difference based on the first temperature data;

[0019] The step distance compensation calculation module is used to calculate the step distance compensation corresponding to the focusing calibration position based on the ambient temperature difference of the equipment.

[0020] The step distance correction module is used to correct multiple first step distances based on the step distance compensation amount to obtain multiple corrected second step distances;

[0021] The focus calibration function calculation module is used to calculate the focus calibration function corresponding to the focus calibration position based on the first temperature data, multiple second step distances, and multiple first resolutions corresponding to the first step distances.

[0022] The focus calibration module is used to obtain the current focus calibration position of the target camera and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

[0023] Thirdly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the temperature-compensated focusing calibration method based on the resolution function as described above.

[0024] This application provides a temperature-compensated focusing calibration method, apparatus, and storage medium based on a resolution function. The method calculates the step distance error caused by changes in ambient temperature using first temperature data, and compensates for the error in the first step distance to ensure the camera maintains accurate focusing performance under different temperature conditions, thus improving the accuracy of camera focusing calibration. By using a focusing calibration formula, the first resolution corresponding to each first step distance at each focusing calibration position is calculated, achieving a quantitative evaluation of the calibration quality and thus intuitively demonstrating the focusing calibration effect of each first step distance. By comparing the first resolution corresponding to each first step distance, the focusing calibration function corresponding to each focusing calibration position is calculated, thereby determining the optimal focusing calibration parameters for the camera at different focusing calibration positions, improving the data accuracy of the camera focusing calibration parameters, and further improving the accuracy and reliability of the camera's autofocus. Attached Figure Description

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

[0026] Figure 1 A flowchart illustrating the first embodiment of a temperature-compensated focusing calibration method based on a resolution function provided in this application;

[0027] Figure 2 A flowchart illustrating the first step of the extended scheme of the first embodiment of the temperature-compensated focusing calibration method based on resolution function provided in this application;

[0028] Figure 3 This is a schematic diagram of the structure of a first embodiment of a temperature-compensated focusing calibration device based on a resolution function provided in this application;

[0029] Figure 4 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.

[0030] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

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

[0032] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0033] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0034] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of a temperature-compensated focusing calibration method based on a resolution function provided in this application.

[0035] like Figure 1 As shown, the temperature-compensated focus calibration method based on the resolution function includes steps S01 to S08.

[0036] S01. Obtain the focus calibration position, multiple first step distances corresponding to the focus calibration position, and the first temperature data corresponding to the focus calibration position;

[0037] Generally, in a camera module, the up-and-down movement of the lens is controlled by a built-in motor (such as a VCM motor (Voice Coil Motor)) to achieve the focusing function of the lens.

[0038] A VCM motor is a device that converts electrical energy into mechanical energy. It utilizes the force exerted on a current-carrying conductor in a magnetic field to achieve motion. When current flows through a coil, the coil experiences a force in a permanent magnetic field, resulting in linear motion or a limited oscillation angle. This motion can be controlled by changing the direction and magnitude of the current. In a camera module, the VCM motor controls the up-and-down movement of the lens by changing the magnitude of the direct current in the motor's coil, thus achieving the lens's focusing function. This micro-movement of the entire lens can change the focal length, achieving a clear image. The control precision and speed of the VCM motor are crucial for achieving functions such as fast autofocus and optical image stabilization. The positioning accuracy and force control of the VCM motor are achieved through a position feedback device and controller. The design structure of the VCM motor itself and the current intensity determine the magnitude of the thrust generated, while the accuracy of its movement depends on the feedback and control system. The lens focal length is adjusted by regulating the stepper motor of the VCM module. In other words, focusing means adjusting the step distance of the motor to achieve the clearest image at a specified focal length, i.e., maximizing resolution.

[0039] Therefore, multiple first step distances can be set within a preset step range, and focus analysis can be performed at each of the multiple first step distances to find the most accurate focus step distance for camera focus calibration.

[0040] In one embodiment, the focus calibration position refers to the shooting distance for camera focus calibration. During the focus calibration process, the default focus calibration data of the VCM motor can be used to accelerate the focus calibration calculation. Generally, the focus calibration position can include positions such as 80mm, 150mm, 350mm, and 5000mm. Since 150mm and 350mm are difficult to test, the test distances can be changed to 80mm, 600mm, and 5000mm, with 600mm being a simulated distance.

[0041] S02. Based on the resolution extraction method, calculate the first resolution corresponding to the multiple first step distances;

[0042] In one embodiment, with the current step distance of the VCM motor as x, the focal length f, and the ambient temperature t, the resolution R is expressed as a function:

[0043] R(x, f, t)

[0044] In one embodiment, experiments revealed that the resolution R curve is a parabolic curve opening downwards, meaning that the resolution is highest at the focus point when the stepper motor is moved a certain distance; the temperature compensation curve is an approximately linear curve; the curves for each focal length are different; and if the left and right eyes achieve consistent resolution focusing calibration, the binoculars can also achieve consistent focusing calibration.

[0045] Therefore, from an engineering perspective, the resolution R at a specified focal length f can be simplified to:

[0046] R(x, t) = ax 2 +bx+ct+d

[0047] Among them, the constant coefficients a, b, c, and d are the focus calibration data that need to be determined.

[0048] Therefore, by specifying several key focal lengths, such as f0, f1, f2, and f3, and calculating the resolution curves at the corresponding focal lengths, focus calibration data can be obtained.

[0049] Furthermore, based on preset camera acquisition parameters, the target camera is controlled to acquire images of the calibration board at multiple first step distances corresponding to the focus calibration position to obtain a first calibration image; based on a resolution algorithm, the first calibration image is parsed to obtain a first resolution corresponding to multiple first step distances.

[0050] In one embodiment, a focus calibration target position is set, such as 80mm, 600mm, 5000mm, etc., the three-axis position (x, y, z) of the pan-tilt head is moved, and ISP (Image Signal Processor) parameters are set. The VCM motor position is also set for segmented shooting. The ISP (Image Signal Processor) parameters mainly perform post-processing on the signal output from the front-end image sensor, with key functions including linear correction, noise removal, bad pixel removal, interpolation, white balance, and automatic exposure control.

[0051] In one embodiment, to accelerate the camera focus calibration process, this application embodiment performs preliminary calculations based on default focus calibration parameters to give a default value x0. Considering that calculating each point takes a lot of time, it is considered to take a certain number of points near the default value for calculation. For example, 11 points are taken in steps s, such as x0-5s, x0-4s...x0,...x0+4s,x0+5s.

[0052] The default value is the initial focus position of the lens, specifically the initial values ​​at 80, 600, and 5000.

[0053] Since the actual calibration values ​​are 150, 350, and 5000, while 80 and 600 are observed values, it is necessary to perform linear interpolation to find the initial positions of 80 and 600 based on the known values ​​of 150 and 350. Let the step distance function be D(x), then:

[0054]

[0055] Given D(150) and D(80), we can find D(80) and D(600).

[0056] In one embodiment, after setting the camera acquisition parameters, the target camera can be controlled to acquire images of the calibration board at multiple step distances to obtain a first calibration image. The first calibration image can be a RAW image. A RAW image is the raw data image output by the image sensor; commonly used formats include RAW8, RAW10, and RAW12, representing 8 bits, 10 bits, and 12 bits of data per pixel, respectively.

[0057] In one embodiment, the resolution algorithm may be the SFR algorithm.

[0058] SFR (Spatial Frequency Response) refers to the amplitude response of a system relative to the input spatial frequency. For camera systems, SFR is similar to the MTF (modulation transfer function) of traditional optical systems, and can be used to intuitively determine the system's resolving power. The International Organization for Standardization (ISO) has formulated and standardized the relevant definitions and test methods for SFR.

[0059] Generally, the SFR algorithm for calculating the resolution of a RAW image includes the following steps: obtaining the ROI (Region of Interest) along the vertical edges; normalizing the data; calculating the pixel center of each row of the image; performing a linear fit on the center of each row using the least squares method to obtain a straight line about the center; repositioning the ROI to obtain the ESF (Edge Spread Function); performing a 4x oversampling on the obtained ESF; obtaining the LSF (Line Spread Function) through difference operations; applying a Hamming window to the LSF; and performing a DFT (Discrete Fourier Transform) operation. Through these steps, the SFR algorithm calculates the corresponding resolution value for the RAW image.

[0060] It is understood that the SFR algorithm is not the subject of this application, and the embodiments of this application do not provide a detailed description of the specific calculation steps of the SFR algorithm. The SFR algorithm is a conventional algorithm in the field of image processing technology, and the embodiments of this application are merely illustrative examples and do not specifically limit the resolution algorithm.

[0061] S03. Calculate the ambient temperature difference of the equipment based on the first temperature data;

[0062] In one embodiment, the first temperature data includes the device temperature and the ambient temperature.

[0063] Furthermore, based on a preset temperature weight and the device temperature, the operating temperature is calculated, wherein the device temperature includes the sensor temperature and the processor CPU temperature; based on the operating temperature and the ambient temperature, the ambient temperature difference of the device is calculated.

[0064] The formula for calculating the ambient temperature difference of the equipment is as follows:

[0065] dT=(T Sensor *ω1+TCPU *ω2)-T Base

[0066] Where dT represents the ambient temperature difference of the equipment, T Sensor T represents the sensor temperature. CPU ω1 represents the temperature weight corresponding to the sensor temperature, and ω2 represents the temperature weight corresponding to the CPU temperature. Sensor *ω1+T CPU *ω2) represents the operating temperature, T Base Indicates ambient temperature.

[0067] In one embodiment, the device temperature is acquired from the camera during the shooting process. The camera may include multiple temperature sensors for measuring both ambient and device temperatures. Therefore, the device temperature may include sensor temperature and processor CPU temperature.

[0068] For example, temperature variations can affect the performance of a stepper motor. At extreme temperatures, the motor's torque and efficiency may decrease, potentially leading to inaccuracies in step distance. For instance, high temperatures can reduce the resistance of the motor windings, thus affecting the motor's current and power output.

[0069] For example, an increase in processor temperature may cause it to reduce its frequency to prevent overheating, which could affect the execution speed and accuracy of the motor control algorithm. If the processor's performance is reduced due to overheating, the pulse signals it sends to the stepper motor may be delayed or inaccurate, thus affecting the control of the stepping distance.

[0070] Ambient temperature can be measured using external temperature sensors, thermometers, or other equipment, or the aforementioned temperature measurement device can be configured in the camera.

[0071] Cameras and their components undergo thermal expansion at different temperatures, which can alter the lens's focal length and the stepping accuracy of the stepper motor. For example, a camera lens may expand as its temperature rises, resulting in a longer focal length, necessitating adjustments to the stepper motor's stepping distance to compensate for this change.

[0072] The operating temperature is calculated based on a preset temperature weight and the device temperature, wherein the device temperature includes the sensor temperature and the processor CPU temperature; the ambient temperature difference of the device is calculated based on the operating temperature and the ambient temperature.

[0073] The formula for calculating the ambient temperature difference of the equipment is as follows:

[0074] dT=(T Sensor *ω1+T CPU *ω2)-T Base

[0075] Where dT represents the ambient temperature difference of the equipment, T Sensor T represents the sensor temperature. CPU ω1 represents the temperature weight corresponding to the sensor temperature, and ω2 represents the temperature weight corresponding to the CPU temperature. Sensor *ω1+T CPU *ω2) represents the operating temperature, T Base Indicates ambient temperature.

[0076] For example, assuming a weight ratio of w = 2:1, the function for the temperature difference dT between the equipment and the environment is:

[0077]

[0078] Among them, T Base This refers to the ambient temperature, such as 38℃.

[0079] For example, if the sensor temperature is 32℃, the CPU temperature is 25℃, the sensor temperature weight is 0.6, the CPU temperature weight is 0.4, and the ambient temperature is 25℃, then the calculation process for the device's ambient temperature difference is as follows:

[0080] First, calculate the operating temperature T1:

[0081] T1=(T Sensor *ω1+T CPU *ω2)=(32×0.6)+(25×0.4)=29.2

[0082] Then calculate the ambient temperature difference dT:

[0083] dT = T1 - T Base =29.2 - 25 = 4.2

[0084] Therefore, the ambient temperature difference for the equipment is 4.2 degrees Celsius. This temperature difference can be used to assess the performance changes of the camera and its components at the current operating temperature, and to adjust the stepper motor's step distance as needed to compensate for changes caused by thermal expansion.

[0085] S04. Based on the ambient temperature difference of the equipment, calculate the step distance compensation amount corresponding to the focusing calibration position;

[0086] Based on the temperature difference in the equipment environment, a temperature compensation algorithm is implemented to adjust the stepper motor's stepping distance to ensure accurate focus and image quality at different temperatures.

[0087] Furthermore, based on the step distance compensation calculation formula and the ambient temperature difference of the equipment, the step distance compensation corresponding to the focusing calibration position is calculated.

[0088] The formula for calculating the step distance compensation is as follows:

[0089] Distance_off=a0*dT 2 +a1*dT+a2

[0090] Where Distance_off represents the step distance compensation amount, dT represents the ambient temperature difference of the equipment, and a0, a1, and a2 represent constant coefficients.

[0091] In one embodiment, this application provides a set of constant coefficients: a0 = 0.9464, a1 = -3.2445, a2 = 0.38. These coefficients can be determined experimentally or based on the characteristic curves of the stepper motor.

[0092] In the formula for calculating the step distance compensation, the quadratic term (a0*dT) 2 The nonlinear effect of temperature change on the stepper motor's step distance is considered. These higher-order terms can compensate for the nonlinear deformation and hysteresis effect of the motor's internal structure caused by temperature changes. The first-order term (a1*dT) represents the linear effect of temperature change on the stepper motor's step distance. This is the most direct compensation term, reflecting the influence of temperature change on parameters such as motor resistance and inductance.

[0093] In one embodiment, the constant coefficients a0, a1, and a2 can be adjusted according to the specific model of the stepper motor and the operating environment. Typically, these coefficients can be obtained experimentally, i.e., by measuring the actual step distance of the stepper motor at different temperatures and comparing it with theoretical values ​​to determine the optimal coefficients.

[0094] S05. Based on the step distance compensation amount, correct the multiple first step distances to obtain multiple corrected second step distances;

[0095] In one embodiment, the process of correcting the step distance based on the step distance compensation is mainly to ensure that the stepper motor can maintain accurate positioning and motion control under different temperature conditions.

[0096] Furthermore, based on the step distance compensation formula, the step distance compensation amount is used to correct the multiple first step distances to obtain multiple second step distances.

[0097] The step distance compensation formula is as follows:

[0098] Distance_best=Distance_top+Distance_off

[0099] Where Distance_best represents the second step distance, Distance_top represents the first step distance, and Distance_off represents the step distance compensation amount.

[0100] The step distance correction involves adding or subtracting the first step distance based on the step distance compensation amount. If the step distance compensation amount is positive, the first step distance needs to be added to the step distance compensation amount, which is the corrected second step distance. If the step distance compensation amount is negative, the first step distance needs to be subtracted from the step distance compensation amount, which is the corrected second step distance.

[0101] S06. Based on the first temperature data, multiple second step distances, and multiple first resolutions corresponding to the first step distances, calculate the focus calibration function corresponding to the focus calibration position;

[0102] In one embodiment, step distance compensation is performed on the first step distance by step distance compensation amount. At this time, the correspondence between the second step distance and the first resolution is obtained according to the correspondence between multiple first step distances and second step distances.

[0103] Based on the first temperature data, multiple second step distances, and the first resolution corresponding to multiple first step distances, as well as the correspondence between the second step distances and the first resolutions, a focus calibration function for the focus calibration position is constructed:

[0104] R(x, t) = ax 2 +bx+ct+d

[0105] Based on multiple second step distances x, first temperature data t, and first resolution R corresponding to multiple second step distances, solve for the constant coefficients a, b, c, and d of the above focusing calibration function (or the above constants can minimize the difference between the calculated first resolution and the actual resolution under different second step distances), thereby constructing the focusing calibration function.

[0106] S07. Repeat steps S01 to S06 to calculate the focus calibration function corresponding to the multiple focus calibration positions;

[0107] In one embodiment, after completing the calculation of the focus calibration function for one focus calibration position, the process can proceed to the next focus calibration position and repeat steps S01 to S06 to calculate the focus calibration function corresponding to each focus calibration position in turn until the focus calibration function corresponding to all focus calibration positions that need to be calibrated is obtained, at which point the focus calibration can be terminated.

[0108] S08. Obtain the current focus calibration position of the target camera, and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

[0109] In one embodiment, after calculating the focus calibration functions corresponding to multiple focus calibration positions, the focus calibration functions corresponding to each focus calibration position can be stored in the camera. When fast focusing is required, the corresponding focus calibration function can be called according to the focus calibration position to calculate the optimal step distance, and then the stepper motor can be adjusted to move to the optimal step distance, or to the step distance that the camera closest to the optimal step distance can support, so as to improve the efficiency and quality of the camera's autofocus.

[0110] This embodiment calculates the step distance error caused by changes in ambient temperature using first temperature data, and compensates for the error in the first step distance to ensure that the camera maintains accurate focusing performance under different temperature conditions, thus improving the accuracy of camera focusing calibration. By using a focusing calibration formula, the first resolution of each first step distance corresponding to each focusing calibration position is calculated, achieving a quantitative evaluation of calibration quality and intuitively demonstrating the focusing calibration effect of each first step distance. By comparing the first resolution corresponding to each first step distance, the focusing calibration function corresponding to each focusing calibration position is calculated, thereby determining the optimal focusing calibration parameters for the camera at different focusing calibration positions. This improves the data accuracy of the camera focusing calibration parameters and further enhances the accuracy and reliability of the camera's autofocus.

[0111] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of a temperature-compensated focusing calibration method based on a resolution function provided in this application.

[0112] In this embodiment, as Figure 2 As shown, based on the above Figure 1 In the illustrated embodiment, after step S04, the method further includes:

[0113] S11. Based on the first resolution corresponding to the multiple first step distances, determine the target step range corresponding to the focus calibration position;

[0114] In one embodiment, multiple first resolutions corresponding to multiple first step distances at the same focus calibration position can be constructed as a downward-opening curve. The first step distance corresponding to the apex of the curve is the optimal step distance for the current focus calibration position, and correspondingly, the first resolution value corresponding to the apex of the curve is the maximum resolution value. However, during focus calibration, the selected first step distance may not be the optimal step distance. To improve the calibration accuracy of the diagonal calibration parameters, a more precise step distance can be selected for resolution calculation, thereby extracting a more precise step distance and calculating more accurate focus calibration parameters.

[0115] Here, the first resolution with the largest value among the multiple selected first step distances can be chosen as the basis for selecting the target step range. Based on the first resolution corresponding to each of the first step distances at each of the focus calibration positions, the two first step distances with the largest resolution values ​​are determined; based on the two first step distances with the largest resolution values, the target step range for each of the focus calibration positions is obtained. Because the distance interval between any two adjacent first step distances is the same, and the first resolutions corresponding to multiple first step distances form a downward-opening curve, the maximum resolution value corresponding to the curve vertex among the multiple first resolutions calculated from the first step distances lies between the two first resolutions with the largest calculated values. Therefore, the range between the two first step distances with the largest corresponding resolution values ​​can be used as the target step range.

[0116] In another embodiment, based on the first resolution corresponding to each of the first step distances at each of the focus calibration positions, a target first step distance with the largest resolution value is determined; based on the target first step distance, a target step range corresponding to the focus calibration position is determined.

[0117] Since the first resolution with the largest value is closest to the vertex of the resolution curve among the multiple first resolutions calculated based on the first step distance, the first resolution with the largest value can be used as the basis for selecting the target step range, and the target step range can be selected within a certain range before and after the first resolution.

[0118] For example, suppose that among the multiple first resolutions calculated based on multiple first step distances, the first resolution with the largest value is R1, and the first step distance corresponding to R1 is x1. Then the target step range can be determined as (x1-50, x1+50). Here, x1-50 is located between x1 and its adjacent previous first step distance, and x1+50 is located between x1 and its adjacent next first step distance.

[0119] S12. Based on the first preset interval, extract multiple third step distances within the target step range;

[0120] The first set interval is less than the interval between two adjacent first step distances. The first set interval can be selected according to actual accuracy requirements or equipment parameters. For example, if the interval between two adjacent first step distances is 100mm, then the first set interval can be 10mm. That is, assuming the target step range is (0, 100), the third step distance can be extracted as (10, 20, ..., 90).

[0121] S13. Based on the resolution extraction method, calculate the second resolution corresponding to multiple third step distances;

[0122] In one embodiment, using previously set camera acquisition parameters, the target camera is controlled to acquire images of the calibration board at multiple third step distances to obtain a second calibration image. The second calibration image is then analyzed using the aforementioned resolution algorithm to obtain the second resolution corresponding to the multiple third step distances.

[0123] It is understood that the calculation methods and processes for the second resolution and the first resolution are the same. The only difference is that the calibration images are acquired from different pace distances, but the image resolution process is the same. Here, this application embodiment will not elaborate on this process, but can refer to the above SFR algorithm to extract the calculation process of the first resolution.

[0124] S14. Based on the step distance compensation amount, the multiple third step distances are corrected to obtain multiple corrected fourth step distances;

[0125] In one embodiment, based on the step distance compensation formula, the step distance compensation amount is used to correct multiple third step distances to obtain multiple fourth step distances.

[0126] The step distance compensation formula is as follows:

[0127] Distance_4=Distance_3+Distance_I

[0128] Where Distance_4 represents the fourth step distance, Distance_3 represents the third step distance, and Distance_I represents the step distance compensation amount.

[0129] In one embodiment, step distance correction involves adding or subtracting the third step distance based on the step distance compensation amount. If the step distance compensation amount is positive, the third step distance needs to be added, i.e., the third step distance plus the step distance compensation amount, which is the corrected fourth step distance; if the step distance compensation amount is negative, the third step distance needs to be subtracted, i.e., the third step distance minus the step distance compensation amount, which is the corrected fourth step distance.

[0130] S15. Based on the first temperature data, the multiple fourth step distances, and the second resolutions corresponding to the multiple third step distances, calculate the focus calibration function corresponding to the focus calibration position;

[0131] In one embodiment, the third step distance is compensated by the step distance compensation amount. At this time, the correspondence between the fourth step distance and the second resolution is obtained according to the correspondence between the multiple third step distances and the fourth step distance.

[0132] Based on the first temperature data, multiple fourth step distances, and multiple third step distances corresponding to the second resolution, as well as the correspondence between the fourth step distance and the second resolution, a focus calibration function for the focus calibration position is constructed:

[0133] R(x, t) = ax 2 +bx+ct+d

[0134] Based on multiple fourth step distances x, the first temperature data t, and the second resolution R corresponding to the multiple fourth step distances, the constant coefficients a, b, c, and d of the above focus calibration function are solved, thereby constructing the focus calibration function.

[0135] S16. Repeat the calculation steps of the focus calibration function to calculate the focus calibration function corresponding to multiple focus calibration positions;

[0136] After completing the calculation of the focus calibration function for one focus calibration position, you can move on to the next focus calibration position and repeat the above steps to calculate the focus calibration function corresponding to each focus calibration position in turn, until the focus calibration function corresponding to all focus calibration positions that need to be calibrated is obtained, and then the focus calibration can be completed.

[0137] S17. Obtain the current focus calibration position of the target camera, and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

[0138] After calculating the focus calibration functions corresponding to multiple focus calibration positions, the focus calibration functions corresponding to each focus calibration position can be stored in the camera. When fast focusing is required, the corresponding focus calibration function can be called according to the current focus calibration position to calculate the optimal step distance. Then, the stepper motor can be adjusted to move to the optimal step distance, or to the step distance that the camera closest to the optimal step distance can support, and the camera can focus, thereby improving the efficiency and quality of the camera's autofocus.

[0139] This embodiment provides an initial reference point for camera focusing by determining at least one focus calibration position and its corresponding first step distance. Using a resolution extraction method, a first resolution corresponding to the first step distance is calculated, and a target step range for each focus calibration position is determined based on this first resolution, providing guidance for further focus adjustments. A second step distance is further extracted within the target step range, allowing the camera to fine-tune focus calibration within a smaller range, thereby improving the accuracy of focus calibration. By calculating the second resolution corresponding to the second step distance, the focus effect can be evaluated and adjusted more precisely, ensuring optimal image sharpness. Combining the first temperature data and the second resolution, a focus calibration function is calculated. This function provides a precise focus basis for each focus calibration position, guiding the camera to perform focusing operations according to environmental changes and equipment characteristics, thereby achieving high-precision and high-reliability focus calibration.

[0140] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a first embodiment of a temperature-compensated focusing calibration device based on a resolution function provided in this application. The temperature-compensated focusing calibration device based on a resolution function is used to perform the aforementioned temperature-compensated focusing calibration method based on a resolution function.

[0141] like Figure 3 As shown, the temperature-compensated focusing calibration device 200 based on the resolution function includes: a data acquisition module 201, a first resolution calculation module 202, an equipment environment temperature difference calculation module 203, a step distance compensation calculation module 204, a step distance correction module 205, a focusing calibration function calculation module 206, a function repetition calculation module 207, and a focusing calibration module 208.

[0142] Data acquisition module 201 is used to acquire focus calibration position, multiple first step distances corresponding to the focus calibration position, and first temperature data corresponding to the focus calibration position;

[0143] The first resolution calculation module 202 is used to calculate the first resolution corresponding to multiple first step distances based on the resolution extraction method;

[0144] The equipment ambient temperature difference calculation module 203 is used to calculate the equipment ambient temperature difference based on the first temperature data;

[0145] The step distance compensation calculation module 204 is used to calculate the step distance compensation corresponding to the focusing calibration position based on the ambient temperature difference of the equipment.

[0146] The step distance correction module 205 is used to correct multiple first step distances based on the step distance compensation amount to obtain multiple corrected second step distances;

[0147] The focus calibration function calculation module 206 is used to calculate the focus calibration function corresponding to the focus calibration position based on the first temperature data, multiple second step distances, and multiple first resolutions corresponding to the first step distances.

[0148] The focus calibration module 207 is used to obtain the current focus calibration position of the target camera and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

[0149] In one embodiment, the first resolution calculation module 202 includes:

[0150] The image acquisition unit is used to control the target camera to acquire images of the calibration plate at each of the first step distances corresponding to the current focus calibration position based on preset camera acquisition parameters, so as to obtain the first calibration image;

[0151] The first resolution calculation unit is used to perform image parsing on the first calibration image based on a resolution algorithm to obtain the first resolution corresponding to each of the first step distances.

[0152] In one embodiment, the first temperature data includes the device temperature and the ambient temperature;

[0153] The equipment ambient temperature difference calculation module 203 includes:

[0154] The operating temperature calculation unit is used to calculate the operating temperature based on a preset temperature weight and the device temperature, wherein the device temperature includes the sensor temperature and the processor CPU temperature.

[0155] A temperature difference calculation unit is used to calculate the ambient temperature difference of the equipment based on the operating temperature and the ambient temperature;

[0156] The formula for calculating the ambient temperature difference of the equipment is as follows:

[0157] dT=(T Sensor *ω1+T CPU *ω2)-T Base

[0158] Where dT represents the ambient temperature difference of the equipment, T Sensor T represents the sensor temperature. CPU ω1 represents the temperature weight corresponding to the sensor temperature, and ω2 represents the temperature weight corresponding to the CPU temperature. Sensor *ω1+T CPU *ω2) represents the operating temperature, T Base Indicates ambient temperature.

[0159] In one embodiment, the step distance compensation calculation module 204 includes:

[0160] The step distance compensation calculation unit is used to calculate the step distance compensation corresponding to the focusing calibration position based on the step distance compensation calculation formula and the ambient temperature difference of the equipment.

[0161] The formula for calculating the step distance compensation is as follows:

[0162] Distance_off=a0*dT 2 +a1*dT+a2

[0163] Where Distance_off represents the step distance compensation amount, dT represents the ambient temperature difference of the equipment, and a0, a1, and a2 represent constant coefficients.

[0164] In one embodiment, the step distance correction module 205 includes:

[0165] A step distance correction unit is used to correct multiple first step distances based on a step distance compensation formula and using the step distance compensation amount to obtain multiple second step distances;

[0166] The step distance compensation formula is as follows:

[0167] Distance_best=Distance_top+Distance_off

[0168] Where Distance_best represents the second step distance, Distance_top represents the first step distance, and Distance_off represents the step distance compensation amount.

[0169] In one embodiment, the temperature-compensated focusing calibration device 300 based on the resolution function further includes a graded focusing calibration module, comprising:

[0170] The target step range determination unit is used to determine the target step range corresponding to the focus calibration position based on the first resolution corresponding to multiple first step distances;

[0171] The third step distance extraction unit is used to extract multiple third step distances within the target step range based on a first preset interval;

[0172] The second resolution calculation unit is used to calculate the second resolution corresponding to multiple third step distances based on the resolution extraction method.

[0173] The first step distance correction unit is used to correct multiple third step distances based on the step distance compensation amount to obtain multiple corrected fourth step distances;

[0174] The first unit for calculating the focus calibration function is used to calculate the focus calibration function corresponding to the focus calibration position based on the first temperature data, multiple fourth step distances, and the second resolutions corresponding to multiple third step distances.

[0175] The focus calibration operation unit is used to obtain the current focus calibration position of the target camera and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

[0176] In one embodiment, the target step range determination unit includes:

[0177] The maximum step distance determination first sub-unit is used to determine the two first step distances with the largest resolution values ​​based on the first resolution corresponding to each first step distance at each of the focus calibration positions;

[0178] The first sub-unit for determining the target step range is used to obtain the target step range of each focus calibration position based on the two first step distances with the largest resolution values.

[0179] In one embodiment, the target step range determination unit further includes:

[0180] The second sub-unit for determining the maximum step distance is used to determine the target first step distance with the largest resolution value based on the first resolution corresponding to each first step distance at each of the focus calibration positions.

[0181] The second sub-unit for determining the target step range is used to determine the target step range corresponding to the focus calibration position based on the first step distance of the target.

[0182] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device and each module described above can be referred to the corresponding process in the aforementioned embodiment of the temperature-compensated focusing calibration method based on the resolution function, and will not be repeated here.

[0183] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 4 It runs on the computer device shown.

[0184] Please see Figure 4 , Figure 4 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.

[0185] See Figure 4 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.

[0186] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any temperature-compensated focusing calibration method based on a resolution function.

[0187] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0188] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to execute any temperature-compensated focusing calibration method based on a resolution function.

[0189] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0190] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0191] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the temperature-compensated focusing calibration methods based on resolution functions provided in the embodiments of this application.

[0192] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.

[0193] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A temperature-compensated focus calibration method based on a resolution function, characterized in that, The method includes: S01. Obtain the focus calibration position, multiple first step distances corresponding to the focus calibration position, and the first temperature data corresponding to the focus calibration position; S02. Based on the resolution extraction method, calculate the first resolution corresponding to the multiple first step distances; S03. Calculate the ambient temperature difference of the equipment based on the first temperature data; S04. Based on the ambient temperature difference of the equipment, calculate the step distance compensation amount corresponding to the focusing calibration position; S05. Based on the step distance compensation amount, correct the multiple first step distances to obtain multiple corrected second step distances; S06. Based on the first temperature data, multiple second step distances, and multiple first resolutions corresponding to the first step distances, calculate the focus calibration function corresponding to the focus calibration position; Repeat steps S01 to S06 to calculate the focus calibration function corresponding to the multiple focus calibration positions; Obtain the current focus calibration position of the target camera, and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

2. The temperature-compensated focusing calibration method based on resolution function according to claim 1, characterized in that, The resolution extraction method, which calculates the first resolution corresponding to multiple first step distances, includes: Based on preset camera acquisition parameters, the target camera is controlled to acquire images of the calibration board at each of the first step distances corresponding to the current focus calibration position, thereby obtaining the first calibration image. Based on the resolution algorithm, the first calibration image is parsed to obtain the first resolution corresponding to each of the first step distances.

3. The temperature-compensated focusing calibration method based on resolution function according to claim 1, characterized in that, The first temperature data includes the equipment temperature and the ambient temperature; The step of calculating the ambient temperature difference of the equipment based on the first temperature data includes: The operating temperature is calculated based on a preset temperature weight and the device temperature, wherein the device temperature includes the sensor temperature and the processor CPU temperature. Calculate the ambient temperature difference of the equipment based on the operating temperature and the ambient temperature; The formula for calculating the ambient temperature difference of the equipment is as follows: dT=(T Sensor *ω1+T CPU *ω2)-T Base Where dT represents the ambient temperature difference of the equipment, T Sensor T represents the sensor temperature. CPU ω1 represents the temperature weight corresponding to the sensor temperature, and ω2 represents the temperature weight corresponding to the CPU temperature. Sensor *ω1+T CPU *ω2) represents the operating temperature, T Base Indicates ambient temperature.

4. The temperature-compensated focus calibration method based on resolution function according to claim 1, characterized in that, The step distance compensation amount corresponding to the focusing calibration position based on the ambient temperature difference of the equipment includes: Based on the formula for calculating the step distance compensation and the temperature difference of the equipment environment, the step distance compensation corresponding to the focusing calibration position is calculated. The formula for calculating the step distance compensation is as follows: Distance_off=a0*dT 2 +a1*dT+a2 Where Distance_off represents the step distance compensation amount, dT represents the ambient temperature difference of the equipment, and a0, a1, and a2 represent constant coefficients.

5. The temperature-compensated focusing calibration method based on resolution function according to claim 1, characterized in that, The step of correcting multiple first step distances based on the step distance compensation amount to obtain multiple corrected second step distances includes: Based on the step distance compensation formula, the step distance compensation amount is used to correct multiple first step distances to obtain multiple second step distances; The step distance compensation formula is as follows: Distance_best=Distance_top+Distance_off Where Distance_best represents the second step distance, Distance_top represents the first step distance, and Distance_off represents the step distance compensation amount.

6. The temperature-compensated focusing calibration method based on resolution function according to claim 1, characterized in that, After calculating the step distance compensation amount corresponding to the focusing calibration position based on the ambient temperature difference of the equipment, the method further includes: Based on the first resolution corresponding to the first step distance of multiple steps, the target step range corresponding to the focus calibration position is determined; Based on a first predetermined interval, multiple third step distances are extracted within the target step range; Based on the resolution extraction method, calculate the second resolution corresponding to multiple third step distances; Based on the step distance compensation amount, the multiple third step distances are corrected to obtain multiple corrected fourth step distances; Based on the first temperature data, multiple fourth step distances, and multiple third step distances corresponding to the second resolution, calculate the focus calibration function corresponding to the focus calibration position; Repeat the calculation steps of the focus calibration function to calculate the focus calibration function corresponding to multiple focus calibration positions; Obtain the current focus calibration position of the target camera, and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

7. The temperature-compensated focusing calibration method based on the resolution function according to claim 6, characterized in that, The step of determining the target step range corresponding to the focus calibration position based on the first resolution corresponding to multiple step distances includes: Based on the first resolution corresponding to each first step forward distance at each of the focus calibration positions, determine the two first step forward distances with the largest resolution values; Based on the two first step distances with the largest resolution values, the target step range of each focus calibration position is obtained.

8. The temperature-compensated focusing calibration method based on the resolution function according to claim 6, characterized in that, The step of determining the target step range corresponding to the focus calibration position based on the first resolution corresponding to multiple step distances further includes: Based on the first resolution corresponding to each first step forward distance at each of the aforementioned focus calibration positions, determine the target first step forward distance with the largest resolution value; Based on the first step distance of the target, the target step range corresponding to the focus calibration position is determined.

9. A temperature-compensated focusing calibration device based on a resolution function, characterized in that, The temperature-compensated focusing calibration device based on the resolution function includes: The data acquisition module is used to acquire the focus calibration position, multiple first step distances corresponding to the focus calibration position, and the first temperature data corresponding to the focus calibration position; The first resolution calculation module is used to calculate the first resolution corresponding to multiple first step distances based on the resolution extraction method; The equipment ambient temperature difference calculation module is used to calculate the equipment ambient temperature difference based on the first temperature data; The step distance compensation calculation module is used to calculate the step distance compensation corresponding to the focusing calibration position based on the ambient temperature difference of the equipment. The step distance correction module is used to correct multiple first step distances based on the step distance compensation amount to obtain multiple corrected second step distances; The focus calibration function calculation module is used to calculate the focus calibration function corresponding to the focus calibration position based on the first temperature data, multiple second step distances, and multiple first resolutions corresponding to the first step distances. The focus calibration module is used to obtain the current focus calibration position of the target camera and perform focus calibration operation on the target camera based on the focus calibration function corresponding to the current focus calibration position.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the temperature-compensated focus calibration method based on a resolution function as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Lens focusing method for stepping motor based on temperature compensation

    CN107942601A

  • Automatic focusing method and system based on ultrasonic microscope point focusing transducer

    CN112630306A