Method for realizing zoom following of camera equipment, equipment and storage medium

By acquiring and fitting the object distance, focus evaluation value, and operating parameters of the camera device, the object distance is predicted and switched, solving the problems of image blurring and increased focus time in traditional zoom-following algorithms, and realizing efficient sharpness control of the camera device during zooming.

CN121908137APending Publication Date: 2026-04-21ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2025-12-09
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional zoom-following algorithms are prone to causing image blurring and jitter in fast zoom-up scenarios, resulting in decreased image quality and increased focusing time, which limits the full potential of the device.

Method used

By acquiring the object distance, focus evaluation value, and operating parameters of the camera device, coordinate points are formed, the object distance is predicted and switched, the focus evaluation value is recorded, the sharpness parameter curve is fitted, and the difference in the curve is judged to control zoom tracking and ensure image sharpness.

Benefits of technology

It improves the accuracy and reliability of zoom tracking in camera equipment, maintains image clarity during zooming, and optimizes zooming and focusing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908137A_ABST
    Figure CN121908137A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for realizing zoom following of a camera device and a storage medium, and the method comprises the steps: obtaining a first coordinate point of the current camera device at a first object distance, predicting a second object distance of the next switching of the camera device and the position of a zoom motor, a second coordinate point when the camera device is switched to a second object distance, a third coordinate point when the camera device is switched back to the first object distance and a fourth coordinate point when the camera device is switched to the second object distance are sequentially obtained, and all the coordinate points are located in a coordinate system formed by the current zoom motor position and the focusing evaluation value; and fitting to obtain a first definition parameter curve corresponding to the first object distance and a second definition parameter curve corresponding to the second object distance, and determining whether to control zoom following of the camera equipment according to the second object distance according to the difference between the first definition parameter curve and the second definition parameter curve. In this way, the zoom following accuracy and reliability of the camera equipment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera technology, and more specifically to a method, apparatus, and storage medium for implementing zoom tracking of a camera device. Background Technology

[0002] With the development of digitalization, networking, and high-definition in video technology, video equipment with zoom and autofocus functions is becoming increasingly widely used. In recent years, significant technological advancements have been made in the lens technology field. The emergence of new technologies such as DC brushless and voice coil motors has driven continuous improvements in the zoom speed of high-magnification lenses, which places higher demands on the image quality and focusing efficiency of the equipment during the zoom process.

[0003] However, traditional zoom-following algorithms are prone to causing severe image blurring and jitter in fast zoom scenarios, which not only degrades image quality but also significantly increases the actual focusing time, greatly limiting the full potential of the device. Therefore, optimizing the switching method of the zoom-following curve to adapt to the needs of fast zoom and solve the problems of image quality and focusing efficiency has become an urgent technical challenge. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a method, apparatus, and storage medium for implementing zoom tracking of a camera device, thereby improving the accuracy and reliability of curve switching in implementing zoom tracking of a camera device.

[0005] According to an embodiment of the present invention, a method for implementing zoom tracking of a camera device is provided, comprising: The first object distance, the first focus evaluation value, and the first operating parameters of the current camera device are obtained, wherein the current position of the zoom motor and the first focus evaluation value form the first coordinate point in the coordinate system; Predict the second object distance for the next switching of the camera device, and determine the position of the first motor based on the second object distance and the first operating parameters; Based on the position of the first motor, the camera device is controlled to switch to the second object distance, and the current second focus evaluation value is recorded, wherein the current position of the zoom motor and the second focus evaluation value form a second coordinate point in the coordinate system; The camera device is controlled to switch to the first object distance, and the third focus evaluation value and the second operating parameters of the current camera device are recorded, wherein the current position of the zoom motor and the third focus evaluation value form the third coordinate point in the coordinate system; The position of the second motor is determined based on the second object distance and the second operating parameters; Based on the position of the second motor, the camera device is controlled to switch to the second object distance, and the current fourth focus evaluation value is recorded, wherein the current position of the zoom motor and the fourth focus evaluation value form the fourth coordinate point in the coordinate system; A first sharpness parameter curve corresponding to the first object distance is fitted based on the first coordinate point and the third coordinate point, and a second sharpness parameter curve corresponding to the second object distance is fitted based on the second coordinate point and the fourth coordinate point; Based on the difference between the first sharpness parameter curve and the second sharpness parameter curve, determine whether the second sharpness parameter curve meets the preset requirements; If the preset requirements are met, the camera device is controlled to zoom and follow according to the second object distance.

