Zoom tracking method and electronic device

By performing surface fitting on the focusing curve of a high-magnification camera and distinguishing between linear and nonlinear regions, and by employing different zoom tracking methods, the problems of long zoom tracking time and large storage space required for high-magnification cameras were solved, resulting in improved image clarity and reduced storage space.

CN115883967BActive Publication Date: 2025-11-07SICHUAN MING LIN HUI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211557149.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-11-07
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

High-magnification cameras have long zoom tracking time, high storage space requirements, and are prone to image stuttering or blurring, especially at the telephoto end where the image is severely blurred.

Method used

By fitting the focus curve samples to a surface, a focus surface model is established. Different zoom tracking methods are used in the linear and nonlinear regions. Geometric zoom tracking and focus surface-based zoom tracking are combined with adaptive adjustment of object distance and focus value to reduce storage space and zoom tracking time, and avoid image stuttering and blurring.

Benefits of technology

It reduces the zoom tracking time of high-magnification cameras, saves storage space, avoids image stuttering and blurring, and improves the clarity and efficiency of the zoom process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883967B_ABST
    Figure CN115883967B_ABST
Patent Text Reader

Abstract

A zoom tracking method and an electronic device, the zoom tracking method comprising: obtaining focus curve samples, and performing surface fitting on the focus curve samples to obtain a focus surface model, the focus surface model comprising focus curves of multiple object distances, the focus curve comprising a linear region, a nonlinear region and a demarcation point; performing zoom tracking according to GZT for the linear region, and performing zoom tracking using a zoom tracking method based on the focus surface with a first focusing value for the nonlinear region. The first focusing value is determined according to a first object distance value, and the first object distance value is an object distance value obtained using a geometric method at the demarcation point between the linear region and the nonlinear region. By performing surface fitting on the focus curve samples, the focus surface model is established, the measurement work of the focus curve can be reduced, the focusing value determined at the long-focus end is more accurate, and the picture remains clear during zooming. In addition, different zoom tracking methods are used for the linear region, the nonlinear region and the demarcation point, which can avoid picture freezing and / or blurring.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a zoom tracking method and an electronic device. BACKGROUND

[0002] With the requirement of security and the like, the camera is widely applied. In order to make the camera collect images clearly, the camera needs to track zoom and search for focus. The zoom tracking needs to collect and store multiple focus curves, and determine the shooting focal length according to the multiple focus curves.

[0003] Considering the cost, the demand for deploying large-magnification cameras is higher and higher. For the large-magnification camera, since the zoom range of the large-magnification camera is wider, the storage space occupied by the focus curve is larger, the storage space requirement of the camera is higher, and the zoom tracking takes a long time, which is easy to cause the picture to be stuck. In addition, the focus curve is concentrated at the wide-angle end, the focus values corresponding to the zoom values of different object distances are small, and there is a "one-to-many" problem. At the telephoto end, the focus values corresponding to the zoom values of different object distances are large, which causes the picture to be blurred. SUMMARY

[0004] The present application provides a zoom tracking method and an electronic device, which are used to reduce the time consumption of zoom tracking of a large-magnification camera, save the storage space of the camera, and avoid the picture being stuck or blurred as much as possible.

[0005] In a first aspect, a zoom tracking method is provided. The execution subject of the method is a camera with computing and storage capabilities, which can be a large-magnification camera.

[0006] The zoom tracking method includes: obtaining a focus curve sample, and performing surface fitting on the focus curve sample to obtain a focus surface. The focus surface model includes focus curves of multiple object distances, and the focus surface model includes a linear region and a nonlinear region. For the linear region, geometric zoom tracking (GZT) is used for zoom tracking, and for the nonlinear region, a first focus value is used to perform zoom tracking based on the focus surface. The first focus value is determined according to a first object distance value, and the first object distance value is an object distance value obtained by using a geometric method at the boundary point of the linear region and the nonlinear region.

[0007] In this scheme, by performing surface fitting on the focus curve sample, a focus surface model is established, which can reduce the measurement work of the focus curve, and the focus surface can be used to more accurately determine the focus value at the telephoto end, so that the picture remains clear during zooming. In addition, different zoom tracking methods are used for the linear region and the nonlinear region, which can avoid the picture being stuck and / or blurred as much as possible.

[0008] In a possible implementation, before the focus curve sample is acquired, the method further includes: performing linear fitting on the acquired first focus curve according to the focus point collected at the wide-angle end; determining a demarcation point of a linear region and a nonlinear region of the first focus curve according to the first focus curve and the first focus curve after linear fitting; sampling the linear region before the demarcation point at a first interval and sampling the nonlinear region after the demarcation point at a second interval, where the first interval is greater than the second interval.

