Automatic focusing method and terminal
By using preset pan-title table and basic zoom curve in the device, the problem of slow focus speed and poor effect in large-scale scenarios is solved, and a faster and more accurate focus effect is achieved.
Patent Information
- Application Number
- CN202411102834.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-13
AI Technical Summary
The prior art focuses slowly and has poor results in large-scale scenarios, resulting in obvious blurring of the zoom process and large changes in focus, resulting in serious out-of-focus loss of focus, which takes a long time to find the focus with a clear image.
Using an automatic focusing method, by obtaining the current attitude information of the device, the parameters in the target grid corresponding to the current attitude information are determined from the preset pan-title table, and the target zoom is determined from the preset basic zoom curve based on these parameters. The curve is focused based on the target zoom curve control device.
By optimizing the blur phenomenon during the zoom-in focusing process, the focus speed and focus effect of the large-magnification are significantly improved, and the possibility of focus loss and recovery time are reduced.
Smart Images

Figure CN118625478B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of focusing technology, and in particular to an automatic focusing method and a terminal. Background Art
[0002] There is currently a focusing scheme, namely a hill climbing algorithm based on an infinity focus curve, which specifically includes the following steps: (1) a focus curve is preset, which records the zoom of the lens used and the focus value corresponding to each zoom; (2) when zooming (enlarging or reducing the image), the focus follows the preset value corresponding to the zoom; at the end of zooming, due to different object distances, the focus position may be closer to the focal point (the clearest point of the image) or farther from the focal point; (3) after zooming, the image clarity is judged based on the image clarity evaluation value fv.
[0003] The above-mentioned hill climbing algorithm moves the focus position in a fixed direction. If the fv value increases, it moves until the fv value starts to decrease by a certain proportion and then searches in the reverse direction. This process is repeated three times, and the search step size is reduced each time to achieve focusing.
[0004] The above method is implemented by adjusting the zoom and focus motor positions based on a fixed curve when changing the magnification. In large magnification scenarios, the focus position changes greatly, which will have the following disadvantages:
[0005] 1. There is obvious blurring during the zoom process.
[0006] 2. After the zoom motor reaches the specified position, the focus motor may be seriously out of focus, and it takes a long time to find the focus position with a clear image. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide an automatic focusing method and terminal, which can effectively improve the focusing speed and focusing effect of large magnification.
[0008] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0009] An automatic focusing method comprises the steps of:
[0010] Get the current posture information of the device;
[0011] Determine, according to the current posture information, parameters in a target grid corresponding to the current posture information from a preset pan-title (focus parameter) table, and determine, according to the parameters, a target zoom curve from a preset basic zoom curve, wherein the preset pan-title table includes a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid, and the preset basic zoom curve includes a near focus curve, a middle focus curve, and a far focus curve;
[0012] The device is controlled to focus based on the target zoom curve.
[0013] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0014] An automatic focusing terminal comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0015] Get the current posture information of the device;
[0016] Determining parameters in a target grid corresponding to the current posture information from a preset pan-title table according to the current posture information, and determining a target zoom curve from a preset basic zoom curve according to the parameters, wherein the preset pan-title table includes a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid, and the preset basic zoom curve includes a near focus curve, a middle focus curve, and a far focus curve;
[0017] The device is controlled to focus based on the target zoom curve.
[0018] The beneficial effects of the present invention are as follows: the preset pan-title table is a self-created table, including a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid, the preset basic zoom curve includes a near focus curve, a middle focus curve and a far focus curve, the parameters in the target grid corresponding to the current posture information are determined from the preset pan-title table, and the target zoom curve is determined from the preset basic zoom curve according to the parameters, and the device is controlled to focus based on the target zoom curve. Unlike the prior art, focusing is no longer performed by only a fixed default focusing curve, but the target zoom curve is determined from the preset basic zoom curve based on the preset pan-title table, which optimizes the blurring phenomenon in the variable magnification focusing process, thereby effectively improving the focusing speed and focusing effect of large magnifications. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of an automatic focusing method according to an embodiment of the present invention;
[0020] Figure 2This is a schematic structural diagram of an automatic focusing terminal according to an embodiment of the present invention;
[0021] Figure 3 Schematic diagram of a preset basic zoom curve in the automatic focusing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0023] Please refer to Figure 1 , an automatic focusing method, comprising the steps of:
[0024] Get the current posture information of the device;
[0025] Determining parameters in a target grid corresponding to the current posture information from a preset pan-title table according to the current posture information, and determining a target zoom curve from a preset basic zoom curve according to the parameters, wherein the preset pan-title table includes a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid, and the preset basic zoom curve includes a near focus curve, a middle focus curve, and a far focus curve;
[0026] The device is controlled to focus based on the target zoom curve.
[0027] From the above description, it can be seen that the beneficial effects of the present invention are: the preset pan-title table includes multiple grids representing preset degrees in the vertical and horizontal directions and parameters in each grid, the preset basic zoom curve includes a near focus curve, a middle focus curve and a far focus curve, the parameters in the target grid corresponding to the current posture information are determined from the preset pan-title table, and the target zoom curve is determined from the preset basic zoom curve according to the parameters, and the device is controlled to focus based on the target zoom curve. Unlike the prior art, focusing is no longer performed by only a fixed default focusing curve, but the target zoom curve is determined from the preset basic zoom curve based on the preset pan-title table, which optimizes the blurring phenomenon in the variable magnification focusing process, thereby effectively improving the focusing speed and focusing effect of large magnifications.
[0028] Furthermore, before obtaining the current posture information of the device, the method further includes:
[0029] Establish an n×n table, where each grid in the table represents 360 degrees / n;
[0030] Setting the parameters in each grid in the table to initial values;
[0031] A preset pan-title table is generated according to the table and the parameters.
[0032] From the above description, it can be seen that an n×n table is established, each grid in the table represents 360 degrees / n, and the parameters in each grid in the table are set to the initial value. In this way, the generated preset pan-title table can find a suitable zoom curve according to the current position of the device to ensure the subsequent focusing effect.
[0033] Furthermore, before obtaining the current posture information of the device, the method further includes:
[0034] Generate a preset basic zoom curve and determine the parameters corresponding to each curve.
[0035] As can be seen from the above description, a preset basic zoom curve is generated, and the parameters corresponding to each curve are determined, so that the target zoom curve can be determined from the preset pan-title table simply and quickly later.
[0036] Further, the current posture information includes a deviation angle and a pitch angle;
[0037] The determining, according to the current posture information, from a preset pan-title table, parameters in a target grid corresponding to the current posture information comprises:
[0038] Dividing the offset angle and the pitch angle by the preset degrees respectively to obtain a horizontal coordinate and a vertical coordinate;
[0039] The parameters in the target grid corresponding to the horizontal coordinate and the vertical coordinate are determined from a preset pan-title table.
[0040] From the above description, it can be seen that after dividing the offset angle and the pitch angle by the preset degrees respectively, the parameters in the target grid corresponding to the horizontal and vertical coordinates are determined from the preset pan-title table, so as to find the zoom curve most suitable for the current scene and optimize the image blur phenomenon in the zoom process.
[0041] Further, determining the target zoom curve from a preset basic zoom curve according to the parameter includes:
[0042] If the parameter is an integer, a preset basic zoom curve corresponding to the integer is used as a target zoom curve;
[0043] If the parameter is a decimal, a first zoom curve and a second zoom curve corresponding to the parameter are determined from a preset basic zoom curve, and a target zoom curve is determined based on the first zoom curve, the second zoom curve and the parameter.
[0044] From the above description, it can be seen that if the parameter is an integer, the preset basic zoom curve corresponding to the integer is directly used as the target zoom curve. If the parameter is a decimal, the target zoom curve is determined based on the first zoom curve, the second zoom curve and the parameter, so as to fit a new curve that meets the scene. This can significantly optimize the image blur phenomenon during the zoom process, and after the zoom is completed, the image is basically clear, so the focusing can be completed quickly.
[0045] Further, the determining a target zoom curve based on the first zoom curve, the second zoom curve and the parameter comprises:
[0046] Determining a first focus value of the first zoom curve corresponding to zoom and a second focus value of the second zoom curve corresponding to zoom;
[0047] determining an integer portion of the parameter;
[0048] Calculate a focus value of a target zoom curve according to the first focus value, the second focus value, the parameter and the integer part;
[0049] A target zoom curve is determined according to the focus value of the target zoom curve.
[0050] From the above description, it can be seen that the focus value of the target zoom curve is calculated based on the first focus value of the first zoom curve at the corresponding zoom, the second focus value of the second zoom curve at the corresponding zoom, the parameters and the integer part, so that the target zoom curve determined in this way is accurate and reliable, which is convenient for improving the focusing speed.
[0051] Further, the calculating the focus value of the target zoom curve according to the first focus value, the second focus value, the parameter and the integer part includes:
[0052] f=(rate-x)*(fn2-fm1)+fm1;
[0053] In the formula, f represents the focus value of the target zoom curve, fn2 represents the second focus value, fm1 represents the first focus value, rate represents the parameter, and x represents the integer part.
[0054] From the above description, it can be seen that the focus value of the target zoom curve is calculated by the above formula, which ensures the final focusing effect.
[0055] Furthermore, it also includes:
[0056] After the focusing is completed, the focusing result of the focusing is obtained, and the focusing result includes the current posture information of the device and the focus value;
[0057] If the focus value in the focusing result is less than the focus value of the near focus curve at the corresponding zoom, determine that the first preset value is an integer part, and calculate a new parameter according to the near focus curve, the preset focus lower limit curve, the integer part and the focus value in the focusing result;
[0058] If the focus value in the focusing result is greater than the focus value of the near focus curve at the corresponding zoom and less than the focus value of the middle focus curve at the corresponding zoom, determining that the second preset value is an integer part, and calculating a new parameter according to the near focus curve, the middle focus curve, the integer part and the focus value in the focusing result;
[0059] If the focus value in the focusing result is greater than the focus value of the mid-focus curve at the corresponding zoom and less than the focus value of the far-focus curve at the corresponding zoom, determine that the third preset value is an integer part, and calculate a new parameter according to the mid-focus curve, the far-focus curve, the integer part and the focus value in the focusing result;
[0060] If the focus value in the focusing result is greater than the focus value of the far focus curve at the corresponding zoom, determine that the fourth preset value is an integer part, and calculate a new parameter according to the far focus curve, the preset focus upper limit curve, the integer part and the focus value in the focusing result;
[0061] The preset pan-title table is updated using the new parameters according to the current posture information of the device in the focusing result.
[0062] As can be seen from the above description, after focusing is completed, the parameters are recalculated according to the focusing result to update the preset pan-title table, so as to continuously improve the focusing speed and focusing effect.
[0063] Further, the calculating of new parameters according to the near focus curve, the preset focus lower limit curve, the integer part and the focus value in the focusing result includes:
[0064] new-rate=x+(f′-fmin) / (f1-fmin);
[0065] In the formula, new-rate represents a new parameter, x represents the integer part, f′ represents the focus value in the focusing result, fmin represents the focus value of the preset focus lower limit curve at the corresponding zoom, and f1 represents the focus value of the near focus curve at the corresponding zoom.
[0066] It can be seen from the above description that by calculating the new parameters through the above formula, the updated parameters are more in line with the actual usage scenario, and the focusing speed is further improved.
[0067] Please refer to Figure 2 Another embodiment of the present invention provides an automatic focusing terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned automatic focusing method when executing the computer program.
[0068] The above-mentioned automatic focusing method and terminal of the present invention can be applied to the scene where focusing is required, and are described below through specific implementation methods:
[0069] Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is:
[0070] An automatic focusing method comprises the steps of:
[0071] S1. Generate a preset basic zoom curve and determine the parameters corresponding to each curve.
[0072] The preset basic zoom curve includes a near focus curve, a middle focus curve and a far focus curve. Figure 3 shown.
[0073] In an optional implementation, it is determined that the parameter corresponding to the near focus curve is 1, the parameter corresponding to the mid focus curve is 2, and the parameter corresponding to the far focus curve is 3.
[0074] S2. Create an n×n table, where each grid in the table represents 360 degrees / n.
[0075] For example, if you create an 18×18 table, each grid represents 20 degrees.
[0076] S3. Set the parameters in each grid in the table to initial values.
[0077] The initial value is determined according to a parameter corresponding to a preset basic zoom curve. In an optional implementation, the initial value is 3.
[0078] S4. Generate a preset pan-title table according to the table and the parameters.
[0079] S5. Obtain current posture information of the device.
[0080] The current posture information includes a deviation angle and a pitch angle.
[0081] S6, determining parameters in a target grid corresponding to the current posture information from a preset pan-title table according to the current posture information, and determining a target zoom curve from a preset basic zoom curve according to the parameters, specifically including S61-S64:
[0082] The preset pan-title table includes a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid. If the preset pan-title table is an 18×18 table, the preset degree is 20.
[0083] S61. Divide the offset angle and the pitch angle by the preset degrees respectively to obtain a horizontal coordinate and a vertical coordinate.
[0084] For example, if the preset degree is 20, the offset angle is 50, and the pitch angle is 80, then the horizontal coordinate is 2.5 (50 / 20=2.5) and the vertical coordinate is 4 (80 / 20=4).
[0085] S62: Determine the parameters in the target grid corresponding to the horizontal coordinate and the vertical coordinate from a preset pan-title table.
[0086] Since the grid degree of the first row and the first column starts from 0, that is, 0-19 (20 degrees in total), specifically, after the horizontal coordinate and the vertical coordinate are respectively incremented, the parameters in the target grid corresponding to the incremented horizontal coordinate and vertical coordinate are determined from the preset pan-title table.
[0087] Continuing with the above example, the horizontal axis is 2.5 and the vertical axis is 4, which is 3 and 5 after one step. The parameters in the target grid in the third row and fifth column are determined from the preset pan-title table.
[0088] S63: If the parameter is an integer, use a preset basic zoom curve corresponding to the integer as a target zoom curve.
[0089] For example, if the parameter is 1, the near focus curve is used as the target zoom curve, if the parameter is 2, the middle focus curve is used as the target zoom curve, and if the parameter is 3, the far focus curve is used as the target zoom curve.
[0090] S64: If the parameter is a decimal, determining a first zoom curve and a second zoom curve corresponding to the parameter from a preset basic zoom curve, and determining a target zoom curve based on the first zoom curve, the second zoom curve and the parameter, specifically including S641-S645:
[0091] S641: If the parameter is a decimal, determine a first zoom curve and a second zoom curve corresponding to the parameter from a preset basic zoom curve.
[0092] For example, if the parameter is 1.5, which is between parameters 1 and 2, the first zoom curve is a near focus curve, and the second zoom curve is a mid focus curve. If the parameter is 0.5, the first zoom curve is a preset focus lower limit curve, and the second zoom curve is a near focus curve, and so on.
[0093] S642: Determine a first focus value of the first zoom curve corresponding to zoom and a second focus value of the second zoom curve corresponding to zoom.
[0094] S643. Determine the integer part of the parameter.
[0095] For example, if the parameter is 1.5, the integer part is 1.
[0096] S644: Calculate the focus value of the target zoom curve according to the first focus value, the second focus value, the parameter, and the integer part, specifically:
[0097] f=(rate-x)*(fn2-fm1)+fm1;
[0098] In the formula, f represents the focus value of the target zoom curve, fn2 represents the second focus value, fm1 represents the first focus value, rate represents the parameter, and x represents the integer part.
[0099] S645: Determine a target zoom curve according to the focus value of the target zoom curve.
[0100] Each focus value corresponds to a zoom curve, so by determining the focus value, a new curve can be fitted, namely the target zoom curve.
[0101] S7. Control the device to focus based on the target zoom curve.
[0102] Specifically, the device is controlled to focus based on the target zoom curve by sending a zoom operation command and a device angle control operation command, wherein the zoom operation command includes a target zoom ratio, and the device angle control operation command includes a target position.
[0103] Before zooming, a curve that meets the scenario is determined based on the parameters in the preset pan-title table, which can significantly optimize the image blur phenomenon during the zooming process. After the zooming is completed, the image is basically clear, so the clear point of the image can be quickly found, that is, the focus value before focusing starts and the focus value when focusing ends and successfully focuses are not much different, thereby effectively improving the focusing speed and focusing effect of large magnifications.
[0104] S8. After focusing is completed, a focusing result of the focusing is obtained, where the focusing result includes current posture information of the device and a focus value.
[0105] S9. If the focus value in the focusing result is smaller than the focus value of the near focus curve at the corresponding zoom, determine that the first preset value is the integer part, and calculate new parameters based on the near focus curve, the preset focus lower limit curve, the integer part and the focus value in the focusing result.
[0106] Among them, the first preset value is 0.
[0107] The calculating of the new parameter according to the near focus curve, the preset focus lower limit curve, the integer part and the focus value in the focusing result comprises:
[0108] new-rate=x+(f′-fmin) / (f1-fmin);
[0109] In the formula, new-rate represents a new parameter, x represents the integer part, f′ represents the focus value in the focusing result, fmin represents the focus value of the preset focus lower limit curve at the corresponding zoom, and f1 represents the focus value of the near focus curve at the corresponding zoom.
[0110] S10. If the focus value in the focusing result is greater than the focus value of the near focus curve at the corresponding zoom, and less than the focus value of the mid-focus curve at the corresponding zoom, determine that the second preset value is the integer part, and calculate a new parameter based on the near focus curve, the mid-focus curve, the integer part and the focus value in the focusing result.
[0111] Among them, the second preset value is 1.
[0112] The calculating of a new parameter according to the near focus curve, the mid focus curve, the integer part and the focus value in the focusing result comprises:
[0113] new-rate=x+(f′-f1) / (f2-f1);
[0114] Wherein, f2 represents the focus value of the mid-focus curve at the corresponding zoom.
[0115] S11. If the focus value in the focusing result is greater than the focus value of the mid-focus curve at the corresponding zoom, and less than the focus value of the far-focus curve at the corresponding zoom, determine that the third preset value is the integer part, and calculate a new parameter based on the mid-focus curve, the far-focus curve, the integer part and the focus value in the focusing result.
[0116] The calculation formula is similar to the above and will not be repeated here.
[0117] Among them, the third preset value is 2.
[0118] S12. If the focus value in the focusing result is greater than the focus value of the far focus curve at the corresponding zoom, determine that the fourth preset value is the integer part, and calculate new parameters based on the far focus curve, the preset focus upper limit curve, the integer part and the focus value in the focusing result.
[0119] Among them, the fourth preset value is 3.
[0120] The preset focus upper boundary curve and the focus lower boundary curve are a curve corresponding to the maximum focus value and a curve corresponding to the minimum focus value.
[0121] In an optional implementation, it also includes:
[0122] If the focus value in the focusing result is equal to the focus value of the near focus curve at the corresponding zoom, then the new parameter is determined to be 1;
[0123] If the focus value in the focusing result is equal to the focus value of the mid-focus curve at the corresponding zoom, then the new parameter is determined to be 2;
[0124] If the focus value in the focusing result is equal to the focus value of the far focus curve at the corresponding zoom, the new parameter is determined to be 3.
[0125] S13: Update the preset pan-title table using the new parameters according to the current posture information of the device in the focusing result.
[0126] Specifically, after determining the target grid according to the current posture information of the device in the focusing result, the target grid is updated using new parameters.
[0127] The automatic focusing operation of S5-S13 described above is triggered when the start of focusing is detected, and is also automatically triggered after each zoom operation and device angle control operation is completed.
[0128] Please refer to Figure 2 , Embodiment 2 of the present invention is:
[0129] An automatic focusing terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the automatic focusing method in the first embodiment is implemented.
[0130] In summary, the present invention provides an automatic focusing method and terminal, wherein a preset pan-title table includes a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid, and a preset basic zoom curve includes a near focus curve, a middle focus curve and a far focus curve. The parameters in the target grid corresponding to the current posture information are determined from the preset pan-title table, and the target zoom curve is determined from the preset basic zoom curve according to the parameters. The device is controlled to focus based on the target zoom curve, and focusing is no longer performed by only a fixed default focusing curve as in the prior art. Instead, the target zoom curve is determined from the preset basic zoom curve based on the preset pan-title table, thereby optimizing the blurring phenomenon in the variable magnification focusing process, thereby effectively improving the focusing speed and focusing effect of a large magnification. In addition, after focusing is completed, the parameters are recalculated according to the focusing result to update the preset pan-title table, so as to continuously improve the focusing speed and focusing effect.
[0131] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An automatic focusing method, characterized in that: Includes steps: Acquire current posture information of the device, wherein the current posture information includes a deviation angle and a pitch angle; Determining parameters in a target grid corresponding to the current posture information from a preset pan-title focus parameter table according to the current posture information, and determining a target zoom curve from a preset basic zoom curve according to the parameters, wherein the preset pan-title focus parameter table includes a plurality of grids representing preset degrees in vertical and horizontal directions and parameters in each grid, and the preset basic zoom curve includes a near focus curve, a middle focus curve, and a far focus curve; Controlling the device to focus based on the target zoom curve; Determining the target zoom curve from the preset basic zoom curve according to the parameters includes: If the parameter is an integer, a preset basic zoom curve corresponding to the integer is used as a target zoom curve; If the parameter is a decimal, determining a first zoom curve and a second zoom curve corresponding to the parameter from a preset basic zoom curve, and determining a target zoom curve based on the first zoom curve, the second zoom curve and the parameter; The determining a target zoom curve based on the first zoom curve, the second zoom curve and the parameter comprises: Determining a first focus value of the first zoom curve corresponding to zoom and a second focus value of the second zoom curve corresponding to zoom; determining an integer portion of the parameter; Calculate a focus value of a target zoom curve according to the first focus value, the second focus value, the parameter and the integer part; Determining a target zoom curve according to the focus value of the target zoom curve; Before obtaining the current posture information of the device, the method further includes: Establish an n×n table, where each grid in the table represents 360 degrees / n; Setting the parameters in each grid in the table to initial values; Generate a preset pan-title focus parameter table according to the table and the parameters; Determining the parameters in the target grid corresponding to the current posture information from a preset pan-title focus parameter table according to the current posture information includes: Dividing the offset angle and the pitch angle by the preset degrees respectively to obtain a horizontal coordinate and a vertical coordinate; The parameters in the target grid corresponding to the horizontal coordinate and the vertical coordinate are determined from a preset pan-title focus parameter table.
2. An automatic focusing method according to claim 1, characterized in that: Before obtaining the current posture information of the device, the method further includes: Generate a preset basic zoom curve and determine the parameters corresponding to each curve.
3. The automatic focusing method according to claim 1, characterized in that: The step of calculating the focus value of the target zoom curve according to the first focus value, the second focus value, the parameter and the integer part comprises: f=(rate-x)*(fn2-fm1)+fm1; In the formula, f represents the focus value of the target zoom curve, fn2 represents the second focus value, fm1 represents the first focus value, rate represents the parameter, and x represents the integer part.
4. The automatic focusing method according to claim 1, characterized in that: Also includes: After the focusing is completed, the focusing result of the focusing is obtained, and the focusing result includes the current posture information of the device and the focus value; If the focus value in the focusing result is less than the focus value of the near focus curve at the corresponding zoom, determine that the first preset value is an integer part, and calculate a new parameter according to the near focus curve, the preset focus lower limit curve, the integer part and the focus value in the focusing result; If the focus value in the focusing result is greater than the focus value of the near focus curve at the corresponding zoom and less than the focus value of the middle focus curve at the corresponding zoom, determining that the second preset value is an integer part, and calculating a new parameter according to the near focus curve, the middle focus curve, the integer part and the focus value in the focusing result; If the focus value in the focusing result is greater than the focus value of the mid-focus curve at the corresponding zoom and less than the focus value of the far-focus curve at the corresponding zoom, determine that the third preset value is an integer part, and calculate a new parameter according to the mid-focus curve, the far-focus curve, the integer part and the focus value in the focusing result; If the focus value in the focusing result is greater than the focus value of the far focus curve at the corresponding zoom, determine that the fourth preset value is an integer part, and calculate a new parameter according to the far focus curve, the preset focus upper limit curve, the integer part and the focus value in the focusing result; The preset pan-title focus parameter table is updated using the new parameters according to the current posture information of the device in the focus result.
5. An automatic focusing method according to claim 4, characterized in that: The calculating of the new parameter according to the near focus curve, the preset focus lower limit curve, the integer part and the focus value in the focusing result comprises: new-rate=x+(f′-fmin) / (f1-fmin); Wherein, new-rate represents a new parameter, x represents the integer part, f ′ represents the focus value in the focusing result, fmin represents the focus value of the preset focus lower limit curve at the corresponding zoom, and f1 represents the focus value of the near focus curve at the corresponding zoom.
6. An automatic focusing terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step of the automatic focusing method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Focusing method and device and computer readable storage medium
CN110557550A