[0006] To solve the above-mentioned technical problems, one technical solution adopted in this application is: to provide a device for realizing zoom tracking of a camera device, comprising: The acquisition module is used to acquire the object distance, operating parameters and focus evaluation value of the camera device, as well as acquire multiple coordinate points in the coordinate system formed by the position of the zoom motor and the focus evaluation value; The calculation module is used to predict the second object distance of the camera device in the next switching, and to determine the position of the first motor based on the second object distance and the first operating parameters, and to determine the position of the second motor based on the second object distance and the second operating parameters; The control module is used to control the camera device to switch to the second object distance and to control the camera device to switch to the first object distance; The processing module is used to fit a first sharpness parameter curve corresponding to a first object distance based on a first coordinate point and a third coordinate point, and to fit a second sharpness parameter curve corresponding to a second object distance based on a second coordinate point and a fourth coordinate point. The judgment module is used to determine whether the second resolution parameter curve meets the preset requirements based on the difference between the first resolution parameter curve and the second resolution parameter curve. The execution module is used to control the camera to zoom and follow according to the second object distance when the second sharpness parameter curve meets the preset requirements.

[0007] To solve the above-mentioned technical problems, one technical solution adopted in this application is to provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the method of implementing zoom tracking of the camera device in the above-mentioned technical solution.

[0008] To solve the above-mentioned technical problems, one technical solution adopted in this application is to provide a computer-readable storage medium for storing a computer program. When the computer program is executed by a processor, it is used to implement the method for implementing zoom tracking of a camera device as described in the above-mentioned technical solution.

[0009] Through the above scheme, this application predicts the second object distance and determines the motor position corresponding to the second object distance based on the current operating parameters. It controls the camera to switch between the first and second object distances, acquires and records the zoom motor position, focus evaluation value, and operating parameters, forms multiple coordinate points, and fits the corresponding sharpness parameter curve. This can truly reflect the change law of sharpness with motor position under different object distances. On this basis, by judging whether the second sharpness parameter curve meets the preset requirements, it can then judge whether the curve used to control zoom following is reliable. Therefore, during the zoom process, the optimal sharpness position under each object distance can be accurately located based on the effective curve, thus maintaining image sharpness throughout the zoom process. Ultimately, this can improve the accuracy and reliability of the camera's zoom following. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart illustrating an embodiment of the method for implementing zoom tracking of a camera device provided in this application; Figure 2 This is a schematic diagram of data transmission of a camera device provided in this application; Figure 3 This is a schematic diagram of a coordinate system formed by the position of a zoom motor and the focus evaluation value provided in this application; Figure 4 This is a flowchart illustrating another embodiment of the method for implementing zoom tracking of a camera device provided in this application; Figure 5 This is a schematic diagram of a coordinate system formed by the position of another zoom motor and the focus evaluation value provided in this application; Figure 6 This is a schematic diagram of a device for implementing zoom tracking of a camera, as provided in this application; Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application; Figure 8 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0011] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the application. Similarly, the following embodiments are only some, not all, embodiments of the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.

[0012] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0013] It should be noted that the terms "first," "second," etc., used in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0014] The imaging device described in this application is an imaging device with automatic zoom and focus functions, which can be an integrated camera or a PTZ camera, etc. This imaging device includes a zoom lens, a zoom motor, a focusing lens, a focusing motor, and a control unit. The zoom lens is used to adjust the focal length to achieve image scaling and is the core optical component for switching between different object distances. The zoom motor is linked to the zoom lens, and its operating position directly reflects the current state of the zoom lens. The focusing lens is responsible for adjusting the focus sharpness, and its state is directly related to the focus evaluation value, determining whether the image is sharp. The focusing motor drives the focusing lens to adjust the focus, optimizing the focus evaluation value by changing its operating state; it is the core execution component for achieving sharp zoom. The control unit, such as the focus control module, receives parameters such as the zoom motor position and the focus evaluation value, executes object distance switching logic, curve fitting, and judgment operations, and coordinates the various components to complete the control process in the solution.

[0015] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the method for implementing zoom tracking with a camera device provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily replace it with a similar method. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes: S110: Obtain the first object distance, first focus evaluation value, and first operating parameters of the current camera device.

[0016] Object distance is the distance from the subject to the optical center of the camera lens. The first object distance is the current object distance state of the camera device and serves as a reference value for subsequent object distance switching (such as switching to the second object distance).

[0017] The focus evaluation value (FV value) is a quantitative measure of image focus sharpness derived from image algorithm analysis of the image captured by the camera. A higher FV value directly reflects the current focus state; a higher value indicates sharper details and stronger contrast, meaning more precise focus. Conversely, a lower value indicates a blurry image and inaccurate focus. The first focus evaluation value is the quantitative result of the image sharpness captured by the device at the current object distance.

[0018] Operating parameters refer to the technical parameters related to the operation of core components of the camera equipment in its current working state. They reflect the real-time operating status of the equipment and include, but are not limited to, the frame rate, zoom motor speed and position, and focus motor speed and position of the camera equipment. The first operating parameter includes the frame rate of the camera equipment at the current first object distance, the speed of the zoom motor in the current camera equipment, and the speed of the focus motor.