[0009] In this scheme, the linear region is sampled at a larger interval and the nonlinear region is sampled at a smaller interval, which can save the acquisition time of the focus curve. In addition, because the linear region is sampled at a larger interval, less data is collected, and thus the storage space of the acquired focus curve can be reduced.

[0010] In a possible implementation, before the zoom tracking is performed on the nonlinear region at the first focus value using the zoom tracking method based on the focus curve, the method further includes:

[0011] estimating the first object distance value using a geometric method at the demarcation point of the linear region and the nonlinear region;

[0012] determining the first focus value according to the first object distance value.

[0013] In this scheme, when the zoom position is at the demarcation point of the linear region and the nonlinear region, the object distance is estimated using a geometric method to further obtain the focus value. Because the geometric method for estimating the object distance only needs one frame of image, the screen can be prevented from appearing stuck.

[0014] In a possible implementation, the zoom tracking is performed on the nonlinear region at the first focus value using the zoom tracking method based on the focus curve, including:

[0015] adjusting the object distance according to the focus position of the first frame and the focus position of a second frame, the second frame being a next frame of the first frame;

[0016] adjusting the current focus value according to the adjusted object distance to obtain the first focus value;

[0017] performing zoom tracking at the first focus value using the zoom tracking method based on the focus curve.

[0018] In this scheme, by analyzing the zoom positions of the previous frame and the current frame, the object distance value is adaptively adjusted, and thus the focus value is dynamically corrected, which can minimize the blur of the screen at the telephoto end.

[0019] In a possible implementation, the object distance is adjusted according to the focus position of the first frame and the focus position of the second frame, including:

[0020] adjust the object distance according to the focusing position of the first frame, the focusing position of the second frame and an adjustment factor, wherein the adjustment factor is determined based on the sharpness value of the first frame and the sharpness value of the second frame, and different adjustment factors correspond to different sharpness value ranges.

[0021] In this scheme, different adjustment factors can be set for different stages of the object distance, thereby improving the accuracy of the corrected focusing value to avoid blurring of the picture at the telephoto end as much as possible.

[0022] In a second aspect, an electronic device is provided, which can be a camera, a part of a camera, or an electronic device independent of the camera. The electronic device includes a processing module and a storage module, wherein the storage module is configured to store a focusing curve sample; and the processing module is configured to: obtain the focusing curve sample, and perform surface fitting on the focusing curve sample to obtain a focusing surface model, the focusing surface model including focusing curves of multiple object distances, and the focusing surface model including a linear region and a nonlinear region; perform zoom tracking according to GZT for the linear region, and perform zoom tracking using a focusing surface-based zoom tracking method with a first focusing value for the nonlinear region, wherein the first focusing value is determined according to a first object distance value, and the first object distance value is an object distance value obtained using a geometric method at a demarcation point between the linear region and the nonlinear region.

[0023] In possible implementation manners, before obtaining the focusing curve sample, the processing module is further configured to:

[0024] perform linear fitting on the first focusing curve collected according to the focus point collected at the wide-angle end;

[0025] determine a demarcation point between the linear region and the nonlinear region of the first focusing curve according to the first focusing curve and the first focusing curve after linear fitting;

[0026] sample the linear region before the demarcation point at a first interval, and sample the nonlinear region after the demarcation point at a second interval, wherein the first interval is greater than the second interval.

[0027] In possible implementation manners, before performing zoom tracking using the focusing surface-based zoom tracking method with the first focusing value for the nonlinear region, the processing module is further configured to:

[0028] estimate the first object distance value using a geometric method at the demarcation point between the linear region and the nonlinear region;

[0029] determine the first focusing value according to the first object distance value.

[0030] In possible implementation manners, the processing module is configured to perform zoom tracking using the focusing surface-based zoom tracking method with the first focusing value for the nonlinear region, specifically including:

[0031] adjust the object distance according to the focusing position of the first frame and the focusing position of the second frame, wherein the second frame is a next frame of the first frame;

[0032] adjust the current focusing value according to the adjusted object distance to obtain a first focusing value;

[0033] perform zoom tracking using the zoom tracking method based on the focusing curve with the first focusing value.

[0034] In a possible implementation, the adjusting the object distance according to the focusing position of the first frame and the focusing position of the second frame comprises:

[0035] adjust the object distance according to the focusing position of the first frame and the focusing position of the second frame and an adjustment factor, wherein the adjustment factor is determined based on a sharpness value of the first frame and a sharpness value of the second frame, and the adjustment factor is different for different sharpness value ranges.

