Zoom curve fitting method and device, storage medium and electronic equipment
By obtaining the sampling points with equal pitch distribution under high-magnification lens, determining the target fixed parameters and object distance parameter formulas of the zoom curve, building the conversion formula between the zoom motor and the zoom motor, solving the time-consuming and labor-intensive problem of the zoom curve fitting, improving the improvement of the improvement of the zoom curve. The zoom efficiency and image clarity of the image acquisition device are achieved.
Patent Information
- Application Number
- CN202411427794.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The prior art is time-consuming and labor-intensive to fit the zoom curve under a high-magnification lens, and has low accuracy, resulting in the image acquisition device being easily blurred during the zooming process and requiring a large storage capacity.
By obtaining sampling points with equally spaced distribution, determine the target fixed parameters and object distance parameter formulas of the zoom curve, build a conversion formula between the target variable motor coordinates and the zoom motor coordinates, reversely calculate the target object distance to guide focus, reduce sampling time, and improve the Fitting efficiency.
On the premise of ensuring the accuracy of the zoom curve, the time for fitting the zoom curve is significantly shortened, the fitting efficiency is improved, and the demand for storage capacity is reduced.
Smart Images

Figure CN118938432A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of images, and in particular to a zoom curve fitting method, device, storage medium and electronic equipment. Background Art
[0002] With the advancement of high-definition video, image processing, and video surveillance technologies, users are demanding increasingly higher image quality and lens magnification. During image acquisition, the zoom curve (also known as the AF curve or focus curve) is used to guide focus. The accuracy of the zoom curve directly affects image clarity. If the zoom curve is too inaccurate, it will result in large errors and compromise image quality. Therefore, ensuring the accuracy of the zoom curve is crucial.
[0003] However, as the lens magnification increases, fitting the zoom curve becomes very difficult, resulting in a time-consuming and labor-intensive process, low fitting accuracy, and large errors in the zoom curve. This in turn causes the image to become blurred during the zoom process of the image acquisition device. Summary of the Invention
[0004] An object of the present invention is to provide a zoom curve fitting method, device, storage medium and electronic device to at least partially improve the above-mentioned problem.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a zoom curve fitting method, the method comprising: Obtain an i-th sampling set corresponding to an i-th object distance, wherein the sampling set includes J sampling points, the sampling points include the coordinates of the zoom motor and the corresponding zoom motor coordinates, and the J zoom motor coordinates are evenly spaced, 1≤i≤I, and I≥3; determining a target fixed parameter of a zoom curve and an object distance parameter formula based on the i-th sampling set, wherein the object distance parameter formula is a conversion formula between the object distance and an object distance-related parameter in the zoom curve; Constructing a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameters and the object distance parameter formula; Determining a target object distance based on the estimated zoom motor coordinates corresponding to the target zoom motor coordinates and a conversion formula between the object distance and the zoom motor coordinates; A target zoom curve corresponding to the target object distance is constructed based on the object distance parameter formula, the target fixed parameter, and the target object distance, and the target zoom curve is used to guide focusing when the target object distance is reached.
[0006] In a second aspect, the present invention provides a zoom curve fitting device, comprising: A first processing unit is configured to obtain an i-th sampling set corresponding to an i-th object distance, wherein the sampling set includes J sampling points, each of which includes a zoom motor coordinate and a corresponding zoom motor coordinate, and the J zoom motor coordinates are evenly spaced, 1≤i≤I, and I≥3; The first processing unit is further configured to determine a target fixed parameter of the zoom curve and an object distance parameter formula based on the i-th sampling set, wherein the object distance parameter formula is a conversion formula between the object distance and an object distance-related parameter in the zoom curve; The first processing unit is further configured to construct a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameter and the object distance parameter formula; The first processing unit is further configured to determine the target object distance based on the estimated zoom motor coordinates corresponding to the target zoom motor coordinates and a conversion formula between the object distance and the zoom motor coordinates; The second processing unit is configured to construct a target zoom curve corresponding to a target object distance based on the object distance parameter formula, the target fixed parameter, and the target object distance, wherein the target zoom curve is used to guide focusing at the target object distance.
[0007] In a third aspect, the present invention provides a storage medium having a computer program stored thereon, which implements the above method when executed by a processor.
[0008] In a fourth aspect, the present invention provides an electronic device comprising: a processor and a memory, wherein the memory is used to store one or more programs; when the one or more programs are executed by the processor, the above method is implemented.
[0009] Compared with the prior art, the present invention provides a zoom curve fitting method, device, storage medium and electronic device, which obtain the i-th sampling set corresponding to the i-th object distance, wherein the sampling set includes J sampling points, and the sampling points include the magnification motor coordinates and the corresponding zoom motor coordinates, and the J magnification motor coordinates are evenly spaced, 1≤i≤I, I≥3; based on the i-th sampling set, the target fixed parameters and object distance parameter formula of the zoom curve are determined, wherein the object distance parameter formula is a conversion formula between the object distance and the object distance associated parameters in the zoom curve; based on the target fixed parameters and the object distance parameter formula, a conversion formula between the object distance and the zoom motor coordinates corresponding to the target magnification motor coordinates is constructed; based on the zoom motor estimated coordinates corresponding to the target magnification motor coordinates and the object distance and zoom motor coordinate conversion formula, the target object distance is determined; based on the object distance parameter formula, the target fixed parameters and the target object distance, a target zoom curve corresponding to the target object distance is constructed, and the target zoom curve is used to guide focusing when at the target object distance. Based on limited object distance sampling, the target object distance can be inversely calculated to obtain the corresponding target zoom curve. While ensuring the accuracy of the target zoom curve, the sampling time is greatly reduced and the fitting efficiency is improved.
[0010] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0012] Figure 1 A schematic structural diagram of an electronic device provided by an embodiment of the present invention.
[0013] Figure 2 This is a flow chart of a zoom curve fitting method according to an embodiment of the present invention.
[0014] Figure 3 A schematic diagram of a curve corresponding to a sampling set provided in an embodiment of the present invention.
[0015] Figure 4 A schematic diagram of an initial zoom curve provided by an embodiment of the present invention.
[0016] Figure 5 The second flowchart of the zoom curve fitting method provided by the embodiment of the present invention.
[0017] Figure 6The third flowchart of the zoom curve fitting method provided by an embodiment of the present invention.
[0018] Figure 7 A schematic diagram of residual provided by an embodiment of the present invention.
[0019] Figure 8 A schematic diagram of a zoom curve fitting device provided by an embodiment of the present invention.
[0020] In the figure: 10 - processor; 11 - memory; 12 - bus; 13 - communication interface; 201 - first processing unit; 202 - second processing unit. DETAILED DESCRIPTION
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0023] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are used only to distinguish the description and should not be understood as indicating or implying relative importance.
[0024] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0025] In the description of the present invention, it should be noted that the terms "upper", "lower", "inside", "outside", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or are the orientations or positional relationships in which the inventive product is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they should not be understood as limiting the present invention.
[0026] In the description of the present invention, it should also be noted that, unless otherwise expressly specified or limited, the terms "disposed" and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections, or electrical connections; direct connections, indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0027] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0028] In an optional embodiment, the AF curve fitting algorithm is a linear interpolation method, which samples multiple curves for the lens and then linearly interpolates between each two curves. Specifically, the total stroke (also known as the total motor step length) of the lens zoom motor (also known as the zoom motor) is discretized to obtain J equally spaced zoom motor coordinates; the zoom motor coordinates corresponding to different object distances (e.g., 1.5M, 1.8M, 2.5M, 3M, 3.8M, 7M, 10M, 30M, and 1000M, etc.) under the j-th zoom motor coordinate are obtained, with 1≤j≤J, to obtain the sampling curve corresponding to the j-th zoom motor coordinate, and then curve fitting is performed on the sampling curve corresponding to the j-th zoom motor coordinate based on the linear interpolation method.
[0029] This linear interpolation method of curve fitting consumes a significant amount of time to acquire the sample curves corresponding to the coordinates of each of the J zoom motors. Furthermore, the image acquisition device (e.g., camera) must maintain power while all curves are being acquired. A power outage or environmental interference with one of the curves requires restarting the curve acquisition process. This method also requires a relatively large chip memory capacity. Furthermore, because the AF curve is nonlinear, the linear interpolation method results in significant errors. This is particularly evident with high-magnification lenses (e.g., 30x or 45x), resulting in blurry images during zooming.
[0030] To solve the above problems, an embodiment of the present invention provides a zoom curve fitting method, which is applied to the electronic device described below, and can improve the accuracy of the zoom curve, shorten the time of zoom curve fitting, and improve fitting efficiency.
[0031] An embodiment of the present invention provides an electronic device, which can be a main control unit of an image capture device, or can also be an image capture device, or a device such as a mobile phone, computer, or server that is communicatively connected to the image capture device. The image capture device in the embodiment of the present invention can be, but is not limited to, a spherical camera installed in a fixed position.
[0032] Please refer to Figure 1 , a schematic diagram of the structure of an electronic device. The electronic device includes a processor 10, a memory 11, and a bus 12. The processor 10 and the memory 11 are connected via the bus 12. The processor 10 is used to execute executable modules stored in the memory 11, such as computer programs.
[0033] The processor 10 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the zoom curve fitting method can be completed by the hardware integrated logic circuit or software instructions in the processor 10. The above-mentioned processor 10 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0034] The memory 11 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
[0035] The bus 12 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. Figure 1Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus 12 or one type of bus 12.
[0036] The memory 11 is used to store programs, such as a program for the zoom curve fitting device. The zoom curve fitting device includes at least one software functional module, which can be stored in the memory 11 in the form of software or firmware, or embedded in the operating system (OS) of the electronic device. Upon receiving an execution instruction, the processor 10 executes the program to implement the zoom curve fitting method.
[0037] Possibly, the electronic device provided by the embodiment of the present invention further includes a communication interface 13. The communication interface 13 is connected to the processor 10 via a bus.
[0038] It should be understood that Figure 1 The structure shown is only a schematic diagram of a portion of the electronic device. The electronic device may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0039] The zoom curve fitting method provided by the embodiment of the present invention can be applied to, but not limited to, Figure 1 For detailed procedures, please refer to the electronic equipment shown in Figure 2 , the zoom curve fitting method includes: S10, S11, S15, S18 and S19, which are described in detail as follows.
[0040] S10, obtaining the i-th sampling set corresponding to the i-th object distance.
[0041] The sampling set includes J sampling points, which include the coordinates of the zoom motor and the corresponding zoom motor. The J zoom motor coordinates are evenly spaced, 1≤i≤I, I≥3, and the value of J can range from 30 to 60.
[0042] exist Figure 2 On the basis of the content in S10, the embodiment of the present invention further provides an optional implementation, please refer to the following. S10, the step of obtaining the i-th sampling set corresponding to the i-th object distance, includes: S101 and S102, which are specifically described as follows.
[0043] S101 , discretizing the total stroke of the lens zoom motor to obtain J zoom motor coordinates distributed at equal intervals.
[0044] S102 , determining the j-th zoom motor coordinate corresponding to the j-th magnification motor coordinate at the i-th object distance to obtain an i-th sampling set, where 1≤j≤J.
[0045] Optionally, when the object distance is the i-th object distance and the lens zoom motor rotates to the j-th zoom motor coordinate, the zoom motor is adjusted, and the zoom motor coordinate corresponding to the highest image clarity is the j-th zoom motor coordinate.
[0046] It should be noted that at least three sampling sets corresponding to object distances need to be obtained. Optionally, the value of the first object distance can be the minimum effective object distance recognized by the image acquisition device, and the value of the third object distance can be the maximum effective object distance recognized by the image acquisition device. Data sampling only needs to be performed at a limited number of object distances, greatly reducing the amount of data sampling and thus shortening the curve fitting time.
[0047] Optionally, the value of the first object distance may be 1.5M, the value of the 1st object distance may be 1000M, and the value of the intermediate object distance may be 7M.
[0048] Please refer to Figure 3 , Figure 3 A schematic diagram of a curve corresponding to a sampling set provided in an embodiment of the present invention. Figure 3 The horizontal axis represents the coordinates of the zoom motor, and the vertical axis represents the coordinates of the zoom motor. Figure 3 ① represents the curve corresponding to the sampling set when the object distance is 1.5M, ② represents the curve corresponding to the sampling set when the object distance is 7M, and ③ represents the curve corresponding to the sampling set when the object distance is 1000M.
[0049] S11 , determining a target fixed parameter and an object distance parameter formula of a zoom curve based on the i-th sampling set.
[0050] The object distance parameter formula is a conversion formula between the object distance and the object distance correlation parameter in the zoom curve.
[0051] Optionally, a least squares curve fitting is performed based on the i-th sampling set to determine the target fixed parameters and object distance parameter formula of the zoom curve.
[0052] exist Figure 2 Based on the content of S11, the embodiment of the present invention further provides an optional implementation, which is referred to below. S11, the step of determining the target fixed parameters and object distance parameter formula of the zoom curve based on the i-th sampling set, includes: S111, S112, and S113, which are described in detail below.
[0053] S111 , performing least squares curve fitting based on the i th sampling set to obtain the i th primary zoom curve.
[0054] The primary zoom curve includes primary fixed parameters and primary object distance related parameters.
[0055] It should be noted that the least squares curve fitting is more consistent with the characteristics of the zoom curve, thereby ensuring that the fitted parameters are more accurate and reducing the error of the zoom curve obtained by fitting.
[0056] In an optional embodiment, to further improve the accuracy of the zoom curve, the present invention also provides an optional embodiment, which is described below. S111, performing least squares curve fitting based on the i-th sampling set to obtain the i-th primary zoom curve, includes: S111-1 and S111-2, which are described in detail below.
[0057] S111 - 1 , obtaining the jth mean square error value corresponding to the jth variable magnification motor coordinate based on the J variable magnification motor coordinates, to obtain the ith mean square error set corresponding to the ith object distance.
[0058] The i-th mean square error set includes J mean square error points, and the j-th mean square error point includes the j-th mean square error value at the i-th object distance and the j-th zoom motor coordinate.
[0059] Optionally, an average value of J variable magnification motor coordinates is obtained, and based on the average value, a j-th mean square error value corresponding to the j-th variable magnification motor coordinate is calculated.
[0060] S111 - 2 , performing least squares curve fitting based on the i th mean square error set to obtain the i th primary zoom curve.
[0061] Optionally, the formula for the i-th primary zoom curve is:
[0062] in, represents the mean square error value in the mean square error point at the i-th object distance, represents the coordinates of the zoom motor in the mean square error point at the i-th object distance, 、 、 、 、 is the primary fixed parameter in the i-th primary zoom curve, 、 、 、 is the primary object distance correlation parameter in the i-th primary zoom curve.
[0063] Alternatively, the lsqcurvefit function of the Matlab tool can be used to perform least squares curve fitting on the mean square error set.
[0064] Please refer to Figure 4, Figure 4 A schematic diagram of an initial zoom curve provided by an embodiment of the present invention. Figure 4 The horizontal axis represents the mean square error of the zoom motor coordinates, and the vertical axis represents the zoom motor coordinates. Figure 4 ① represents the primary zoom curve when the object distance is 1.5M, ② represents the primary zoom curve when the object distance is 7M, and ③ represents the primary zoom curve when the object distance is 1000M.
[0065] S112 , determining target fixed parameters of the zoom curve based on the primary fixed parameters in all primary zoom curves.
[0066] Optionally, the average value (or median value) of the preliminary fixed parameters of the same type is used to determine the target fixed parameter of the type.
[0067] For example, ,in, represents the initial fixed parameter The corresponding target fixed parameters.
[0068] S113 , obtaining an object distance parameter formula based on the object distance and the primary object distance correlation parameter in the primary zoom curve.
[0069] It should be noted that there are a total of I object distances, and it is known that the primary object distance correlation parameter (such as the above-mentioned ), so that a quadratic fit can be performed to obtain the object distance parameter formula.
[0070] Optionally, the object distance parameter formula is:
[0071] in, Indicates the qth object distance association parameter (corresponding to the above 、 、 、 ), Indicates object distance, represents the first correlation coefficient of the qth object distance correlation parameter, represents the second correlation coefficient of the qth object distance correlation parameter, The third correlation coefficient of the qth object distance correlation parameter, 1≤q≤4.
[0072] S15 , constructing a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameters and the object distance parameter formula.
[0073] The target zoom motor coordinates can be the Jth zoom motor coordinates, or Figure 3 The maximum value of the X-axis coordinate.
[0074] Optionally, the object distance and zoom motor coordinate conversion formula is:
[0075] in, Indicates the mean square error value corresponding to the target zoom motor coordinates, Indicates object distance The corresponding zoom motor coordinates, a, c, d, f and h are the target fixed parameters in the zoom curve, represents the qth object distance association parameter, Indicates object distance, represents the first correlation coefficient of the qth object distance correlation parameter, represents the second correlation coefficient of the qth object distance correlation parameter, The third correlation coefficient of the qth object distance correlation parameter.
[0076] S18, determining the target object distance based on the zoom motor estimated coordinates corresponding to the target zoom motor coordinates and the object distance and zoom motor coordinate conversion formula.
[0077] It should be noted that when the target zoom motor coordinates are fixed, the zoom motor estimated coordinates are substituted into the above formula: In the equation, the corresponding object distance D, i.e. the target object distance, can be obtained.
[0078] S19 , constructing a target zoom curve corresponding to the target object distance based on the object distance parameter formula, the target fixed parameter, and the target object distance. The target zoom curve is used to guide focusing when the object is at the target object distance.
[0079] Optionally, the target zoom curve is calculated as:
[0080] in, Indicates the mean square error of the zoom motor coordinates at object distance D. represents the zoom motor coordinates corresponding to the zoom motor coordinates at object distance D. a, c, d, f, and h are the target fixed parameters in the zoom curve. represents the qth object distance association parameter, Indicates object distance, represents the first correlation coefficient of the qth object distance correlation parameter, represents the second correlation coefficient of the qth object distance correlation parameter, The third correlation coefficient of the qth object distance correlation parameter.
[0081] exist Figure 2 On the basis of how to determine the estimated coordinates of the zoom motor, the embodiment of the present invention also provides an optional implementation method, please refer to Figure 5In S18, based on the zoom motor estimated coordinates corresponding to the target zoom motor coordinates and the object distance and zoom motor coordinate conversion formula, before determining the target object distance, the zoom curve fitting method also includes: S16 and S17, which are specifically described as follows.
[0082] S16 , determining the target zoom motor coordinates corresponding to when the lens zoom motor is at the target zoom motor coordinates at the i-th object distance.
[0083] The i-th object distance can be any object distance, such as the object distance 1.5M or the object distance 1000M mentioned above. When the target zoom motor coordinates are determined, for example, the target zoom motor coordinates are the J-th zoom motor coordinates, the corresponding zoom motor coordinates can be determined, that is, the target zoom motor coordinates.
[0084] S17 , performing accumulation and / or accumulation subtraction based on a preset step length on the basis of the target zoom motor coordinates to determine the estimated zoom motor coordinates corresponding to the target zoom motor coordinates.
[0085] The preset step length may be the minimum step length of the zoom motor.
[0086] By accumulating and / or subtracting at equal intervals (intervals being a preset step length), the estimated coordinates of all zoom motors within the travel range of the zoom motor can be determined.
[0087] Optionally, the accumulation and / or subtraction formula is:
[0088] in, Indicates the target zoom motor coordinates, Indicates the estimated coordinates of the zoom motor, Indicates the preset step size, is any positive integer.
[0089] exist Figure 2 On the basis of how to further ensure the accuracy of the zoom curve, the embodiment of the present invention also provides an optional implementation method, please refer to Figure 6 In S11, after determining the target fixed parameter and the object distance parameter formula of the zoom curve based on the i-th sampling set, the zoom curve fitting method further includes: S12, S13 and S14, which are specifically described as follows.
[0090] S12, constructing an i-th target zoom curve corresponding to the i-th object distance based on the target fixed parameters and the object distance parameter formula.
[0091] S13 , determining an i th residual based on an i th target zoom curve and an i th sampling set corresponding to an i th object distance.
[0092] Optionally, an i-th sampling curve may be determined based on an i-th sampling set corresponding to an i-th object distance, and an i-th residual may be determined based on the i-th sampling curve and an i-th target zoom curve.
[0093] The i-th residual may also be determined based on the discrete sampling points in the i-th sampling set and the i-th target zoom curve.
[0094] S14: Determine whether the error requirement is met based on the i-th residual. If so, execute S15 to construct a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameters and the object distance parameter formula. If not, repeat S10 to obtain the i-th sampling set corresponding to the i-th object distance.
[0095] In an optional implementation, when any residual exceeds a preset residual range, it is determined that the error requirement is not met, or when the average value of all residuals exceeds the preset residual range, it is determined that the error requirement is not met.
[0096] Please refer to Figure 7 , Figure 7 A schematic diagram of residual provided by an embodiment of the present invention. Figure 7 The horizontal axis represents the mean square error of the zoom motor coordinates, and the vertical axis represents the zoom motor coordinates. Figure 7 ① represents the residual curve when the object distance is 1.5M, ② represents the residual curve when the object distance is 7M, and ③ represents the residual curve when the object distance is 1000M.
[0097] See also Figure 8 , Figure 8 An embodiment of the present invention provides a zoom curve fitting device. Optionally, the zoom curve fitting device is applied to the electronic device described above.
[0098] The zoom curve fitting device includes: a first processing unit 201 and a second processing unit 202 .
[0099] The first processing unit 201 is configured to obtain an i-th sampling set corresponding to an i-th object distance, where the sampling set includes J sampling points, each of which includes a zoom motor coordinate and a corresponding zoom motor coordinate, and the J zoom motor coordinates are evenly spaced, 1≤i≤I, and I≥3; The first processing unit 201 is further configured to determine a target fixed parameter of the zoom curve and an object distance parameter formula based on the i-th sampling set, wherein the object distance parameter formula is a conversion formula between the object distance and the object distance-related parameter in the zoom curve; The first processing unit 201 is further configured to construct a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameters and the object distance parameter formula; The first processing unit 201 is further configured to determine the target object distance based on the zoom motor estimated coordinates corresponding to the target zoom motor coordinates and the object distance and zoom motor coordinate conversion formula; The second processing unit 202 is configured to construct a target zoom curve corresponding to the target object distance based on the object distance parameter formula, the target fixed parameter, and the target object distance. The target zoom curve is used to guide focusing at the target object distance.
[0100] Optionally, the first processing unit 201 may execute the above-mentioned S10 to S18; the second processing unit 202 may execute the above-mentioned S19.
[0101] It should be noted that the zoom curve fitting device provided in this embodiment can execute the method flow shown in the above method flow embodiment to achieve the corresponding technical effects. For the sake of brevity, any part not mentioned in this embodiment can be referred to the corresponding content in the above embodiment.
[0102] An embodiment of the present invention further provides a storage medium storing computer instructions and programs that, when read and executed, execute the zoom curve fitting method of the above embodiment. The storage medium may include memory, flash memory, registers, or a combination thereof.
[0103] The following provides an electronic device, which can be a main control unit of an image acquisition device, or an image acquisition device, or a mobile phone, computer, server, etc. that is connected to the image acquisition device for communication. Figure 1 As shown, the above-mentioned zoom curve fitting method can be implemented. Specifically, the electronic device includes: a processor 10, a memory 11, and a bus 12. The processor 10 may be a CPU. The memory 11 is used to store one or more programs. When the one or more programs are executed by the processor 10, the zoom curve fitting method of the above-mentioned embodiment is performed.
[0104] In summary, the embodiments of the present invention provide a zoom curve fitting method, device, storage medium and electronic device, which obtain the i-th sampling set corresponding to the i-th object distance, wherein the sampling set includes J sampling points, and the sampling points include the magnification motor coordinates and the corresponding zoom motor coordinates, and the J magnification motor coordinates are evenly spaced, 1≤i≤I, I≥3; based on the i-th sampling set, the target fixed parameters and the object distance parameter formula of the zoom curve are determined, wherein the object distance parameter formula is a conversion formula between the object distance and the object distance associated parameters in the zoom curve; based on the target fixed parameters and the object distance parameter formula, a conversion formula between the object distance and the zoom motor coordinates corresponding to the target magnification motor coordinates is constructed; based on the zoom motor estimated coordinates corresponding to the target magnification motor coordinates and the object distance and zoom motor coordinate conversion formula, the target object distance is determined; based on the object distance parameter formula, the target fixed parameters and the target object distance, a target zoom curve corresponding to the target object distance is constructed, and the target zoom curve is used to guide focusing when at the target object distance. Based on limited object distance sampling, the target object distance can be inversely calculated to obtain the corresponding target zoom curve. While ensuring the accuracy of the target zoom curve, the sampling time is greatly reduced and the fitting efficiency is improved.
[0105] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
[0106] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
Claims
1. A zoom curve fitting method, characterized in that: The method comprises: Obtaining an i-th sampling set corresponding to an i-th object distance, wherein the sampling set includes J sampling points, the sampling points include a zoom motor coordinate and a corresponding zoom motor coordinate, and the J zoom motor coordinates are evenly spaced, 1≤i≤I, I≥3; Determining a target fixed parameter of a zoom curve and an object distance parameter formula based on the i-th sampling set, wherein the object distance parameter formula is a conversion formula between the object distance and an object distance associated parameter in the zoom curve; Constructing a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameters and the object distance parameter formula; Determine the target object distance based on the estimated zoom motor coordinates corresponding to the target zoom motor coordinates and the object distance and zoom motor coordinate conversion formula; A target zoom curve corresponding to the target object distance is constructed based on the object distance parameter formula, the target fixed parameter and the target object distance, and the target zoom curve is used to guide focusing when the target object distance is reached.
2. The zoom curve fitting method according to claim 1, wherein: The step of obtaining the i-th sampling set corresponding to the i-th object distance includes: Discretize the total stroke of the lens zoom motor to obtain J zoom motor coordinates with equal spacing; Determine the j-th zoom motor coordinate corresponding to the j-th variable magnification motor coordinate at the i-th object distance to obtain the i-th sampling set, where 1≤j≤J.
3. The zoom curve fitting method according to claim 1, wherein: The step of determining a target fixed parameter and an object distance parameter formula of a zoom curve based on the i-th sampling set comprises: Performing least square curve fitting based on the i-th sampling set to obtain an i-th primary zoom curve, wherein the primary zoom curve includes a primary fixed parameter and a primary object distance associated parameter; Determining a target fixed parameter of the zoom curve based on the primary fixed parameters in all the primary zoom curves; An object distance parameter formula is obtained based on the object distance and the primary object distance associated parameter in the primary zoom curve.
4. The zoom curve fitting method according to claim 3, characterized in that: The step of performing least squares curve fitting based on the i-th sampling set to obtain the i-th primary zoom curve includes: Based on the J zoom motor coordinates, a j-th mean square error value corresponding to the j-th zoom motor coordinate is obtained to obtain an i-th mean square error set corresponding to the i-th object distance, wherein the i-th mean square error set includes J mean square error points, and the j-th mean square error point includes the j-th mean square error value and the j-th zoom motor coordinate at the i-th object distance; The least squares curve fitting is performed based on the i-th mean square error set to obtain the i-th primary zoom curve.
5. The zoom curve fitting method according to claim 4, characterized in that: The formula of the i-th primary zoom curve is: in, represents the mean square error value in the mean square error point at the i-th object distance, represents the coordinates of the zoom motor in the mean square error point at the i-th object distance, , , , , is the primary fixed parameter in the i-th primary zoom curve, , , , is the primary object distance correlation parameter in the i-th primary zoom curve.
6. The zoom curve fitting method according to claim 4, characterized in that: The object distance parameter formula is: in, represents the qth object distance association parameter, Indicates the object distance, represents the first correlation coefficient of the qth object distance correlation parameter, represents the second correlation coefficient of the qth object distance correlation parameter, represents the third correlation coefficient of the qth object distance correlation parameter.
7. The zoom curve fitting method according to claim 1, characterized in that: The conversion formula between object distance and zoom motor coordinates is: in, Indicates the mean square error value corresponding to the target zoom motor coordinates, Indicates object distance The corresponding zoom motor coordinates, a, c, d, f and h are the target fixed parameters in the zoom curve, represents the qth object distance association parameter, Indicates the object distance, represents the first correlation coefficient of the qth object distance correlation parameter, represents the second correlation coefficient of the qth object distance correlation parameter, represents the third correlation coefficient of the qth object distance correlation parameter.
8. The zoom curve fitting method according to claim 1, wherein: Before determining the target object distance based on the estimated zoom motor coordinates corresponding to the target variable magnification motor coordinates and the object distance and zoom motor coordinate conversion formula, the method further includes: Determine the target zoom motor coordinates corresponding to the lens zoom motor at the target zoom motor coordinates at the i-th object distance; On the basis of the target zoom motor coordinates, accumulation and / or accumulation subtraction are performed based on a preset step length to determine the estimated zoom motor coordinates corresponding to the target zoom motor coordinates.
9. The zoom curve fitting method according to claim 1, wherein: The formula for the target zoom curve is: in, It represents the mean square error of the zoom motor coordinates at object distance D. represents the zoom motor coordinates corresponding to the zoom motor coordinates at object distance D, a, c, d, f and h are the target fixed parameters in the zoom curve, represents the qth object distance association parameter, Indicates the object distance, represents the first correlation coefficient of the qth object distance correlation parameter, represents the second correlation coefficient of the qth object distance correlation parameter, represents the third correlation coefficient of the qth object distance correlation parameter.
10. The zoom curve fitting method according to claim 1, wherein: After determining the target fixed parameter and object distance parameter formula of the zoom curve based on the i-th sampling set, the method further includes: Constructing an i-th target zoom curve corresponding to an i-th object distance based on the target fixed parameter and the object distance parameter formula; Determine an i-th residual based on an i-th sampling set corresponding to the i-th target zoom curve and the i-th object distance; Determine whether the error requirement is met based on the i-th residual; If satisfied, constructing a conversion formula between the object distance and the zoom motor coordinates corresponding to the target zoom motor coordinates based on the target fixed parameters and the object distance parameter formula; If not satisfied, then repeatedly obtain the i-th sampling set corresponding to the i-th object distance.
11. A zoom curve fitting device, characterized in that: The device comprises: A first processing unit is used to obtain an i-th sampling set corresponding to an i-th object distance, wherein the sampling set includes J sampling points, the sampling points include a zoom motor coordinate and a corresponding zoom motor coordinate, and the J zoom motor coordinates are evenly spaced, 1≤i≤I, I≥3; The first processing unit is further used to determine a target fixed parameter and an object distance parameter formula of the zoom curve based on the i-th sampling set, wherein the object distance parameter formula is a conversion formula between the object distance and the object distance associated parameter in the zoom curve; The first processing unit is further used to construct an object distance and zoom motor coordinate conversion formula corresponding to the target zoom motor coordinate based on the target fixed parameter and the object distance parameter formula; The first processing unit is further used to determine the target object distance based on the estimated zoom motor coordinates corresponding to the target zoom motor coordinates and the object distance and zoom motor coordinate conversion formula; The second processing unit is used to construct a target zoom curve corresponding to the target object distance based on the object distance parameter formula, the target fixed parameter and the target object distance, wherein the target zoom curve is used to guide focusing when the target object distance is reached.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
13. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store one or more programs; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
An auxiliary focusing method for ultra-long focal lens
CN109005347A
Focusing method and device, electronic equipment and computer readable storage medium
CN114245008A
Camera, continuous zooming control method and device thereof and storage medium
CN115002299A
Zoom lens zoom following method
CN116027514A
Zoom lens zoom following method in live broadcast scene
CN116546326A