[0019] This application obtains data transmission of various parameters of the camera device, such as... Figure 2 As shown, Figure 2 This is a schematic diagram of data transmission of a camera device provided in this application. The focus control module is the core decision-making unit of the lens focusing system. Its core function is to achieve precise control of lens focusing by integrating the hardware status information of the motor and the image quality information of the ISP (Image Signal Processor).

[0020] The system acquires the first object distance, the first focus evaluation value, and the first operating parameters of the current camera device, wherein the current position of the zoom motor and the first focus evaluation value form a first coordinate point in the coordinate system. For example, please refer to [link to example]. Figure 3 , Figure 3This is a schematic diagram of a coordinate system formed by the position of a zoom motor and a focus evaluation value, as provided in this application. As shown in the figure, a two-dimensional coordinate system is established with the current position of the zoom motor as the horizontal axis and the focus evaluation value as the vertical axis. This coordinate system can intuitively record the correspondence between zoom state and sharpness. The current position of the zoom motor and the first focus evaluation value are recorded to form the first coordinate point in the coordinate system, such as... Figure 3 Point ① shown.

[0021] S120: Predict the second object distance for the next switching of the camera equipment, and determine the position of the first motor based on the second object distance and the first operating parameters.

[0022] The second object distance refers to the predicted distance between the target object that the camera needs to switch to next. It is the next target distance relative to the first object distance (the current distance between the device and the target) that has already been acquired.

[0023] The first motor position refers to the target position that the zoom motor needs to be adjusted to in order to switch the camera device to the second object distance. The first motor position includes the position of the zoom motor and the position of the focus motor.

[0024] In one embodiment, if the second object distance for predicting the next switching of the camera device is performed for the first time, the second object distance can be determined based on historical experience or by human setting.

[0025] In one embodiment, if the prediction of the second object distance for the next camera switch is not performed for the first time, the prediction of the second object distance for the next camera switch can be based on the separation of the sharpness parameter curve corresponding to the second object distance switched to in the previous round.

[0026] In one embodiment, after obtaining the second object distance and the first operating parameters, the position of the first motor is determined based on the second object distance and the first operating parameters. In another embodiment, the position of the zoom motor in the first motor position is determined based on the speed of the zoom motor in the first operating parameters, the frame rate of the camera device in the first operating parameters, and the current position of the zoom motor. For example, a first ratio of the speed of the zoom motor to the frame rate of the camera device in the first operating parameters is calculated, and the sum of the first ratio and the current position of the zoom motor is calculated to obtain the position of the zoom motor in the first motor position.

[0027] In one embodiment, the position of the focusing motor in the first motor position is determined based on the second object distance and the position of the zoom motor in the first motor position. For example, the position of the focusing motor in the first motor position is determined through a preset mapping relationship based on the second object distance, the position of the zoom motor in the first motor position, and the position of the zoom motor. The preset mapping relationship can refer to the correspondence between "object distance - zoom motor position - focusing motor position" established through numerous experiments during the equipment's factory calibration or debugging phase, and can be represented by a data table or function model, etc.

[0028] In camera equipment, the zoom motor and focus motor need to work together; that is, when the object distance changes, the zoom motor will adjust the focus accordingly. In this embodiment, the target position of each motor when switching object distances is determined based on the motor speed, frame rate, and object distance. Since the frame rate can determine the fixed time interval of each frame, the target position that the zoom motor and focus motor must reach within the same frame time is calculated by combining the fixed time interval with the respective speeds of the zoom motor and focus motor. Thus, even if the inherent speeds of the zoom motor and focus motor are different, the movement progress of each motor can be unified, thereby achieving a speed-adaptive zoom process and clear and continuous images throughout the zoom process. Therefore, it can effectively avoid the situation where the zoom motor and focus motor are out of sync due to different types or other reasons, resulting in the inability of the two to work together to complete the dynamic adjustment of focus in real time during zoom, which would lead to problems such as defocusing, stuttering, or adaptation delays in the image during zoom.

[0029] S130: Based on the position of the first motor, control the camera to switch to the second object distance and record the current second focus evaluation value.

[0030] After obtaining the target positions of the zoom motor and the focus motor in the first motor position, the control unit of the camera equipment can send drive commands to the zoom motor and the focus motor according to the target positions of the zoom motor and the focus motor. The zoom motor adjusts the focal length of the zoom lens according to the set position, so that the optical system of the equipment switches to the field of view corresponding to the second object distance. At the same time, the focus motor moves to the corresponding position to complete the initial focus adjustment at the second object distance, so that the camera equipment physically reaches the shooting state at the second object distance.

[0031] Once the camera stabilizes at the second object distance, the system acquires the current image in real time and calculates the second focus evaluation value using a sharpness algorithm. This second focus evaluation value reflects the actual sharpness state of the camera at the second object distance under the position control of the first motor. The current position of the zoom motor (i.e., the target position of the zoom motor in the first motor position) and the second focus evaluation value form a second coordinate point in the coordinate system, such as... Figure 3 Point ② shown.