[0036] In a third aspect, a camera is provided, which has functions to implement the behaviors in the method embodiments of the first aspect. The functions can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. The electronic device includes a communication interface and a processor, and optionally, a memory. The memory is configured to store computer programs or instructions, and the processor is coupled with the memory and the communication interface. When the processor executes the computer programs or instructions, the camera performs the method performed by the method embodiments.

[0037] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program. When the computer program is executed, the method performed by the first aspect is implemented. BRIEF DESCRIPTION OF DRAWINGS

[0038] Figure 1 a flowchart of a zoom tracking method provided by an embodiment of the present application;

[0039] Figure 2 a schematic diagram of a focusing curve sample provided by an embodiment of the present application;

[0040] Figure 3 a schematic diagram of a focusing curve model provided by an embodiment of the present application;

[0041] Figure 4 a schematic diagram of a focusing value calculated by a linear region GZT provided by an embodiment of the present application;

[0042] Figure 5 a schematic diagram of an object distance value estimated for a demarcation point between a linear region and a nonlinear region provided by an embodiment of the present application;

[0043] Figure 6This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] To facilitate understanding of the technical solutions provided in the embodiments of this application, some concepts and technical terms related to the embodiments of this application will be introduced first.

[0045] 1) The focus curve refers to the curve formed by the zoom value (Z-value) corresponding to the camera's zoom motor and the focus value (F-value) corresponding to the camera's focus motor at a certain object distance. It can be understood that each position of the motor corresponds to one motor step (1 step is 6.25μm). When the object distance is constant, one Z-value corresponds to one F-value, resulting in the clearest image captured by the camera.

[0046] 2) The focused surface model refers to the surface model formed by the focusing curves under different object distances.

[0047] 3) The sharpness evaluation function refers to the function that plots the image from blurry to sharp and back to blurry as the focusing motor moves from the near end to the far end of the subject when the camera zoom value is constant and the subject distance is constant. When the subject distance is constant, the curve formed by the sharpest focusing value obtained after the camera zooms and refocuses step by step is the focus curve.

[0048] 4) The fast mountain climbing peak search algorithm obtains the image sharpness value through a sharpness evaluation function after the camera acquires the image. Then, it drives the focusing motor based on the sharpness value and finally moves the focusing lens to the position with the highest image sharpness value.

[0049] 5) Geometric Zoom Tracking (GZT) refers to obtaining the zoom tracking curve by linear interpolation of the farthest and nearest focusing curves. When a high-magnification camera moves towards the telephoto end, the offset between the estimated trajectory curve and the actual trajectory curve gradually increases, resulting in blurry camera focus.

[0050] 6) Adaptive Zoom Tracking (AZT) refers to dividing the focus curve into linear and nonlinear regions. The linear region uses GZT zoom tracking; at the boundary between the linear and nonlinear regions, Z... b At this time, the focus search algorithm is used to find the clearest focus value, and the starting value is updated. In the non-linear region, the GZT algorithm is used to track the image again using this focus value. AZT will experience stuttering at the boundary Zb ​​between the linear and non-linear regions, and will exhibit non-linearity at the telephoto end of high-magnification cameras. Using GZT will lead to image blurring.

[0051] 7) Feedback Zoom Tracking (FZT) is to set several detection actions during zooming, and each detection needs to obtain the relationship between the sharpness evaluation values corresponding to the front and rear zoom values, and the zoom tracking algorithm is performed by using the PID control method. In FZT, too much time is consumed by PID, which causes the picture to appear to be stuck during zoom tracking.

[0052] 8) Improvement Feedback Zoom Tracking (IFZT) is an improvement on the basis of FZT for the long focal end, discards the complex PID and detection method, and finds out the law by analyzing the state information of the front and rear zoom positions, to determine the correction direction of the tracking curve and the correction distance of the focusing motor. IFZT is not ideal for zoom tracking of the large magnification long focal end, and has requirements for storage space.

[0053] As described above, considering the cost problem, the demand for deployment of large magnification cameras is increasing. However, since the zoom range of the large magnification camera is wider, the storage space occupied by the focusing curve is also larger, the storage space requirement of the camera is higher, and the zoom tracking time is longer, which is easy to cause the picture to appear to be stuck. In addition, the focusing curve of the large magnification camera is relatively concentrated at the wide-angle end, the zoom values corresponding to different object distances have small differences in the focusing values, and there is a "one-to-many" problem; while at the long focal end, the zoom values corresponding to different object distances have large differences in the focusing values, which will cause the picture to be blurred.

[0054] In view of this, the technical scheme of the embodiments of the present application is provided. The embodiments of the present application propose a new zoom tracking method for large magnification cameras. The method can reduce the storage space occupied by the focusing curve, reduce the zoom tracking time, and avoid the picture from appearing to be stuck or blurred as much as possible.

