Automatic focusing method, device, storage medium and electronic equipment
By determining the object distance based on the camera angle and height and building the target zoom curve, the problem of the camera losing focus during the zoom process is solved, fast and accurate focusing is achieved, and image quality and recognition rate are improved.
Patent Information
- Application Number
- CN202411427792.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In high-definition video, image processing and AI applications, the camera may experience a low probability of out-of-focus loss during zooming, especially when the illumination is low, resulting in unclear images and reducing the recognition rate of face analysis and license plate analysis.
By determining the current object distance based on the current angle and height of the camera, the target zoom curve is constructed, and the zoom motor and zoom motor are controlled for fast and accurate focus.
Improves focus speed and accuracy, ensuring clear images can be obtained under low illumination conditions, thereby improving recognition rates for face and license plate analysis.
Smart Images

Figure CN118945472B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of images, and in particular to an automatic focusing method, device, storage medium and electronic equipment. Background Art
[0002] With the development of technologies such as high-definition video, image processing, video surveillance, and AI, users have higher and higher requirements for image quality. Since the camera may be out of focus with a small probability during the zoom process, and the probability of defocus will be greatly increased when the illumination is very low, the camera may not obtain the clearest image when performing face analysis or license plate analysis, resulting in a lower recognition rate.
[0003] In order to ensure the accuracy of back-end processing, including the accuracy of face analysis or license plate analysis, how to quickly complete focusing has become a difficult problem that technicians in this field are concerned about. Summary of the invention
[0004] The object of the present invention is to provide an automatic focusing method, device, storage medium and electronic device to at least partially improve the above-mentioned problem.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present invention provides an automatic focusing method, the method comprising:
[0007] Determine the current object distance based on the current angle and current height of the camera;
[0008] Determine object distance related parameters in the zoom curve template of the camera based on the current object distance to determine a target zoom curve at the current angle;
[0009] Automatic focusing is performed based on the target zoom curve.
[0010] In a second aspect, an embodiment of the present invention provides an automatic focusing device, the device comprising:
[0011] A first processing unit, configured to determine a current object distance based on a current angle and a current height of the camera;
[0012] The first processing unit is further used to determine object distance related parameters in the zoom curve template of the camera based on the current object distance, so as to determine a target zoom curve at a current angle;
[0013] The second processing unit is configured to perform automatic focusing based on the target zoom curve.
[0014] In a third aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, and the computer program implements the above method when executed by a processor.
[0015] In a fourth aspect, an embodiment of 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.
[0016] Compared with the prior art, the embodiments of the present invention provide an automatic focusing method, device, storage medium and electronic device, including: determining the current object distance based on the current angle and current height of the camera; determining the object distance related parameters in the zoom curve template of the camera based on the current object distance to determine the target zoom curve at the current angle; and performing automatic focusing based on the target zoom curve. The current object distance can be quickly determined according to the current angle of the camera, and then the target zoom curve corresponding to the current object distance can be constructed, and the zoom motor and the zoom motor can be controlled according to the target zoom curve to quickly and accurately complete the focusing.
[0017] 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
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0020] Figure 2 This is a flow chart of an automatic focusing method provided by an embodiment of the present invention.
[0021] Figure 3 A schematic diagram of the angles of a camera provided by an embodiment of the present invention.
[0022] Figure 4 The second flowchart of the automatic focusing method provided by the embodiment of the present invention.
[0023] Figure 5 The third flowchart of the automatic focusing method provided by the embodiment of the present invention.
[0024] Figure 6 A schematic diagram of a unit of an automatic focusing device provided by an embodiment of the present invention.
[0025] In the figure: 10 - processor; 11 - memory; 12 - bus; 13 - communication interface; 401 - first processing unit; 402 - second processing unit. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 here can be arranged and designed in various different configurations.
[0027] 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 claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0029] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0030] In the description of the present invention, it should be noted that the terms "upper", "lower", "inside", "outside", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention 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 direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0031] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "disposed" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0032] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0033] In some scenarios, a hill climbing algorithm can be used for focusing. Specifically, the running direction of the focus motor is randomly determined. In this running direction, the focus motor records the clarity value of the current image with each step it runs. When the image clarity value shows a negative slope, it is determined that the image clarity value has passed the peak value. At this time, the running direction of the motor is changed and the motor step length is reduced. Repeat this process in which the focus motor records the clarity value of the current image with each step it runs in this running direction until the motor step length is reduced to the minimum step length and then stops. The current value is considered to be the peak value, which is the clearest point of the image.
[0034] When using the hill climbing algorithm for focusing on license plate analysis and face analysis, the motor will always stop after passing the peak, then change the direction and step length, and search for the peak again. This causes the image to be sometimes clear and sometimes blurry during the focusing process. Although the final image is stopped at the clearest point, the back-end AI algorithm can easily capture the blurry face image or license plate image, which greatly reduces the recognition rate of the AI algorithm.
[0035] In order to overcome the above problems, an embodiment of the present invention provides an automatic focusing method, which can quickly determine the current object distance according to the current angle of the camera, and then construct a target zoom curve corresponding to the current object distance, and control the magnification motor and zoom motor according to the target zoom curve to quickly and accurately complete focusing.
[0036] The embodiment of the present invention provides an electronic device, which may be a control unit of a camera, or a mobile phone, a computer, a server, etc. that is connected to the camera control unit for communication. The camera in the embodiment of the present invention may be, but is not limited to, a spherical camera. 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, and the processor 10 is used to execute an executable module stored in the memory 11, such as a computer program.
[0037] The processor 10 may be an integrated circuit chip having the ability to process signals. In the implementation process, each step of the automatic focusing method may be completed by an integrated logic circuit of hardware in the processor 10 or by instructions in the form of software. The above-mentioned processor 10 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may 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 gates or transistor logic devices, or discrete hardware components.
[0038] 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.
[0039] 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 1 Although only one bidirectional arrow is used in the figure, it does not mean that there is only one bus 12 or only one type of bus 12 .
[0040] The memory 11 is used to store programs, such as programs corresponding to the automatic focusing device. The automatic focusing device includes at least one software function module that can be stored in the memory 11 in the form of software or firmware or fixed in the operating system (OS) of the electronic device. After receiving the execution instruction, the processor 10 executes the program to implement the automatic focusing method.
[0041] 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.
[0042] 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 as 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.
[0043] An automatic focusing method provided by an embodiment of the present invention can be applied to, but is not limited to, Figure 1 For detailed procedures, please refer to the electronic equipment shown in Figure 2 The automatic focusing method includes: S310, S320 and S330, which are described in detail as follows.
[0044] S310, determining a current object distance based on a current angle and a current height of the camera.
[0045] The current angle of the camera is the angle between the shooting direction of the camera and the vertical line of the ground.
[0046] Please refer to Figure 3 , Figure 3 Schematic diagram of the angle of the camera provided by the embodiment of the present invention. Figure 3 As shown, the height of the camera above the ground is fixed at H during a certain period of time. The camera is used to capture images of objects on the ground. When the height is fixed, the current object distance between the camera and the object on the ground is related to the current angle. Optionally, the formula for calculating the current object distance is:
[0047]
[0048] in, Indicates the current angle, 0≤θ<90°, Indicates the current altitude. Current object distance.
[0049] When θ is 90°, the current object distance Equal to the rated maximum object distance of the camera, for example 1000M.
[0050] S320: Determine object distance related parameters in a zoom curve template of the camera based on the current object distance to determine a target zoom curve at the current angle.
[0051] Optionally, the zoom curve template is:
[0052]
[0053] Among them, x represents the zoom motor coordinates or the mean square error value corresponding to the zoom motor coordinates, f(x) represents the zoom motor coordinates, and a, b, c, d, f, g, h, j and k are object distance related parameters in the zoom curve template.
[0054] When the object distance changes, the corresponding object distance related parameters may also change. Therefore, after the current object distance is determined, the object distance related parameters in the zoom curve template can be further determined to determine the target zoom curve at the current angle.
[0055] S330, performing automatic focusing based on the target zoom curve.
[0056] The automatic focusing method provided by the embodiment of the present invention can quickly determine the current object distance according to the current angle of the camera, and then construct a target zoom curve corresponding to the current object distance, and control the zoom motor and the zoom motor according to the target zoom curve to quickly and accurately complete focusing.
[0057] In the embodiment of the present invention, the camera can be fixedly installed at a certain location, or can be intermittently moved or continuously moved. When the position of the camera changes, the embodiment of the present invention also provides an optional implementation method for determining the current height. Please refer to Figure 4 , before determining the current object distance based on the current angle and current height of the camera at S310, the automatic focusing method further includes: S210, S220, S230 and S240, which are described in detail as follows.
[0058] S210, when the camera is at a target angle, controlling the zoom motor in the camera to run to a preset coordinate of the zoom motor.
[0059] Optionally, when the zoom motor runs to a preset coordinate of the zoom motor, the camera is at maximum magnification.
[0060] S220, controlling the zoom motor in the camera to focus under the preset coordinates of the zoom motor to obtain the zoom motor coordinates corresponding to the preset coordinates of the zoom motor.
[0061] It should be noted that, under the preset coordinates of the zoom motor, the zoom motor in the camera is controlled to focus, and the zoom motor coordinates when the image clarity is the highest are the zoom motor coordinates corresponding to the preset coordinates of the zoom motor.
[0062] S230 , performing a table lookup based on the preset coordinates of the variable power motor and the zoom motor coordinates corresponding to the preset coordinates of the variable power motor to determine the target object distance.
[0063] Optionally, the table includes a conversion relationship between the object distance and the magnification motor coordinates and the zoom motor coordinates.
[0064] S240, determining a current height based on the target angle and the target object distance.
[0065] When the target angle and target object distance are both determined, the current height can be calculated based on the above formula (cosine function).
[0066] Optionally, ,in, represents the target object distance, Indicates the target angle, 0≤ <90°, the target angle is not 90°, Indicates the current altitude.
[0067] Based on the above, regarding how to obtain the zoom curve template, the embodiment of the present invention also provides an optional implementation method, please refer to Figure 5 The automatic focusing method further includes: S110 and S120, which are described in detail as follows.
[0068] S110, obtaining an i-th sampling set corresponding to an i-th object distance.
[0069] The sampling set includes J sampling points, the sampling points include the coordinates of the zoom motor and the corresponding zoom motor coordinates, the J zoom motor coordinates are evenly spaced, 1≤i≤I, I≥3, and the value of J can range from 30-60.
[0070] It should be noted that after the current height of the camera is fixed, the camera is controlled to adjust its angle. When the angle changes, the corresponding object distance will also change synchronously. Optionally, the i-th sampling set corresponding to the angles between the shooting direction of the camera and the vertical line of the ground are 90°, 45° and 15° respectively.
[0071] exist Figure 5 Based on the content in S110, the embodiment of the present invention further provides an optional implementation, please refer to the following: S110, the step of obtaining the i-th sampling set corresponding to the i-th object distance includes: S111 and S112, which are specifically described as follows.
[0072] S111, discretize the total stroke of the lens zoom motor to obtain J zoom motor coordinates that are evenly spaced.
[0073] Optionally, the coordinates of the J variable magnification motors are (X1, X2, X3...XJ).
[0074] S112, determining the jth zoom motor coordinate corresponding to the jth variable magnification motor coordinate at the i-th object distance to obtain the i-th sampling set, wherein 1≤j≤J, and the i-th object distance corresponds to the i-th angle.
[0075] Optionally, the J zoom motor coordinates at the i-th object distance are respectively (Fi1, Fi2, Fi3, ..., FiJ), that is, Fij represents the j-th zoom motor coordinate corresponding to the j-th zoom motor coordinate at the i-th object distance. The i-th sampling set includes J sampling points at the i-th object distance.
[0076] 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 corresponding zoom motor coordinate when the image clarity is the highest is the j-th zoom motor coordinate.
[0077] S120: Generate a zoom curve template based on I sampling sets.
[0078] The zoom curve template includes an object distance parameter formula, and the object distance parameter formula represents a conversion relationship between object distance related parameters and the object distance.
[0079] exist Figure 5 Based on the content in S120, the embodiment of the present invention further provides an optional implementation, please refer to the following. S120, the step of generating a zoom curve template based on I sampling sets, includes: S121 and S122, which are specifically described as follows.
[0080] S121 , performing least square curve fitting based on the i th sampling set to obtain the i th primary zoom curve.
[0081] The primary zoom curve includes primary object distance related parameters.
[0082] It should be noted that the least squares curve fitting is more consistent with the characteristics of the zoom curve, thereby ensuring that the parameters after fitting are more accurate and reducing the error of the zoom curve obtained by fitting.
[0083] In an optional implementation, in order to further improve the accuracy of the zoom curve, the embodiment of the present invention also provides an optional implementation, please refer to the following. S121, performing least squares curve fitting based on the i-th sampling set to obtain the i-th primary zoom curve, includes: S121-1 and S121-2, which are specifically described as follows.
[0084] S121 - 1 , obtaining the jth mean square error value corresponding to the jth variable magnification motor coordinate based on the J variable magnification motor coordinates, so as to obtain the i-th mean square error set corresponding to the i-th object distance.
[0085] 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.
[0086] 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.
[0087] S121-2, performing least square curve fitting based on the i-th mean square error set to obtain the i-th primary zoom curve.
[0088] Optionally, the formula for the i-th primary zoom curve is:
[0089]
[0090] 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, , , , , , , , as well as is the primary object distance related parameter in the i-th primary zoom curve.
[0091] It should be noted that there are I sampling sets in total, and each primary object distance related parameter has I values. The i-th sampling set corresponds to the i-th primary zoom curve, , , , , , , , as well as is the primary object distance related parameter determined according to the i-th sampling set.
[0092] Taking the object distance related parameter a as an example, by statistically analyzing I primary zoom curves, a primary object distance related parameter set corresponding to the object distance related parameter a can be obtained ( a 1. a 2. a 3…… a I), other object distance related parameters are the same and will not be elaborated here.
[0093] S122, obtaining an object distance parameter formula based on the object distance and the primary object distance related parameters in the primary zoom curve.
[0094] Optionally, after obtaining I primary zoom curves, a primary object distance related parameter set corresponding to the object distance related parameters is statistically calculated, and a quadratic fit is performed based on the primary object distance related parameter set and the object distance to obtain an object distance parameter formula.
[0095] Optionally, the object distance parameter formula is:
[0096]
[0097] in, represents the qth object distance related parameter, Indicates the object distance, represents the first correlation coefficient of the qth object distance related parameter, represents the second correlation coefficient of the qth object distance related parameter.
[0098] Optionally, the object distance related parameters a, b, c, d, f, g, h, j and k in the zoom curve template are arranged in order, and the qth object distance related parameter can be any one of them. For example, when q is 1, the qth object distance related parameter is a, and when q is 9, the qth object distance related parameter is k.
[0099] See also Figure 6 , Figure 6 An automatic focusing device is provided in an embodiment of the present invention. Optionally, the automatic focusing device is applied to the electronic device described above.
[0100] The automatic focusing device includes: a first processing unit 401 and a second processing unit 402 .
[0101] A first processing unit 401 is used to determine a current object distance based on a current angle and a current height of the camera;
[0102] The first processing unit 401 is further configured to determine object distance related parameters in the zoom curve template of the camera based on the current object distance, so as to determine a target zoom curve at a current angle;
[0103] The second processing unit 402 is configured to perform automatic focusing based on the target zoom curve.
[0104] Optionally, the first processing unit 401 may execute the above-mentioned S110, S120, S210, S220, S230, S240, S310 and S320; the second processing unit 402 may execute the above-mentioned S330.
[0105] It should be noted that the automatic focusing device provided in this embodiment can execute the method flow shown in the above method flow embodiment to achieve the corresponding technical effect. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiment.
[0106] The embodiment of the present invention further provides a storage medium, which stores computer instructions and programs, and when the computer instructions and programs are read and run, the automatic focusing method of the above embodiment is executed. The storage medium may include a memory, a flash memory, a register, or a combination thereof.
[0107] The following provides an electronic device, which may be a control unit of a camera, or a mobile phone, a computer, a server, etc. connected to the camera control unit for communication. Figure 1 As shown, the above-mentioned automatic focusing method can be implemented; specifically, the electronic device includes: a processor 10, a memory 11, and a bus 12. The processor 10 can 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 automatic focusing method of the above-mentioned embodiment is executed.
[0108] In summary, an automatic focusing method, device, storage medium and electronic device provided by an embodiment of the present invention include: determining the current object distance based on the current angle and current height of the camera; determining the object distance related parameters in the zoom curve template of the camera based on the current object distance to determine the target zoom curve at the current angle; and performing automatic focusing based on the target zoom curve. The current object distance can be quickly determined according to the current angle of the camera, and then the target zoom curve corresponding to the current object distance can be constructed, and the zoom motor and the zoom motor can be controlled according to the target zoom curve to quickly and accurately complete the focusing.
[0109] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0110] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. An automatic focusing method, characterized in that: The method comprises: Determine the current object distance based on the current angle and current height of the camera; Determine object distance related parameters in the zoom curve template of the camera based on the current object distance to determine a target zoom curve at the current angle; Performing automatic focusing based on the target zoom curve; The method further 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; generating a zoom curve template based on the I sampling sets, wherein the zoom curve template includes an object distance parameter formula, and the object distance parameter formula represents a conversion relationship between the object distance related parameter and the object distance; The step of generating a zoom curve template based on I of the sampling sets 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 primary object distance related parameters; The object distance parameter formula is obtained based on the object distance and the primary object distance related parameters in the primary zoom curve; 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.
2. The automatic focusing method according to claim 1, wherein: Before determining the current object distance based on the current angle and current height of the camera, the method further includes: When the camera is at a target angle, controlling the zoom motor in the camera to run to a preset coordinate of the zoom motor; Under the preset coordinates of the zoom motor, controlling the zoom motor in the camera to focus, so as to obtain the zoom motor coordinates corresponding to the preset coordinates of the zoom motor; Performing a table lookup based on the preset coordinates of the variable magnification motor and the zoom motor coordinates corresponding to the preset coordinates of the variable magnification motor to determine the target object distance; The current height is determined based on the target angle and the target object distance.
3. The automatic focusing method according to claim 1, wherein: 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, , , , , , , , as well as is the primary object distance related parameter in the i-th primary zoom curve.
4. The automatic focusing method according to claim 1, wherein: The formula for the current object distance is: in, Indicates the current angle. Indicates the current altitude. Current object distance.
5. An automatic focusing device, characterized in that: The device comprises: A first processing unit, configured to determine a current object distance based on a current angle and a current height of the camera; The first processing unit is further used to determine object distance related parameters in the zoom curve template of the camera based on the current object distance, so as to determine a target zoom curve at a current angle; A second processing unit, configured to perform automatic focusing based on the target zoom curve; The first processing unit is further 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; generate a zoom curve template based on the I sampling sets, wherein the zoom curve template includes an object distance parameter formula, and the object distance parameter formula represents a conversion relationship between the object distance-related parameters and the object distance; The generating of the zoom curve template based on the I sampling sets includes: performing least squares curve fitting based on the i-th sampling set to obtain the i-th primary zoom curve, wherein the primary zoom curve includes primary object distance related parameters; obtaining the object distance parameter formula based on the object distance and the primary object distance related parameters in the primary zoom curve; The least squares curve fitting is performed based on the i-th sampling set to obtain the i-th primary zoom curve, including: obtaining the j-th mean square error value corresponding to the j-th zoom motor coordinate based on the J zoom motor coordinates to obtain the i-th mean square error set corresponding to the i-th object distance, 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; and least squares curve fitting is performed based on the i-th mean square error set to obtain the i-th primary zoom curve.
6. 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 4 is implemented.
7. 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 4 is implemented.
Citation Information
Patent Citations
Predetermined area focusing method and device, storage medium and electronic device
CN110336948A
Focusing method and device and computer readable storage medium
CN110557550A
Focusing method and device, camera and readable storage medium
CN113364968A
Focus curve correction method, zoom tracking method and related equipment
CN114095693A
Camera, continuous zooming control method and device thereof and storage medium
CN115002299A