[0032] S140: Control the camera device to switch to the first object distance, and record the current third focus evaluation value and the second operating parameters of the camera device.

[0033] After controlling the camera to switch back to the first object distance, record the current third focus evaluation value and the second operating parameters of the camera. Also, record the third coordinate point in the coordinate system formed by the current position of the zoom motor and the third focus evaluation value, such as... Figure 3 Point ③ is shown. The second operating parameters include the frame rate of the current camera device after switching to the first object distance, the speed of the zoom motor in the current camera device, and the speed of the focus motor.

[0034] S150: Determine the position of the second motor based on the second object distance and the second operating parameters.

[0035] After obtaining the second operating parameters, the position of the second motor is determined based on the second object distance and the second operating parameters. The position of the second motor includes the position of the zoom motor and the position of the focusing motor.

[0036] In one embodiment, the position of the zoom motor in the second motor position is determined based on the speed of the zoom motor, the frame rate of the camera device, and the current position of the zoom motor in the second operating parameters. For example, a second ratio of the zoom motor speed to the frame rate of the camera device in the second operating parameters is calculated, and the sum of this second ratio and the current position of the zoom motor is calculated to obtain the position of the zoom motor in the second motor position.

[0037] In one embodiment, the position of the focusing motor in the second motor position is determined based on the second object distance and the position of the zoom motor in the second motor position. For example, the position of the focusing motor in the second motor position is determined through a preset mapping relationship based on the second object distance and the position of the zoom motor in the second motor position.

[0038] S160: Based on the position of the second motor, control the camera to switch to the second object distance and record the current fourth focus evaluation value.

[0039] After calculating the positions of the zoom motor and focus motor in the second motor position, the camera is switched to the second object distance, and the fourth focus evaluation value is recorded at this time. The fourth coordinate point in the coordinate system formed by the current zoom motor position and the fourth focus evaluation value is also recorded, such as... Figure 3 Point ④ shown.

[0040] S170: Fit the first sharpness parameter curve corresponding to the first object distance based on the first coordinate point and the third coordinate point, and fit the second sharpness parameter curve corresponding to the second object distance based on the second coordinate point and the fourth coordinate point.

[0041] The sharpness parameter curve is a relationship curve fitted based on multiple sets of coordinate points of "zoom motor position - focus evaluation value". The horizontal axis represents the position of the zoom motor, and the vertical axis represents the focus evaluation value at the corresponding position. The sharpness parameter curve visually presents the sharpness variation pattern of the zoom lens at different positions under a specific object distance. For example, the first sharpness parameter curve corresponding to the first object distance can clearly identify the positions of the zoom motor at that object distance to achieve high image sharpness, providing data basis for precise control of zoom tracking and maintaining sharpness throughout the entire zoom range.

[0042] Through the aforementioned steps, at least two observation points (i.e., the first and third coordinate points) at the first object distance and two observation points (i.e., the second and fourth coordinate points) at the second object distance can be obtained in the "zoom motor position-focus evaluation value coordinate system". Therefore, sharpness parameter curves corresponding to the first and second object distances can be fitted based on the observation points in the coordinate system. It should be noted that in other embodiments, to further improve the fitting accuracy of the sharpness parameter curves, multiple observation points can be obtained at each specific object distance; the number of observation points is not limited here.

[0043] In one embodiment, based on the first coordinate point and the third coordinate point, a Bayesian proximity fitting is performed using a preset model to obtain the first sharpness parameter curve corresponding to the first object distance; based on the second coordinate point and the fourth coordinate point, a Bayesian proximity fitting is performed using a preset model to obtain the second sharpness parameter curve corresponding to the second object distance.

[0044] The preset model is a predefined function model that conforms to the unimodal characteristics of the sharpness curve. For example, it can be a quadratic function, a Gaussian function, or a linear model structure y=ax+b+c or a quadratic model y=ax. 2 +bx+c, without explicit limitation, can be set according to actual needs. Bayesian fitting is a curve fitting method based on Bayesian inference. The core logic is to use the prior information of the preset model (such as the coefficient range of the quadratic function) and the likelihood information of the observation coordinate points, and estimate the model parameters by calculating the posterior probability distribution so that the fitted curve is both close to the observation point and conforms to the unimodal characteristics of the preset model.

[0045] By using Bayesian proximity fitting, and with a small number of coordinate points and a pre-set model, sharpness parameter curves at different object distances can be obtained quickly. This allows the optimal focus position to be located by the peak value of the sharpness parameter curve, providing a basis for fast focusing and zoom coordination.

[0046] S180: Based on the difference between the first sharpness parameter curve and the second sharpness parameter curve, determine whether the second sharpness parameter curve meets the preset requirements.