[0055] The technical scheme provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings of the specification.

[0056] Please refer to Figure 1 The flowchart of the zoom tracking method provided by the embodiments of the present application is shown in the figure. The method can be executed by an electronic device with processing function, such as a camera, or a device capable of supporting the function of the electronic device, such as a chip. In the following, the electronic device is taken as an example of a camera. Specifically, the flow of the zoom tracking method provided by the embodiments of the present application is described as follows:

[0057] S101, obtain a focusing curve sample.

[0058] The focusing curve sample includes a plurality of focusing curves, each focusing curve being a curve formed by a zoom value (Z value) corresponding to a zoom motor of the camera and a focus value (F value) corresponding to a focus motor of the camera at a certain object distance. It can be understood that the position corresponding to the zoom motor and the position corresponding to the focus motor of the camera will change during the shooting process, that is, the zoom value and the focus value will change. Therefore, during the shooting process of the camera, the position corresponding to the zoom motor and the position corresponding to the focus motor can be sampled at certain intervals, that is, the zoom value and the focus value are collected at certain intervals, so as to obtain a plurality of focusing curves.

[0059] If the camera is at a small magnification, the focusing curve is linear, and if the camera is at a small magnification, the focusing curve changes from linear to nonlinear. In other words, after zooming to the vertex of the focus value, the focus value begins to decrease rapidly as the zoom continues to increase. If equal Z value intervals are used for sampling, when the Z value sampling interval is small, the nonlinear region data is better, but the linear region sampling points are too many, resulting in a large amount of data and requiring a larger storage space. When the Z value sampling interval is large, the linear region sampling points are reduced, but the number of nonlinear region sampling points is small, and the accurate relationship between the zoom value and the adjustment value cannot be well represented.

[0060] Therefore, in the embodiments of the present application, the linear region can be sampled at a large interval, and the nonlinear region can be sampled at a small interval. Since the linear region is sampled at a large interval, the amount of data collected is small, so the storage space of the collected focusing curve can be reduced. In addition, sampling the linear region at a large interval can save the collection time of the focusing curve, thereby reducing the time consumption of zoom tracking. Sampling the nonlinear region at a small interval can also well represent the accurate relationship between the zoom value and the adjustment value.

[0061] By using different sampling intervals, the focusing search algorithm can be used to collect focusing curves at different object distances. The focusing search algorithm includes two parts: a sharpness evaluation function and a peak search algorithm. In the sampling process, in order to improve the accuracy of the sampled focusing curve, a suitable sharpness evaluation function and peak search algorithm need to be selected. For the sharpness evaluation function, a function provided by an existing chip can be used, for example, a function provided by Hi3516D. Since the higher the frequency, the larger the amplitude of the high-frequency component, the Hi3516D calculates the image sharpness value (FV) by using the high-frequency component. This method refers to dividing the image into B small blocks, and obtaining four high-frequency components H1, H2, V1, V2 through horizontal and vertical high-pass filters for each block of image, and the FV value calculation formula for each block of image is:

[0062] FV1 n = α × H1 n + (1-α) × V1 n (2)

[0063] FV2 n = a x H2 n + (1 - a) x V2 n (3)

[0064] Wherein, a is a weight value, FV1 is suitable for low-illumination occasions, and FV2 is suitable for normal occasions. In order to adaptively adjust FV to apply to different application scenarios, a proper weight is set to weight each block of image, and the calculation formula of the image sharpness value is:

[0065]

[0066] Wherein, B represents the number of blocks, FV n represents the FV value of the nth block, weight n represents the weight of the nth block. The image sharpness curve is obtained through the formula, and on this basis, the fast hill-climbing peak value searching algorithm with high accuracy is used to obtain the focusing value F.

[0067] It should be understood that before sampling the focusing curve, the linear region and the nonlinear region of the focusing curve can be divided first, that is, the demarcation point of the linear region and the nonlinear region of the focusing curve is determined. Since the focusing curve is relatively concentrated at the wide-angle end, the slope difference is small, and the demarcation point of the linear region and the nonlinear region of the focusing curve can be determined for uniform collection of any one focusing curve (for example, referred to as a first focusing curve), so that the linear region before the demarcation point is sampled at a first interval, and the nonlinear region after the demarcation point is sampled at a second interval, wherein the first interval is greater than the second interval.

[0068] For example, the first focusing curve collected according to the wide-angle end is linearly fitted to obtain a monomial polynomial as formula (1):

[0069] F(Z) = A x Z + B (1)

[0070] Wherein, A is the slope of the linear region, and B is the intercept of the linear region. For example, the first 10 zoom values of the first focusing curve and the monomial polynomial are the demarcation point of the linear region and the nonlinear region.