[0047] After obtaining the first sharpness parameter curve corresponding to the first object distance and the second sharpness parameter curve corresponding to the second object distance through fitting, it can be determined whether the second sharpness parameter curve meets the preset requirements by judging the difference between the second sharpness parameter curve and the first sharpness parameter curve. The separation between the two curves can be used as a quantified value of the curve difference. The preset requirement can be set to a separation greater than a preset separation threshold, or it can be set to a separation reaching a certain preset value as a standard condition.

[0048] In one embodiment, the separation degree between the first sharpness parameter curve and the second sharpness parameter curve is calculated. If the separation degree is greater than a preset separation degree threshold, the second sharpness parameter curve is determined to meet a preset requirement. The separation degree is positively correlated with the distance between the first sharpness parameter curve and the second sharpness parameter curve.

[0049] In one embodiment, the resolution can be calculated by calculating the integral difference of the overlapping area of ​​the first and second resolution parameter curves in the position dimension of the zoom motor. Specifically, the calculation method can be as follows: determine the overlapping area of ​​the area formed by the first and third coordinate points in the position dimension of the zoom motor and the area formed by the second and fourth coordinate points in the position dimension of the zoom motor. Within the overlapping area, integrate the first and second resolution parameter curves respectively to obtain the first integral value and the second integral value. Calculate the difference between the first integral value and the second integral value to obtain the resolution.

[0050] In one embodiment, the separation degree can also be calculated as follows: separation degree = 1 - (motor position at object distance A - motor position at infinity) / (motor position at object distance B - motor position at infinity), where object distance B < object distance A, that is, B is closer, such as B = 3m and A = 10m.

[0051] S190: If the preset requirements are met, the camera device will be controlled to zoom and follow according to the second object distance.

[0052] If the second sharpness parameter curve meets the preset requirements, it means that the second sharpness parameter curve corresponding to the second object distance can reliably reflect the focusing characteristics under the second object distance, thus determining that the predicted second object distance is more accurate and close to the real object distance. Therefore, the camera equipment can be controlled to achieve zoom tracking based on the second object distance.

[0053] In one embodiment, in response to the second sharpness parameter curve not meeting the preset requirements, the process returns to the step of obtaining the first object distance, the first focus evaluation value, and the first operating parameters of the current camera device, and re-predicts the second object distance for the next switching of the camera device based on the separation degree calculated in the previous round.

[0054] In one embodiment, in response to the second sharpness parameter curve not meeting the preset requirements, a switching step size is determined based on the difference between the first sharpness parameter curve and the second sharpness parameter curve, and a second object distance is determined based on the first object distance and the switching step size.

[0055] In one example, assuming the current system operates based on the focus motor position-resolution parameter curve corresponding to a 10-meter object distance, the optimal focus motor position for a 10-meter object distance is 100 steps under the current zoom state. To quantify the distinguishing ability of different object distances, the separation can be calculated using the separation formula: Separation = 1 - (10-meter focus motor position - infinity focus motor position) / (3-meter focus motor position - infinity focus motor position). If we set the infinity focus motor position to 50 steps and the 3-meter object distance to 200 steps, then substituting, we get: Separation = 1 - (100 - 50) / (200 - 50) ≈ 66.7%. When the separation reaches a preset threshold, such as 30%, it indicates that the difference between 10 meters and other object distances is sufficiently significant, i.e., the distinguishing ability is reliable. At this point, if it is necessary to adjust from a 10-meter object distance to a 20-meter object distance, and the total travel of the focus motor between the two is 10 steps, the switching step size can be calculated using "total travel × separation", i.e., 10 steps × 66.7% ≈ 7 steps.

[0056] In this way, the reliability of the object distance difference is quantified by the separation degree. That is, the higher the separation degree, the clearer the object distance distinction, and the larger the switching step size can be, while taking into account the adjustment efficiency. If the separation degree does not reach the threshold (such as 20%), a smaller switching step size is used to test, so as to avoid over-adjustment due to insufficient distinction, and finally achieve precise and efficient adjustment of the focusing motor position.

[0057] Please see Figure 4 , Figure 4 This is a flowchart illustrating another embodiment of the method for implementing zoom tracking with a camera device provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 4 The illustrated process sequence is limited. For example... Figure 4 As shown, this embodiment includes: S201: Obtain motor information and first focus evaluation value at the current object distance.

[0058] Record the speed and position of the zoom motor and the focus motor at the current object distance, and obtain the current frame rate of the camera device and the first focus evaluation value of the currently captured image.

[0059] Please see Figure 5 , Figure 5 This is a schematic diagram of a coordinate system formed by the position of another zoom motor and the focus evaluation value provided in this application. For example... Figure 5 As shown, a two-dimensional coordinate system is established with the position of the zoom motor as the horizontal axis and the focus evaluation value as the vertical axis, and the first coordinate point ① formed by the current zoom position Z1 and the first focus evaluation value FV1 in the coordinate system is obtained.

[0060] S202: Calculate the position of each motor at the target object distance and control the camera equipment to switch to the target object distance.

[0061] If the motor positions for the target object distance are being calculated for the first time, the target object distance to be switched is determined based on preset experience. If the motor positions for the target object distance are not being calculated for the first time, the target object distance to be switched is determined based on the separation of the sharpness parameter curve corresponding to the target object distance in the previous round.

[0062] The positions of each motor at the target object distance are calculated based on the zoom motor speed and position at the current object distance and the frame rate of the camera. For example, assuming the current object distance is Dis1, the camera frame rate is frameRate, the zoom motor position at the current object distance is Zst, and the zoom motor speed is V... zoom Then the positions of each motor corresponding to the target object distance Dis2 can be calculated by the following formulas (1) and (2), where Znext is the target position of the variable zoom motor when it switches to the target object distance, and Fnext is the target position of the focusing motor when it switches to the target object distance, which is obtained through a preset mapping relationship.

[0063] Znext = V zoom / frameRate + Zst(1) Fnext = Dis2(Znext)(2) The camera device is controlled to switch to the target object distance based on the target position of the zoom motor and the focus motor, so as to obtain the second focus evaluation value FV2 when switching to the target object distance for the first time.

[0064] S203: Obtain the second focus evaluation value when switching to the target object distance for the first time, and control the camera to switch back to the original object distance.

[0065] After controlling the camera device to switch to the target object distance, obtain the second focus evaluation value of the image captured by the camera device when it first switches to the target object distance, in order to obtain... Figure 5 The second coordinate point ② is formed by the current zoom position Z2 and the second focus evaluation value FV2 in the coordinate system shown.

[0066] Control the camera to switch back to the original object distance to obtain information about each motor and image quality when switching back to the original object distance.

[0067] S204: Obtain the third focus evaluation value when switching back to the original object distance, calculate the position of each motor when switching to the target object distance for the second time, and control the camera device to switch to the target object distance again.

[0068] Obtain the third focus evaluation value of the image captured by the camera when switching back to the original object distance, in order to obtain Figure 5 The third coordinate point ③ is formed by the current zoom position Z3 and the third focus evaluation value FV3 in the coordinate system shown.

[0069] Record the frame rate, zoom motor speed and position, and focus motor speed and position when the recording device switches back to the original object distance. Similarly, use the above formulas (1) and (2) to calculate the zoom motor position and focus motor position when switching to the target object distance for the second time, and control the camera device to switch to the target object distance for the second time based on the information of each motor.

[0070] S205: Obtain the fourth focus evaluation value when switching to the target object distance for the second time.

[0071] After the camera is switched back to the target distance, the fourth focus evaluation value is obtained when the camera is switched back to the target distance for the second time, in order to obtain... Figure 5 The fourth coordinate point ④ is formed by the current zoom position Z4 and the fourth focus evaluation value FV4 in the coordinate system shown.

[0072] S206: Select an appropriate model to perform Bayesian fitting on the two sets of object distance data.

[0073] In this embodiment, a quadratic model is selected to perform Bayesian fitting on the two sets of zoom motor position-focus evaluation values ​​for both the original object distance and the target object distance. For example, a Bayesian proximity fit is performed on the first coordinate point ① and the third coordinate point ③ of the original object distance to obtain the first sharpness parameter curve for the original object distance (e.g., ...). Figure 5 The black solid line in the figure represents the curve); Bayesian proximity fitting is performed on the two data points of the target object distance, the second coordinate point ② and the fourth coordinate point ④, to obtain the second sharpness parameter curve of the target object distance (as shown in the figure). Figure 5 (The gray dashed line in the image represents the curve). Where, it is assumed... Figure 5 The solid gray line represents the sharpness parameter curve of the true object distance. The closer the second sharpness parameter curve of the target object distance is to the sharpness parameter curve of the true object distance, the closer the target object distance is to the true object distance.

[0074] S207: Determine whether the separation of the second sharpness parameter curve for the target object distance meets the standard.

[0075] Calculate the separation of the second sharpness parameter curve for the target object distance and determine whether the separation of the curve meets the standard. In response to the separation not meeting the standard, execute step S208 to further calculate the integral difference between the second sharpness parameter curve and the first sharpness parameter curve in the overlapping area of ​​the zoom motor position dimension (i.e., the area formed by the curves from Z2 to Z3). The integral difference can be used as the basis for judging whether the tangent curve is correct, thereby confirming the direction of the next tangent curve, so as to re-predict the target object distance until the separation of the second sharpness parameter curve formed by the target object distance meets the standard.

[0076] In response to the resolution meeting the target, step S209 is executed to stop the tangent curve, so as to control the camera device to perform variable zoom tracking based on the target object distance.

[0077] S208: Calculate the integral difference between the second resolution parameter curve and the first resolution parameter curve in the overlapping area of ​​the variable zoom motor position dimension, and confirm the direction of the next curve cutting.