[0071] The camera obtains the F value under the current Z value by zooming and focusing one by one, and plots different Z values and their corresponding F values into a focusing curve to obtain multiple focusing curves, that is, focusing curve samples, as shown in Figure 2 .

[0072] S102, surface fitting is performed on the focusing curve samples to obtain a focusing surface model, and the focusing surface model includes focusing curves of multiple object distances.

[0073] In this embodiment, multiple focus curves from the focus curve sample can be fitted with a surface to obtain focus curves at different object distances, i.e., focus surface models. This embodiment does not limit the fitting formula used for surface fitting; for example, a fitting polynomial or the Rational2D formula can be used. The Rational2D formula is a two-dimensional rational function with a third-order numerator and a third-order denominator. Appropriate coefficients can be adjusted; therefore, even for nonlinear focus curves at long focal lengths, where the focus curves differ significantly between different object distances, the fitting error at long focal lengths can be reduced by adjusting appropriate coefficients.

[0074] For example, such as Figure 2 The resulting focusing curve exhibits a non-linear behavior. To improve fitting accuracy, the focusing curve can be divided into six linear regions, resulting in six different focusing surface fitting formulas. Since the object distance values ​​differ significantly, taking the logarithm of the object distance values ​​makes the curves more concentrated, thereby improving fitting accuracy. The Rational2D piecewise focusing surface fitting formula is as follows:

[0075]

[0076] In formula (5), i = 1, 2, 3, 4, 5, 6, Z i0 A i01 B i01 B i02 B i03 A i1 A i2 A i3 B i1 B i2 Z is the fitting coefficient, D is the zoom value, and F(Z,ln(D)) is the focusing value of the zoom motor at position Z with an object distance of D. The results are plotted according to the piecewise focusing fitting formula (5) as follows: Figure 3 The focused surface model shown.

[0077] S103. Zoom tracking is performed based on GZT in the linear region, and zoom tracking based on the focus surface is performed using the first focus value in the nonlinear region. The first focus value is determined based on the first object distance value, and the first object distance value is located at the boundary point Z between the linear and nonlinear regions. b The object distance value determined using the geometric method.

[0078] Based on the characteristics of the focused surface model, it is divided into a linear region, a nonlinear region, and a boundary point. In the embodiments of this application, different zoom tracking algorithms are used for different regions. When the zoom position is in the linear region, GZT is used to estimate the focus value; when the zoom position is at the boundary point Z between the linear and nonlinear regions... bWhen zooming in, a geometric method is used to estimate the object distance to further obtain the focus value; when the zoom position moves towards the telephoto end in the non-linear region, a fast zoom tracking algorithm based on the focus surface model is used. This can minimize image stuttering and / or blurring.

[0079] For the linear region, since the focus curves at different object distances are relatively concentrated and linear in the linear region, the focus value can be obtained by using linear interpolation.

[0080] For example, see Figure 4 This is a schematic diagram for calculating the focusing value using GZT in the linear region. Figure 4 In the diagram, Z represents the position of the zoom motor, and F... D (Z) is the focusing value at zoom level Z with object distance D. and These represent the positions of the focusing motors for sharp focusing, corresponding to the discrete focusing motor positions at near and far object distances, respectively. C D This represents the focusing curve when the object distance is D. Z initial This is the initial zoom position. It is the zoom motor in Z initial The focus value is obtained after running the focus search algorithm. The formula for the focus value obtained by linear interpolation is:

[0081]

[0082] Among them, the slope K of the geometric zoom tracking method GZT for:

[0083]

[0084] The focusing curves at the wide-angle end exhibit a linear relationship, and the focusing value can be calculated using the linear difference formula (6). Compared to IFZT, which uses one of the focusing curves for tracking, this embodiment uses GZT in the linear region, resulting in smaller deviations and thus higher tracking accuracy.

[0085] As shown above, in the linear region, GZT is used to calculate the focus value, but GZT does not use the object distance. However, in the nonlinear region, the focus value is calculated using a fitted focus surface, which requires the object distance. Therefore, the camera can be positioned at the boundary point Z between the linear and nonlinear regions. b The object distance is estimated using a geometric method.

[0086] For example, five object distances D1, D2, D3, D4, and D5 can be used to divide the focus surface into four parts, using the focus value from the previous frame. The two closest points, using the focus value at Z... b slope at Estimate the object distance. For easier understanding, please refer to [link to relevant documentation]. Figure 5 Z is the boundary point between the linear and nonlinear regions.b A schematic diagram for estimating the object distance.