[0078] The purpose of integral difference calculation is to quantify the overall trend difference between two curves in the overlapping region, and its sign (positive / negative) directly reflects the correctness of the direction.

[0079] If the integral difference is greater than zero, within the overlapping area, the cumulative focus evaluation value of the second sharpness parameter curve is higher than that of the first sharpness parameter curve. That is, when adjusting along the direction from Z2 to Z3 (i.e., the position of the zoom motor increases), the overall sharpness of the target object distance is better. If the actual object distance direction is close to the target object distance, then this direction is the correct direction of the tangent curve.

[0080] If the integral difference is less than zero, within the overlapping area, the cumulative focus evaluation value of the second sharpness parameter curve is lower than that of the first sharpness parameter curve. That is, when adjusting along the direction from Z2 to Z3 (i.e., the position of the zoom motor increases), the overall sharpness of the target object distance deteriorates, and it is necessary to adjust in the opposite direction, i.e., the opposite direction is the "correct direction of the tangent curve".

[0081] After confirming the direction of the next cutting curve, return to step S201 and predict the target object distance for the next switch based on the separation, until the separation of the second sharpness parameter curve formed by the target object distance meets the standard.

[0082] In this embodiment, the integral difference is used to quantify the "cumulative sharpness difference" of two curves in the overlapping area, avoiding the interference of single-point noise. It can reliably reflect whether the adjustment direction makes the overall imaging quality of the target curve (such as the second sharpness parameter curve) better. The core logic of using the integral difference as the judgment of whether the tangent curve is correct is: if the integral difference is positive, the current direction is correct; if it is negative, the opposite direction is correct. This directly guides the direction adjustment of the next tangent curve, ensuring that the system continuously approaches the clear imaging of the true object distance.

[0083] S209: End.

[0084] Stop cutting the curve and control the camera to perform variable zoom tracking based on the target object distance.

[0085] This embodiment predicts the second object distance and determines the motor position corresponding to the second object distance based on the current operating parameters. It controls the camera to switch between the first and second object distances, acquires and records the zoom motor position, focus evaluation value, and operating parameters, forms multiple coordinate points, and fits the corresponding sharpness parameter curve. This allows it to truly reflect the change in sharpness with the motor position at different object distances. Based on this, it judges whether the second sharpness parameter curve meets the preset requirements, and then judges whether the curve used to control zoom tracking is reliable. Therefore, during zooming, the optimal sharpness position at each object distance can be accurately located based on the effective curve, thus maintaining image sharpness throughout the zoom process. Ultimately, this improves the accuracy and reliability of the camera's zoom tracking.

[0086] Please see Figure 6 , Figure 6 This is a schematic diagram of a device for implementing zoom tracking of a camera, as provided in this application, specifically including: The acquisition module is used to acquire the object distance, operating parameters and focus evaluation value of the camera device, as well as acquire multiple coordinate points in the coordinate system formed by the position of the zoom motor and the focus evaluation value; The calculation module is used to predict the second object distance of the camera device in the next switching, and to determine the position of the first motor based on the second object distance and the first operating parameters, and to determine the position of the second motor based on the second object distance and the second operating parameters; The control module is used to control the camera device to switch to the second object distance and to control the camera device to switch to the first object distance; The processing module is used to fit a first sharpness parameter curve corresponding to a first object distance based on a first coordinate point and a third coordinate point, and to fit a second sharpness parameter curve corresponding to a second object distance based on a second coordinate point and a fourth coordinate point. The judgment module is used to determine whether the second resolution parameter curve meets the preset requirements based on the difference between the first resolution parameter curve and the second resolution parameter curve. The execution module is used to control the camera to zoom and follow according to the second object distance when the second sharpness parameter curve meets the preset requirements.

[0087] Please see Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 60 includes a memory 61 and a processor 62 connected to each other. The memory 61 is used to store a computer program. When the computer program is executed by the processor 62, it is used to implement the method of implementing zoom tracking of the camera device in the above embodiment.

[0088] The methods described in the above embodiments can exist in the form of a computer program; therefore, this application proposes a computer-readable storage medium. Please refer to [link / reference needed]. Figure 8 , Figure 8 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 80 is used to store a computer program 81, which can be executed to implement the method for implementing zoom tracking of a camera device in the above embodiment.