[0087] When the camera moves from the linear region to the non-linear region It is the focus value Zb, the boundary point between the linear and nonlinear intervals calculated by the GZT algorithm; when the camera is initialized in the nonlinear interval, It is the focus value calculated by the focus search algorithm. and These are adjacent focusing values. D n+1 and D n Its focusing value and The object distance values ​​of the two most recent curves. The formula for estimating the object distance at the dividing point is:

[0088]

[0089] Among them, the focus value is in Z b slope at It can be represented as:

[0090]

[0091] The object distance value can be obtained by using the boundary point object distance estimation formula (8). The current zoom value and object distance value are then substituted into the fitting focus surface formula (5) to calculate the F value, which is the focus value. Compared with AZT and IFZT, which use focus search algorithms to obtain focus values, this application can reduce the time required to determine the focus value, making the zoom tracking process smoother. In addition, the object distance is estimated using a geometric method to further obtain the focus value. Since the geometric method only requires one frame of image to estimate the object distance, it can avoid screen stuttering.

[0092] It should be understood that in the nonlinear region, the focusing values ​​for different object distances vary greatly. When the zoom position changes, the image will become blurry without using a zoom tracking algorithm. Therefore, in this embodiment, the camera can predict the next object distance adjustment direction to determine a clearer focusing value (e.g., referred to as the first focusing value), and use a zoom tracking method based on the focus surface to perform zoom tracking in the nonlinear region with the first focusing value.

[0093] For example, the camera can adjust the object distance based on the zoom position of the first frame and the zoom position of the second frame, where the second frame is the frame following the first frame; and adjust the current focus value based on the adjusted object distance to obtain the first focus value. By analyzing the zoom position of the previous and current frames and adaptively adjusting the object distance value, the focus value can be dynamically corrected, minimizing image blur at the telephoto end.

[0094] The zoom position can be represented by the sharpness. The camera adjusts the object distance according to the focusing position of the first frame and the focusing position of the second frame, which comprises adjusting the object distance according to the focusing position of the first frame and the focusing position of the second frame and an adjustment factor, the adjustment factor is determined based on the sharpness value of the first frame and the sharpness value of the second frame, and different adjustment factors correspond to different sharpness value ranges. Since different adjustment factors can be set for different stages of the object distance, the accuracy of the corrected focusing value is improved to avoid blurring of the long focal end as much as possible.

[0095] For example, the camera uses the relationship between the sharpness value FV(Z-1) of the previous frame and the sharpness value FV(Z) of the current frame to predict the next object distance adjustment direction, and the object distance adjustment formula is:

[0096] D i+1 = D i +s×dir (10)

[0097] D i+1 is the object distance value of the next frame, D i is the object distance value of the current frame, s is the adjustment factor, and dir is the adjustment direction. Wherein, the F value of the previous frame is greater than the F value of the current frame, and the object distance direction adjustment formula satisfies formula (11); the F value of the previous frame is less than the F value of the current frame, and the object distance direction adjustment formula satisfies formula (12)

[0098]

[0099]

[0100] s is the size of the self-adaptive adjustment according to the sharpness value, and s has the following four cases:

[0101] (1) When FV(Z)<μ1, and |FV(Z)-FV(Z-1)|>λ1, the adjusted object distance is s=a1;

[0102] (2) When FV(Z)<μ1, and |FV(Z)-FV(Z-1)|<λ1, the adjusted object distance is s=a2.

[0103] (3) When μ1<FV(Z)<μ2, the adjusted object distance is s=a3;

[0104] (4) When FV(Z)>μ2, the adjusted object distance is s=a4;

[0105] Wherein, μ1, μ2, λ1 are the threshold values of adjusting the object distance. After the object distance value D is self-adaptively adjusted according to the above conditions, the F value is calculated by bringing D and Z into the piecewise fitting formula (5).

[0106] The zoom tracking method provided in the embodiments of the present application uses different sampling intervals to collect the focusing curve, reduces the number of collected points, and thus reduces the time for collecting the focusing curve. In the linear region, the sampling interval is larger, which can reduce the data amount of the focusing curve, i.e., reduce the storage space of the focusing curve. In addition, the geometric method is used to estimate the object distance at the demarcation point between the linear region and the nonlinear region, and only one frame of image is needed, which will not cause the lag phenomenon. In the long-focus end, the focusing value is obtained by using the focusing surface and bringing the object distance and the zoom value into the focusing surface formula. Compared with the current method of estimating the focusing value by means of the focusing curve of the near object distance and the focusing curve of the far object distance, the zoom tracking precision of the present application is higher, and the zoom tracking precision can reach within 10 steps.

[0107] The device used to implement the above method in the embodiments of the present application will be described below with reference to the accompanying drawings. Therefore, the content in the foregoing can be used in the subsequent embodiments, and the repeated content will not be described again.