[0089] The computer-readable storage medium 80 can be any medium capable of storing program code, such as a server, USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0090] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for achieving zoom tracking with a camera device, characterized in that, The method includes: The first object distance, the first focus evaluation value, and the first operating parameters of the current camera device are obtained, wherein the current position of the zoom motor and the first focus evaluation value form the first coordinate point in the coordinate system; Predict the second object distance for the next switching of the camera device, and determine the position of the first motor based on the second object distance and the first operating parameters; Based on the position of the first motor, the camera device is controlled to switch to the second object distance, and the current second focus evaluation value is recorded, wherein the current position of the zoom motor and the second focus evaluation value form a second coordinate point in the coordinate system; The camera device is controlled to switch to the first object distance, and the current third focus evaluation value and second operating parameters of the camera device are recorded, wherein the current position of the zoom motor and the third focus evaluation value form a third coordinate point in the coordinate system; The position of the second motor is determined based on the second object distance and the second operating parameters; Based on the position of the second motor, the camera device is controlled to switch to the second object distance, and the current fourth focus evaluation value is recorded, wherein the current position of the zoom motor and the fourth focus evaluation value form the fourth coordinate point in the coordinate system; A first sharpness parameter curve corresponding to the first object distance is fitted based on the first coordinate point and the third coordinate point, and a second sharpness parameter curve corresponding to the second object distance is fitted based on the second coordinate point and the fourth coordinate point; Based on the difference between the first sharpness parameter curve and the second sharpness parameter curve, determine whether the second sharpness parameter curve meets the preset requirements; If the preset requirements are met, the camera device is controlled to zoom and follow according to the second object distance.

2. The method according to claim 1, characterized in that, Both the first operating parameter and the second operating parameter include the frame rate of the current camera device, the speed of the zoom motor and the speed of the focus motor in the current camera device.

3. The method according to claim 2, characterized in that, The first motor position includes the position of the zoom motor and the position of the focusing motor; Determining the position of the first motor based on the second object distance and the first operating parameters includes: The position of the zoom motor in the first motor position is determined based on the speed of the zoom motor in the first operating parameters, the frame rate of the camera device in the first operating parameters, and the current position of the zoom motor; The position of the focusing motor in the first motor position is determined based on the second object distance and the position of the zoom motor in the first motor position.

4. The method according to claim 3, characterized in that, The step of determining the position of the zoom motor in the first motor position based on the speed of the zoom motor in the first operating parameters, the frame rate of the camera device in the first operating parameters, and the current position of the zoom motor includes: Calculate the first ratio between the speed of the variable-magnification motor in the first operating parameters and the frame rate of the camera device in the first operating parameters; Calculate the sum of the first ratio and the current position of the variable-magnification motor to obtain the position of the variable-magnification motor in the first motor position; And, determining the position of the focusing motor in the first motor position based on the second object distance and the position of the zoom motor in the first motor position includes: Based on the second object distance and the position of the zoom motor in the first motor position, the position of the focusing motor in the first motor position is determined through a preset mapping relationship.

5. The method according to claim 1, characterized in that, The step of fitting the first sharpness parameter curve corresponding to the first object distance based on the first coordinate point and the third coordinate point includes: Based on the first coordinate point and the third coordinate point, and using a preset model to perform Bayesian proximity fitting, the first sharpness parameter curve corresponding to the first object distance is obtained. And, the step of fitting the second sharpness parameter curve corresponding to the second object distance based on the second coordinate point and the fourth coordinate point includes: Based on the second coordinate point and the fourth coordinate point, and using a preset model to perform Bayesian proximity fitting, the second sharpness parameter curve corresponding to the second object distance is obtained.

6. The method according to claim 1, characterized in that, The step of determining whether the second sharpness parameter curve meets the preset requirements based on the difference between the first sharpness parameter curve and the second sharpness parameter curve includes: Calculate the separation between the first sharpness parameter curve and the second sharpness parameter curve, wherein the separation is positively correlated with the distance between the first sharpness parameter curve and the second sharpness parameter curve; In response to the resolution being greater than a preset resolution threshold, it is determined that the second sharpness parameter curve meets the preset requirements.

7. The method according to claim 6, characterized in that, The calculation of the separation between the first sharpness parameter curve and the second sharpness parameter curve includes: Determine the overlapping area between the region formed by the first coordinate point and the third coordinate point on the position dimension of the zoom motor and the region formed by the second coordinate point and the fourth coordinate point on the position dimension of the zoom motor; Within the overlapping region, the first sharpness parameter curve and the second sharpness parameter curve are integrated respectively to obtain a first integral value and a second integral value; The difference between the first integral value and the second integral value is calculated to obtain the separation degree.

8. The method according to claim 1, characterized in that, The method further includes: In response to the second sharpness parameter curve not meeting the preset requirements, the process returns to the step of obtaining the first object distance, first focus evaluation value and first operating parameters of the current camera device, and re-predicts the second object distance for the next switching of the camera device; And / or, the method further includes: In response to the second sharpness parameter curve not meeting the preset requirements, the switching step size is determined based on the difference between the first sharpness parameter curve and the second sharpness parameter curve; And, the prediction of the second object distance for the next switching of the camera device includes: The second object distance is determined based on the first object distance and the switching step size.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the processor being coupled to the memory, the processor being configured to perform one or more steps of the method for implementing zoom tracking of a camera device as described in any one of claims 1 to 8 based on instructions stored in the memory.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the steps of the method for implementing zoom tracking of a camera device as described in any one of claims 1 to 8.