[0108] Please refer to Figure 6 The embodiments of the present application also provide an electronic device for implementing the functions of the above-mentioned various method embodiments. The electronic device at least includes a processing module 620 and a storage module 610.

[0109] The storage module 610 is configured to store the focusing curve sample. The processing module 620 is configured to: acquire the focusing curve sample, and perform surface fitting on the focusing curve sample to obtain a focusing surface model, the focusing surface model including focusing curves of multiple object distances, and the focusing surface model including a linear region and a nonlinear region and a demarcation point; perform zoom tracking according to the GZT for the linear region, and perform zoom tracking using the zoom tracking method based on the focusing surface for the nonlinear region with a first focusing value, wherein the first focusing value is determined according to a first object distance value, and the first object distance value is an object distance value determined at the demarcation point between the linear region and the nonlinear region by using the geometric method.

[0110] In a possible implementation manner, before acquiring the focusing curve sample, the processing module 620 is further configured to:

[0111] perform linear fitting on the collected first focusing curve according to the collected focusing points at the wide-angle end;

[0112] determine the demarcation point between the linear region and the nonlinear region of the first focusing curve according to the first focusing curve and the first focusing curve after linear fitting;

[0113] sample the linear region before the demarcation point at a first interval, and sample the nonlinear region after the demarcation point at a second interval, wherein the first interval is greater than the second interval.

[0114] In a possible implementation manner, before performing zoom tracking using the zoom tracking method based on the focusing surface for the nonlinear region with the first focusing value, the processing module 620 is further configured to:

[0115] a geometric method is used to estimate the first object distance value at the boundary point between the linear region and the nonlinear region;

[0116] The first focus value is determined according to the first object distance value.

[0117] In a possible implementation, the processing module 620 is configured to perform zoom tracking using the focus curve-based zoom tracking method at the first focus value for the nonlinear region, specifically including:

[0118] adjusting the object distance according to the focus position of the first frame and the focus position of the second frame, wherein the second frame is a next frame of the first frame;

[0119] adjusting the current focus value according to the adjusted object distance to obtain the first focus value;

[0120] performing zoom tracking using the focus curve-based zoom tracking method at the first focus value.

[0121] In a possible implementation, adjusting the object distance according to the focus position of the first frame and the focus position of the second frame includes:

[0122] adjusting the object distance according to the focus position of the first frame, the focus position of the second frame, and an adjustment factor, wherein the adjustment factor is determined based on a sharpness value of the first frame and a sharpness value of the second frame, and different adjustment factors correspond to different sharpness value ranges.

[0123] The embodiment of the present application also provides a computer readable storage medium, including instructions, when the instructions are run on a computer, the computer executes the method in the above method examples, and specific reference is made to the detailed description in the method examples, which will not be repeated here.

[0124] The term “plurality” in the embodiment of the present application refers to two or more. The term “and / or” describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that there are three cases of A alone, A and B together, and B alone. In addition, the character “ / ”, if not specially stated, generally represents an “or” relationship between the associated objects before and after it.

[0125] “at least one of” or the like refers to any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b or c can mean a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, and c can be single or multiple.

[0126] In addition, unless otherwise specified, the ordinal numbers "first", "second", etc. mentioned in the embodiments of the present application are used to distinguish the multiple objects, and are not used to represent the size, content, sequence, time sequence, priority or importance of the multiple objects.

[0127] In the embodiments described above, all or some of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or some of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded into and executed by a computer, all or some of the processes or functions according to the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.

[0128] The various illustrative logical blocks, modules, circuits, and algorithms described in connection with the embodiments disclosed herein can be implemented or performed by a general purpose processor, a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. The general purpose processor can be a microprocessor, optionally, the general purpose processor can also be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a digital signal processor core, or any other similar configuration.

[0129] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software executed by a processor, or in a combination of the two. A software can reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium can be coupled to the processor, such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC.

[0130] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart Figure 1 one or more functions specified in the flowchart or multiple interconnected flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowchart or multiple interconnected flowcharts and / or block diagrams.

[0131] Those skilled in the art will appreciate that embodiments of the present application can be devised for a system on chip. Accordingly, embodiments of the present application can be embodied as a method, system, or computer program product. Therefore, embodiments of the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects all generally referred to herein as a "circuit" or "module." Furthermore, embodiments of the present application can take the form of a computer program product on a computer-readable storage medium having computer program code embodied in the medium.

[0132] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart Figure 1 one or more functions specified in the flowchart or multiple interconnected flowcharts and / or block diagrams. Figure 1 one or more functions specified in the flowchart or multiple interconnected flowcharts and / or block diagrams.

[0133] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart Figure 1one or more processes and / or blocks Figure 1 the function(s) specified in the block or blocks.

[0134] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, thus the instructions executed on the computer or other programmable data processing devices provide processes for implementing the flow Figure 1 one or more processes and / or blocks Figure 1 the function(s) specified in the block or blocks.

[0135] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application belong to the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A zoom tracking method, characterized by, The method is applied to a large-magnification camera, and the method comprises: obtaining a focusing curve sample, and performing surface fitting on the focusing curve sample to obtain a focusing surface model, the focusing surface model comprising focusing curves of multiple object distances, the focusing surface model comprising a linear region, a nonlinear region, and a demarcation point; performing zoom tracking according to a geometric zoom tracking method (GZT) for the linear region of the focusing surface model, and performing zoom tracking using a focusing surface-based zoom tracking method with a first focusing value for the nonlinear region of the focusing surface model, wherein the first focusing value is determined according to a first object distance value, and the first object distance value is an object distance value obtained by using a geometric method at the demarcation point between the linear region and the nonlinear region; wherein performing zoom tracking using the focusing surface-based zoom tracking method with the first focusing value for the nonlinear region comprises: adjusting the object distance according to a zoom position of a first frame and a zoom position of a second frame, wherein the second frame is a next frame of the first frame; adjusting the current focusing value according to the adjusted object distance to obtain the first focusing value; performing zoom tracking using the focusing surface-based zoom tracking method with the first focusing value.

2. The method of claim 1, wherein, Before obtaining the focusing curve sample, the method further comprises: performing linear fitting on a first focusing curve collected according to a focus point collected at a wide-angle end; determining a demarcation point between a linear region and a nonlinear region of the first focusing curve according to the first focusing curve and the first focusing curve after linear fitting; sampling at a first interval in the linear region before the demarcation point and sampling at a second interval in the nonlinear region after the demarcation point, wherein the first interval is greater than the second interval.

3. The method of claim 1 or 2, wherein, Before performing zoom tracking using the focusing surface-based zoom tracking method with the first focusing value for the nonlinear region, the method further comprises: at the boundary point Z between the linear region and the non-linear region b estimating the first object distance value using a geometric method determining the first focusing value according to the first object distance value.

4. The method of claim 1, wherein, Adjusting the object distance according to a zoom position of a first frame and a zoom position of a second frame comprises: adjusting the object distance according to the zoom position of the first frame, the zoom position of the second frame, and an adjustment factor, wherein the adjustment factor is determined based on a sharpness value of the first frame and a sharpness value of the second frame, and different adjustment factors correspond to different sharpness value ranges.

5. An electronic device, comprising: The device comprises a processing module and a storage module, wherein the storage module is configured to store a focusing curve sample, and the processing module is configured to: obtain a focusing curve sample, and perform surface fitting on the focusing curve sample to obtain a focusing surface model, the focusing surface model comprising focusing curves of multiple object distances, the focusing surface model comprising a linear region, a nonlinear region, and a demarcation point; perform zoom tracking according to a geometric zoom tracking method (GZT) for the linear region of the focusing surface model, and perform zoom tracking using a focusing surface-based zoom tracking method with a first focusing value for the nonlinear region of the focusing surface model, wherein the first focusing value is determined according to a first object distance value, and the first object distance value is an object distance value obtained by using a geometric method at the demarcation point between the linear region and the nonlinear region; The processing module is configured to use a zoom tracking method based on the focus curve to perform zoom tracking on the nonlinear region at a first focus value, and specifically includes: adjusting the object distance according to the focus position of the first frame and the focus position of the second frame, wherein the second frame is the next frame of the first frame; adjusting the current focus value according to the adjusted object distance to obtain the first focus value; using the zoom tracking method based on the focus curve to perform zoom tracking at the first focus value. 6.The electronic device of claim 5, wherein Before obtaining the focus curve sample, the processing module is further configured to: linearly fit the first focus curve collected according to the focus point collected at the wide-angle end of the camera; determine the demarcation point between the linear region and the nonlinear region of the first focus curve according to the first focus curve and the linearly fitted first focus curve; sample the linear region before the demarcation point at a first interval and sample the nonlinear region after the demarcation point at a second interval, wherein the first interval is greater than the second interval. 7.The electronic device of claim 5 or 6, wherein, Before using the zoom tracking method based on the focus curve to perform zoom tracking on the nonlinear region at the first focus value, the processing module is further configured to: estimate a first object distance value at the demarcation point between the linear region and the nonlinear region using a geometric method; determine the first focus value according to the first object distance value.

8. An electronic device, comprising: The camera comprises a processor and a memory, and the memory is configured to store computer programs or instructions, which, when executed by the processor, cause the camera to perform the method according to any one of claims 1-4.