A fast focusing method, device, electronic device and medium

By adjusting sample points based on precision needs and using curve fitting, the method efficiently determines the optimal focus distance in camera modules, improving production efficiency.

CN114885153BActive Publication Date: 2025-07-15JIANGXI NEW SEASONS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210481296.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2025-07-15
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

In the production process of existing mobile phone camera modules, the method of determining the optimal shooting distance point by real-time detection of the growth of SFR value requires collecting multiple sampling points and calculating them, resulting in a long time and affecting production efficiency.

Method used

Determine the sampling quantity based on the test accuracy and product information, obtain the sampling information, fit the sampling curve and determine the peak value. By adjusting the number of sampling points and sampling intervals, the sampling process is optimized to quickly determine the optimal shooting distance point.

Benefits of technology

By optimizing the sampling process, the number of sampling points is reduced, the production efficiency of the mobile phone camera module is improved, and the testing accuracy and speed are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114885153B_ABST
    Figure CN114885153B_ABST
Patent Text Reader

Abstract

The present application relates to a fast focusing method, device, electronic device and medium, and relates to the technical field of autofocus. The method includes obtaining a test accuracy; determining a sampling number based on the test accuracy; obtaining sampling information of the sampling number; fitting a sampling curve based on the sampling information; and determining a peak value based on the sampling curve. The present application has the effect of improving the production efficiency of a mobile phone camera module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of autofocus, and in particular, to a fast focusing method, device, electronic device, and medium. Background Art

[0002] During the production process of mobile phone camera modules, the SFR (Spatial Frequency Response, an image resolution algorithm) value is usually used to find the optimal shooting distance point. The larger the SFR value, the sharper the image, and the clearer the picture at this time. Therefore, by finding the peak value of the SFR, the optimal shooting distance point can be obtained.

[0003] Existing algorithms detect the growth of the SFR value in real time. When it is determined that the SFR value starts to decline, they return to find the peak value of the SFR. Therefore, during the detection process, multiple sampling points need to be collected and calculated one by one. This method results in a long time to determine the optimal shooting distance point, thus directly affecting the production efficiency of mobile phone camera modules. Summary of the Invention

[0004] To improve the production efficiency of mobile phone camera modules, this application provides a fast focusing method, device, electronic device, and medium.

[0005] In a first aspect, this application provides a fast focusing method, adopting the following technical solution:

[0006] A fast focusing method, which obtains a test accuracy;

[0007] Determines a sampling quantity based on the test accuracy;

[0008] Obtains sampling information of the sampling quantity;

[0009] Fits a sampling curve based on the sampling information;

[0010] Determines a peak value based on the sampling curve.

[0011] By adopting the above technical solution, a test accuracy is obtained. The test accuracy requirements for the optimal shooting point of each camera module to be tested are different. The sampling quantity is determined based on the test accuracy. For camera modules with low accuracy requirements, fewer sampling points can be collected; for camera modules with high accuracy requirements, more sampling points can be collected, thereby effectively reducing the number of sampling points. The sampling information of the sampling quantity is obtained, a sampling curve is fitted based on the sampling information, and a peak value is determined based on the sampling curve, and then the optimal shooting distance point is determined. By this method, it is more convenient to determine the peak value and the determination speed is faster, which can effectively improve the production efficiency of mobile phone camera modules.

[0012] In another possible implementation, it includes:

[0013] Obtain product information;

[0014] Determine the test level corresponding to the test accuracy based on the product information;

[0015] Determine the sampling quantity based on the test level, and the sampling quantity is at least three.

[0016] By adopting the above technical solution, product information is obtained, and thus the brand or customization requirements of the product are known. The test level corresponding to the test accuracy is determined based on the product information. The specific test levels corresponding to the higher test accuracies required by different products may be different. The sampling quantity is determined based on the test level, and among them, the sampling quantity is at least three so that the fitting curve can have a peak.

[0017] In another possible implementation manner, it includes:

[0018] Determine the minimum sampling point and the maximum sampling point, where the minimum sampling point corresponds to the nearest position on the test drawing, and the maximum sampling point corresponds to the farthest position on the test drawing;

[0019] Obtain the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points.

[0020] By adopting the above technical solution, the minimum sampling point and the maximum sampling point are determined. The minimum sampling point corresponds to the nearest position on the test drawing, and the maximum sampling point corresponds to the farthest position on the test drawing, so that the sampling points can span the peak in the test drawing, that is, the best photography distance point can be determined within the range of the sampling points.

[0021] In another possible implementation manner, based on obtaining the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points, it includes:

[0022] Determine the remaining quantity of the remaining sampling points based on the sampling quantity;

[0023] Determine the sampling interval based on the remaining quantity and the sampling range. The minimum value of the sampling range is the minimum sampling point, the maximum value of the sampling range is the maximum sampling point, and the sampling interval is the interval obtained by equally dividing the sampling range into the remaining quantity plus one;

[0024] Determine the boundary sampling points based on the minimum sampling point and the sampling interval;

[0025] Judge whether the boundary sampling point is the maximum sampling point;

[0026] Otherwise, loop through the steps of determining new boundary sampling points based on the boundary sampling points and the sampling interval, and determining whether the new boundary sampling points are the maximum sampling points until the boundary sampling points are the maximum sampling points;

[0027] If so, obtain the sampling information of the boundary sampling points and the minimum sampling points.

[0028] By adopting the above technical solution, the remaining number of remaining sampling points is determined based on the number of samples, and the sampling interval is determined based on the remaining number and the sampling range. The sampling interval is the interval obtained by dividing the sampling range evenly into the remaining number plus one. By obtaining sampling points evenly within the sampling range, the curve fitted based on the sampling points subsequently is more stable and has less error.

[0029] In another possible implementation, based on obtaining the sampling information of the minimum sampling points, the maximum sampling points, and the remaining sampling points, it includes:

[0030] Determine the remaining number of the remaining sampling points based on the number of samples;

[0031] Determine the median sampling point based on the minimum sampling point and the maximum sampling point;

[0032] Determine the first range and the second range. The minimum value of the first range is the minimum sampling point, and the maximum value is the median sampling point. The minimum value of the second range is the median sampling point, and the maximum value is the maximum sampling point;

[0033] Determine whether the remaining number is odd and whether the remaining number is greater than one;

[0034] If it is odd, obtain the sampling information of the median sampling point, the minimum sampling point, and the maximum sampling point;

[0035] If it is odd and greater than one, calculate the first random number, which is the number obtained by subtracting one from the remaining number and then dividing it evenly;

[0036] Obtain the first random sampling points of the first random number within the first range and the second random sampling points of the first random number within the second range, and obtain the sampling information of the first random sampling points and the second random sampling points;

[0037] If it is not odd, calculate the second random number, which is the number obtained by dividing the remaining number evenly;

[0038] Obtain the second random number of third random sampling points within the first range, and obtain the second random number of fourth random sampling points within the second range, and obtain the sampling information of the third random sampling points and the fourth random sampling points.

[0039] By adopting the above technical solution, the median sampling point is determined based on the minimum sampling point and the maximum sampling point, the first range and the second range are determined, and then the sampling range is divided into two parts. Judge whether the remaining quantity is odd, and judge whether the remaining quantity is greater than one. If it is odd, it means that there must be a median sampling point among the remaining sampling points, and obtain the sampling information of the median sampling point, the minimum sampling point and the maximum sampling point. If it is odd and greater than one, it means that there are other sampling points besides the median sampling point among the remaining sampling points. Obtain the first random number of first random sampling points within the first range, and obtain the first random number of second random sampling points within the second range; if it is not odd, obtain the second random number of third random sampling points within the first range, and obtain the second random number of fourth random sampling points within the second range. Through random sampling, the probability of each sampling point being selected is the same, the sampling method is simple, and the sampling time can be shortened.

[0040] In another possible implementation, fitting the sampling curve with the sampling information includes:

[0041] Determine the curve function satisfied by the sampling information;

[0042] Substitute the sampling information into the curve function and calculate the unknowns in the curve function;

[0043] Determine the sampling curve based on the unknowns and the curve function.

[0044] By adopting the above technical solution, determine the curve function satisfied by the sampling information to ensure that there is a peak in the curve function, substitute the sampling information into the curve function, and calculate the unknowns in the curve function. Substitute the calculated unknowns into the curve function to obtain the sampling curve.

[0045] In another possible implementation, after determining the peak based on the sampling curve, it further includes:

[0046] Judge whether the sampling quantity is greater than a preset quantity;

[0047] If it is greater, output the peak;

[0048] If it is not greater, determine the calibration range based on the peak and the preset range, the median of the calibration range is the peak, and output the calibration range and the peak.

[0049] By adopting the above technical solution, it is determined whether the number of samples is greater than a preset number. If it is greater, it indicates that the test accuracy is moderate, and the peak value can be directly output. If it is not greater, it indicates that the test accuracy is low, and the calculated peak value is very likely to be inaccurate. A calibration range is determined based on the peak value and the preset range. The median value of the calibration range is the peak value, and the peak value and the calibration range are output. By setting the calibration range, the user can know the error range and it is convenient for the user to perform subsequent debugging.

[0050] In a second aspect, the present application provides a fast focusing device, adopting the following technical solution:

[0051] A fast focusing device includes:

[0052] A first acquisition module for acquiring test accuracy;

[0053] A first determination module for determining the number of samples based on the test accuracy;

[0054] A second acquisition module for acquiring sampling information of the number of samples;

[0055] A fitting module for fitting a sampling curve based on the sampling information;

[0056] A second determination module for determining a peak value based on the sampling curve.

[0057] By adopting the above technical solution, the first acquisition module acquires the test accuracy, and the test accuracy requirements for the best shooting points of each camera module to be tested are different. The first determination module determines the number of samples based on the test accuracy. For camera modules with low accuracy requirements, fewer sampling points can be collected; for camera modules with high accuracy requirements, more sampling points can be collected, thereby effectively reducing the number of sampling points. The second acquisition module acquires the sampling information of the number of samples, the fitting module fits a sampling curve based on the sampling information, and the second determination module determines the peak value based on the sampling curve, thereby determining the best shooting distance point. Determining the peak value by this method is more convenient and the determination speed is faster, which can effectively improve the production efficiency of the mobile phone camera module.

[0058] In another possible implementation manner, when the first determination module determines the number of samples based on the test accuracy, it specifically is used for:

[0059] Acquiring product information;

[0060] Determining the test level corresponding to the test accuracy based on the product information;

[0061] Determining the number of samples based on the test level, and the number of samples is at least three.

[0062] In another possible implementation, when the second acquisition module acquires the sampling information of the sampling quantity, it specifically is used for:

[0063] Determine the minimum sampling point and the maximum sampling point, where the minimum sampling point corresponds to the nearest position of the test drawing, and the maximum sampling point corresponds to the farthest position of the test drawing;

[0064] Acquire the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points.

[0065] In another possible implementation, when the second acquisition module acquires the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points, it specifically is used for:

[0066] Determine the remaining quantity of the remaining sampling points based on the sampling quantity;

[0067] Determine the sampling interval based on the remaining quantity and the sampling range, where the minimum value of the sampling range is the minimum sampling point, the maximum value of the sampling range is the maximum sampling point, and the sampling interval is the interval obtained by evenly dividing the sampling range into the remaining quantity plus one;

[0068] Determine the boundary sampling points based on the minimum sampling point and the sampling interval;

[0069] Judge whether the boundary sampling point is the maximum sampling point;

[0070] If not, loop to execute the steps of determining new boundary sampling points based on the boundary sampling point and the sampling interval, and judging whether the new boundary sampling point is the maximum sampling point until the boundary sampling point is the maximum sampling point;

[0071] If so, acquire the sampling information of the boundary sampling point and the minimum sampling point.

[0072] In another possible implementation, when the second acquisition module is based on acquiring the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points, it specifically is used for:

[0073] Determine the remaining quantity of the remaining sampling points based on the sampling quantity;

[0074] Determine the median sampling point based on the minimum sampling point and the maximum sampling point;

[0075] Determine the first range and the second range, where the minimum value of the first range is the minimum sampling point, the maximum value is the median sampling point, the minimum value of the second range is the median sampling point, and the maximum value is the maximum sampling point;

[0076] Determine whether the remaining quantity is odd and determine whether the remaining quantity is greater than one;

[0077] If it is odd, obtain the sampling information of the median sampling point, the minimum sampling point, and the maximum sampling point;

[0078] If it is odd and greater than one, calculate a first random quantity, where the first random quantity is the quantity obtained by subtracting one from the remaining quantity and then averaging;

[0079] Obtain first random sampling points of the first random quantity within the first range, and obtain second random sampling points of the first random quantity within the second range, and obtain the sampling information of the first random sampling points and the second random sampling points;

[0080] If it is not odd, calculate a second random quantity, where the second random quantity is the quantity obtained by averaging the remaining quantity;

[0081] Obtain third random sampling points of the second random quantity within the first range, and obtain fourth random sampling points of the second random quantity within the second range, and obtain the sampling information of the third random sampling points and the fourth random sampling points.

[0082] In another possible implementation, when the fitting module fits a sampling curve based on the sampling information, it is specifically configured to:

[0083] Determine the curve function satisfied by the sampling information;

[0084] Substitute the sampling information into the curve function and calculate the unknowns in the curve function;

[0085] Determine the sampling curve based on the unknowns and the curve function.

[0086] In another possible implementation, the device further includes:

[0087] A judgment module, configured to judge whether the sampling quantity is greater than a preset quantity;

[0088] A first output module, configured to output the peak value when it is greater;

[0089] A second output module, configured to, when it is not greater, determine a calibration range based on the peak value and a preset range, where the median of the calibration range is the peak value, and output the calibration range and the peak value.

[0090] In a third aspect, the present application provides an electronic device, adopting the following technical solution:

[0091] An electronic device, the electronic device includes:

[0092] One or more processors;

[0093] A memory;

[0094] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: execute a fast focusing method shown in any possible implementation manner according to the first aspect.

[0095] In a fourth aspect, the present application provides a computer-readable storage medium, adopting the following technical solution:

[0096] A computer-readable storage medium, comprising: a computer program stored therein that can be loaded and executed by a processor to implement a fast focusing method shown in any possible implementation manner according to the first aspect.

[0097] In summary, the present application includes at least one of the following beneficial technical effects:

[0098] 1. Obtain the test accuracy. The test accuracy requirements for the best shooting points of each camera module to be tested are different. Determine the sampling quantity based on the test accuracy. For camera modules with low accuracy requirements, fewer sampling points can be collected; for camera modules with high accuracy requirements, more sampling points can be collected, thereby effectively reducing the number of sampling points. Obtain the sampling information of the sampling quantity, fit the sampling curve based on the sampling information, determine the peak value based on the sampling curve, and then determine the best shooting distance point. It is more convenient and faster to determine the peak value by this method, and can effectively improve the production efficiency of mobile phone camera modules;

[0099] 2. Obtain product information, and then know the brand or customization requirements of the product. Determine the test level corresponding to the test accuracy based on the product information. The specific test levels corresponding to higher test accuracies required by different products may be different. Determine the sampling quantity based on the test level, where the sampling quantity is at least three to enable the fitting curve to have a peak value. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] Figure 1 is a schematic flow chart of a fast focusing method according to an embodiment of the present application.

[0101] Figure 2 is a schematic flow chart of a fast focusing device according to an embodiment of the present application.

[0102] Figure 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0103] The following is combined with the attachedFigures 1 - 3 Further details of this application are provided below.

[0104] After reading this specification, those skilled in the art may make modifications to this embodiment as needed without making creative contributions, but as long as they are within the scope of the claims of this application, they are protected by the Patent Law.

[0105] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without making creative efforts belong to the scope of protection of this application.

[0106] In addition, the term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after, unless otherwise specified.

[0107] The embodiments of this application will be further described in detail below in conjunction with the drawings in the specification.

[0108] The embodiments of this application provide a fast focusing method, which is executed by an electronic device. The electronic device can be a server or a terminal device. Among them, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods. This application does not limit this here. As Figure 1 shown, the method includes step S101, step S102, step S103, step S104, and step S105. Among them, in step S101, the test accuracy is obtained.

[0109] For the embodiments of this application, the electronic device can obtain the test accuracy from the cloud server, or the electronic device can also obtain the test accuracy input by the user. The test accuracy can include: high accuracy, medium accuracy, and low accuracy.

[0110] In step S102, the sampling quantity is determined based on the test accuracy.

[0111] For the embodiments of the present application, the electronic device determines the sampling quantity based on the test accuracy. The test accuracy requirements for the optimal shooting points of each camera module to be tested are different. For a camera module with low accuracy, fewer sampling points can be collected; for a camera module with high accuracy, more sampling points can be collected, thereby effectively reducing the number of sampling points.

[0112] Step S103: Obtain the sampling information of the sampling quantity.

[0113] For the embodiments of the present application, the electronic device obtains the sampling information of the sampling quantity. The electronic device can obtain the sampling information from the database or from the cloud server. The sampling information is the DAC value and the SFR value corresponding to the DAC value. The mobile phone camera module collects the sampling information facing the test drawing at 20 cm. For example:

[0114] Assume that the sampling quantity is 8, then the electronic device obtains 8 sampling information from the database.

[0115] Step S104: Fit a sampling curve based on the sampling information.

[0116] For the embodiments of the present application, the electronic device fits a sampling curve based on the sampling information. The sampling information includes the DAC value and the corresponding SFR value. The DAC value is the focusing position of the camera module at the current distance. Since the sampling information satisfies a parabola-like curve, the sampling curve can be a parabola-like curve, and the parabola-like curve can intuitively display the fluctuation of the sampling information.

[0117] Step S105: Determine the peak value based on the sampling curve.

[0118] For the embodiments of the present application, the electronic device determines the peak value based on the sampling curve and selects the DAC point with the largest SFR value. Taking Step S104 as an example:

[0119] The corresponding peak coordinates of the parabola-like curve y = ax^2 + bx + c are, then the electronic device determines -b / (2a) as the peak value, and determines the optimal shooting distance point based on the peak value.

[0120] In a possible implementation manner of the embodiments of the present application, determining the sampling quantity based on the test accuracy requirement in Step S102 specifically includes Step S1021 (not shown in the figure), Step S1022 (not shown in the figure), and Step S1023 (not shown in the figure), where

[0121] Step S1021: Obtain the product information.

[0122] For the embodiments of the present application, the electronic device can obtain the product information from the database or from the cloud server. The product information can include brand information or customization information. For example:

[0123] The brand information obtained by the electronic device is the Jiadu brand.

[0124] Step S1022: Determine the test level corresponding to the test accuracy based on the product information.

[0125] For the embodiments of the present application, the electronic device determines the test level corresponding to the test accuracy based on the product information. The specific test levels corresponding to the higher test accuracies required by different products may be different. Taking step S1021 as an example:

[0126] Assume that the test accuracy is high accuracy, and the test levels include level A, level B, level C, level D, level E, and level F. Then the specific level corresponding to the high accuracy of the Jiadu brand is level A, and the high accuracy of the Tianyou brand is level B.

[0127] Step S1023: Determine the sampling quantity based on the test level.

[0128] Among them, the sampling quantity is at least three.

[0129] For the embodiments of the present application, the electronic device determines the sampling quantity based on the test level. Taking step S1022 as an example: level A corresponds to 8 sampling points, level B corresponds to 7 sampling points, level C corresponds to 6 sampling points, level D corresponds to 5 sampling points, level E corresponds to 4 sampling points, and level F corresponds to 3 sampling points. The sampling quantity is at least three so that the fitting curve can have a peak.

[0130] In a possible implementation manner of the embodiments of the present application, obtaining the sampling information of the sampling quantity in step S103 specifically includes step S1031 (not shown in the figure) and step S1032 (not shown in the figure). Among them,

[0131] Step S1031: Determine the minimum sampling point and the maximum sampling point.

[0132] Among them, the minimum sampling point corresponds to the nearest position of the test drawing, and the maximum sampling point corresponds to the farthest position of the test drawing.

[0133] For the embodiments of the present application, the electronic device determines the minimum sampling point and the maximum sampling point so that the sampling points can span the peak in the test drawing, that is, the best photography distance point can be determined within the range of the sampling points. The test drawing can be selected as the ISO12233 resolution test chart, or other standard test drawings can also be selected. For example:

[0134] The electronic device determines the minimum sampling point based on the ISO12233 resolution test chart: DAC = 0.1, and the maximum sampling point: DAC = 1.5.

[0135] Step S1032: Obtain the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points.

[0136] For the embodiments of the present application, the electronic device acquires the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points. The electronic device can acquire the sampling information from the cloud server or acquire the sampling information input by the user. The sampling information includes the DAC value and the SFR value corresponding to the DAC value. Taking step S1031 as an example:

[0137] The electronic device acquires the sampling information of the minimum sampling point in the cloud server as (0.1, 0.2).

[0138] In a possible implementation manner of the embodiments of the present application, acquiring the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points in step S1032 specifically includes step S1032a (not shown in the figure), step S1032b (not shown in the figure), step S1032c (not shown in the figure), step S1032d (not shown in the figure), step S1032e (not shown in the figure), and step S1032f (not shown in the figure), where

[0139] Step S1032a, determining the remaining number of the remaining sampling points based on the number of samplings.

[0140] For the embodiments of the present application, the electronic device determines the remaining number of the remaining sampling points based on the number of samplings. For example:

[0141] Assume that the number of samplings is 8, and the remaining number is the number of samplings minus the maximum sampling point and the minimum sampling point: the remaining number = 8 - 2 = 6.

[0142] Step S1032b, determining the sampling interval based on the remaining number and the sampling range.

[0143] Among them, the minimum value of the sampling range is the minimum sampling point, the maximum value of the sampling range is the maximum sampling point, and the sampling interval is the interval obtained by dividing the sampling range evenly into the remaining number plus one.

[0144] For the embodiments of the present application, the electronic device determines the sampling interval based on the sampling range of the remaining number. Taking step S1031 and step S1032a as an example:

[0145] The sampling range is [0.1, 1.5]. Divide [0.1, 1.5] evenly into 7, and the length of the sampling interval is 0.2.

[0146] Step S1032c, determining the boundary sampling points based on the minimum sampling point and the sampling interval.

[0147] For the embodiments of the present application, the electronic device determines the boundary sampling points based on the minimum sampling point and the sampling interval. Taking step S1032b as an example:

[0148] The electronic device determines that the first boundary sampling point = 0.1 + 0.2 = 0.3; the second boundary sampling point = 0.3 + 0.2 = 0.5. By evenly obtaining sampling points within the sampling range, the curve fitted based on the sampling points subsequently is more stable and has a smaller error.

[0149] Step S1032d, determine whether the boundary sampling point is the maximum sampling point.

[0150] For the embodiments of this application, taking step S1032b as an example, the electronic device determines whether the boundary sampling point is the maximum sampling point:

[0151] Assume the boundary sampling point is 0.5, then the electronic device determines that the boundary sampling point is not the maximum sampling point; assume the boundary sampling point is 1.5, then the electronic device determines that the boundary sampling point is the maximum sampling point.

[0152] Step S1032e, if not, then loop to execute the steps of determining a new boundary sampling point based on the boundary sampling point and the sampling interval and determining whether the new boundary sampling point is the maximum sampling point until the boundary sampling point is the maximum sampling point.

[0153] For the embodiments of this application, taking step S1032b as an example:

[0154] Assume the boundary sampling point is 0.9, then the electronic device determines that the boundary sampling point is not the maximum sampling point. The electronic device determines a new boundary sampling point based on the boundary sampling point and the sampling interval. The new boundary sampling point is 1.1, and the electronic device determines that the new boundary sampling point 1.1 is not the maximum sampling point;

[0155] The electronic device determines a new boundary sampling point based on the boundary sampling point and the sampling interval. The new boundary sampling point is 1.3, and the electronic device determines that the new boundary sampling point 1.3 is not the maximum sampling point;

[0156] The electronic device determines a new boundary sampling point based on the boundary sampling point and the sampling interval. The new boundary sampling point is 1.5, and the electronic device determines that the new boundary sampling point 1.5 is the maximum sampling point 1.5.

[0157] Step S1032f, if so, then obtain the sampling information of the boundary sampling point and the minimum sampling point.

[0158] For the embodiments of this application, if the electronic device determines that the boundary sampling point is the maximum sampling point, then the electronic device obtains the sampling information of the boundary sampling point and the minimum sampling point. The electronic device can obtain the sampling information from the cloud server, or the electronic device can also obtain the sampling information input by the user. Taking step S1032b as an example:

[0159] The DAC values and the corresponding SFR values in the sampling information obtained by the electronic device from the cloud server are: (0.1, 0.2), (0.3, 0.4), (0.5, 0.6), (0.7, 0.8), (0.9, 0.8), (1.1, 0.6), (1.3, 0.4), (1.5, 0.2).

[0160] In a possible implementation manner of the embodiment of the present application, obtaining the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points in step S1032 specifically includes step S10321 (not shown in the figure), step S10322 (not shown in the figure), step S10323 (not shown in the figure), step S10324 (not shown in the figure), step S10325 (not shown in the figure), step S10326 (not shown in the figure), step S10327 (not shown in the figure), step S10328 (not shown in the figure), and step S10329 (not shown in the figure), where

[0161] Step S10321: Determine the remaining number of the remaining sampling points based on the sampling number.

[0162] For the embodiment of the present application, the electronic device determines the remaining number of the remaining sampling points based on the sampling number. For example:

[0163] Assume that the sampling number is 8, and the remaining number is the sampling number minus the maximum sampling point and the minimum sampling point: the remaining number = 8 - 2 = 6.

[0164] Step S10322: Determine the median sampling point based on the minimum sampling point and the maximum sampling point.

[0165] For the embodiment of the present application, the electronic device determines the median sampling point based on the minimum sampling point and the maximum sampling point. Taking step S1032b as an example:

[0166] The minimum sampling point is 0.1, and the maximum sampling point is 1.5, then the median sampling point = (0.1 + 1.5) / 2 = 0.8.

[0167] Step S10323: Determine the first range and the second range.

[0168] Among them, the minimum value of the first range is the minimum sampling point, the maximum value is the median sampling point, the minimum value of the second range is the median sampling point, and the maximum value is the maximum sampling point.

[0169] For the embodiment of the present application, the electronic device determines the first range and the second range. Taking step S1032b and step S10322 as an example:

[0170] The first range is: [0.1, 0.8]; the second range is: [0.8, 1.5].

[0171] Step S10324, determine whether the remaining quantity is odd and determine whether the remaining quantity is greater than one.

[0172] For the embodiments of the present application, the electronic device determines whether the remaining quantity is odd and determines whether the remaining quantity is greater than one. For example:

[0173] Suppose the remaining quantity is 3, then the electronic device determines that the remaining quantity is odd and greater than one;

[0174] Suppose the remaining quantity is 1, then the electronic device determines that the remaining quantity is odd and not greater than one;

[0175] Suppose the remaining quantity is 4, then the electronic device determines that the remaining quantity is not odd and greater than one.

[0176] Step S10325, if it is odd, obtain the sampling information of the median sampling point, the minimum sampling point, and the maximum sampling point.

[0177] For the embodiments of the present application, if the electronic device determines that the remaining quantity is odd, it means that there must be a median sampling point among the remaining sampling points. The electronic device obtains the sampling information of the median sampling point, the minimum sampling point, and the maximum sampling point. Taking step S1032f as an example:

[0178] The sampling points obtained by the electronic device are: (0.1, 0.2), (0.8, 0.9), (1.5, 0.2).

[0179] Step S10326, if it is odd and greater than one, calculate the first random quantity.

[0180] Wherein, the first random quantity is the quantity obtained by subtracting one from the remaining quantity and then averaging.

[0181] For the embodiments of the present application, if the electronic device determines that the remaining quantity is odd and the remaining quantity is greater than one, the electronic device calculates the first random quantity. For example:

[0182] Suppose the remaining quantity is 5, then the electronic device determines that the remaining quantity is odd and the remaining quantity is greater than one, then the first random quantity = (5 - 1) / 2 = 2.

[0183] Step S10327, obtain the first random sampling points of the first random quantity within the first range, and obtain the second random sampling points of the first random quantity within the second range, and obtain the sampling information of the first random sampling points and the second random sampling points.

[0184] For the embodiments of the present application, the electronic device acquires a first random number of first random sampling points within a first range and a first random number of second random sampling points within a second range, where neither the first random sampling points nor the second random sampling points include the minimum sampling point, the median sampling point, and the maximum sampling point, so as to avoid the occurrence of repeated sampling. Taking steps S10323 and S10326 as examples:

[0185] The first random sampling points are 0.2 and 0.5, and the sampling information of the first random sampling points acquired by the electronic device is (0.2, 0.3), (0.5, 0.6); the second random sampling points are 1.2 and 1.3, and the sampling information of the second random sampling points acquired by the electronic device is (1.2, 0.5), (1.3, 0.4). Through random sampling, the probability of each sampling point being selected is the same, the sampling method is simple, and the sampling time can be shortened.

[0186] Step S10328, if it is not an odd number, calculate the second random number.

[0187] For the embodiments of the present application, if the electronic device determines that the remaining number is not an odd number, the electronic device calculates the second random number. For example:

[0188] Suppose the remaining number is 4, then the electronic device determines that the remaining number is not an odd number, and the second random number = 4 / 2 = 2.

[0189] Step S10329, acquire a second random number of third random sampling points within the first range and a second random number of fourth random sampling points within the second range, and acquire the sampling information of the third random sampling points and the fourth random sampling points.

[0190] For the embodiments of the present application, the electronic device acquires a second random number of third random sampling points within the first range and a second random number of fourth random sampling points within the second range, where neither the third random sampling points nor the fourth random sampling points include the minimum sampling point and the maximum sampling point, so as to avoid the occurrence of repeated sampling. Taking steps S10323 and S10326 as examples:

[0191] The first random sampling points are 0.2 and 0.5, and the sampling information of the third random sampling points acquired by the electronic device is (0.2, 0.3), (0.5, 0.6); the fourth random sampling points are 1.2 and 1.3, and the sampling information of the second random sampling points acquired by the electronic device is (1.2, 0.5), (1.3, 0.4). Through random sampling, the probability of each sampling point being selected is the same, the sampling method is simple, and the sampling time can be shortened.

[0192] In a possible implementation of the embodiment of the present application, in step S104, fitting the sampling curve based on the sampling information specifically includes step S1041 (not shown in the figure), step S1042 (not shown in the figure), and step S1043 (not shown in the figure), where

[0193] Step S1041, determining the curve function satisfied by the sampling information.

[0194] For the embodiment of the present application, the electronic device determines the curve function satisfied by the sampling information. Since the sampling information satisfies a parabola-like curve, the curve function can be the parabola-like curve y = ax^2 + bx + c.

[0195] Step S1042, substituting the sampling information into the curve function and calculating the unknowns in the curve function.

[0196] For the embodiment of the present application, the electronic device substitutes the sampling information into the curve function and calculates the unknowns in the curve function. The electronic device uses the least squares polynomial curve fitting and calculus to calculate the sampling curve, finding the best function match for the data by minimizing the sum of the squares of the errors, that is, fitting the curve by ensuring that the sum of the squares of all sampling information deviations is the smallest. The farther a sampling point deviates from the curve, the greater the noise of the sampling point, and the smaller the probability of this point appearing. Taking steps S1032f and S1041 as an example:

[0197] Substitute 8 groups of data into y = ax^2 + bx + c, find the partial derivatives, and obtain the following table:

[0198] x y x^2 x^3 x^4 x * y x^2 * y 0 0.1 0.2 0.01 0.001 0.0001 0.02 0.002 1 0.3 0.4 0.09 0.0081 0.000729 0.12 0.036 2 0.5 0.6 0.25 0.125 0.0625 0.3 0.15 3 0.7 0.8 0.49 0.343 0.2401 0.56 0.392 4 0.9 0.8 0.81 0.729 0.6561 0.72 0.648 5 1.1 0.6 1.21 1.331 1.4641 0.66 0.726 6 1.3 0.4 1.69 2.197 2.8561 0.52 0.676 7 1.5 0.2 2.25 3.375 5.0625 0.3 0.45 ∑ 6.4 4 6.8 8.1091 10.342229 3.2 3.08

[0199] Based on the above table, obtain the system of equations:

[0200]

[0201] Solve to get a = -1.19, b = 1.9, c = -0.012.

[0202] Step S1043, determining the sampling curve based on the unknowns and the curve function.

[0203] For the embodiment of the present application, the electronic device determines the sampling curve based on the position beam and the curve function. Taking step S1042 as an example:

[0204] The sampling curve is: y = -1.19x^2 + 1.9x - 0.012, then the peak point is (0.8, 0.75), and the peak value is 0.8.

[0205] A possible implementation of the embodiment of the present application, the method further includes step S106 (not shown in the figure), step S107 (not shown in the figure), and step S108 (not shown in the figure). Step S106 can be executed after step S105.

[0206] Wherein,

[0207] Step S106, determine whether the sampling quantity is greater than a preset quantity.

[0208] For the embodiment of the present application, the electronic device determines whether the sampling quantity is greater than the preset quantity. Assume that the preset quantity is 5 and the sampling quantity is 6, then the electronic device determines that the sampling quantity is greater than the preset quantity; assume that the sampling quantity is 4, then the electronic device determines that the sampling quantity is not greater than the preset quantity.

[0209] Step S107, if it is greater, output the peak value.

[0210] For the embodiment of the present application, if the electronic device determines that the sampling quantity is greater than the preset quantity, the electronic device outputs the peak value. Taking step S1043 as an example:

[0211] The electronic device can send "0.8" to the user's terminal device. The electronic device can also control the speaker to emit the voice information of "0.8". By outputting the peak value, the electronic device can quickly and accurately find the focus position.

[0212] Step S108, if it is not greater, determine the calibration range based on the peak value and the preset range, and output the calibration range and the peak value.

[0213] Wherein, the median of the calibration range is the peak value.

[0214] For the embodiment of the present application, if the electronic device determines that the sampling quantity is not greater than the preset quantity, the electronic device determines the calibration range based on the peak value and the preset range. Assume that the preset range is 0.2. Taking step S1043 as an example:

[0215] The electronic device determines that the calibration range is (0.7, 0.9). The electronic device can send "0.8 and (0.7, 0.9)" to the user's terminal device. The electronic device can also control the display screen to display the text information of "0.8 and (0.7, 0.9)". By setting the calibration range, the user can know the error range and it is convenient for the user to perform subsequent debugging.

[0216] The above embodiment introduces a fast focusing method from the perspective of the method flow. The following embodiment introduces a fast focusing device from the perspective of virtual modules or virtual units. For details, see the following embodiment.

[0217] The embodiment of the present application provides a fast focusing device 20, as Figure 2As shown in the figure, a fast focusing device 20 may specifically include:

[0218] A first acquisition module 201, configured to acquire a test accuracy;

[0219] A first determination module 202, configured to determine a sampling quantity based on the test accuracy;

[0220] A second acquisition module 203, configured to acquire sampling information of the sampling quantity;

[0221] A fitting module 204, configured to fit a sampling curve based on the sampling information;

[0222] A second determination module 205, configured to determine a peak value based on the sampling curve.

[0223] For the embodiments of the present application, the first acquisition module 201 acquires the test accuracy, and the test accuracy requirements for the best shooting points of each camera module to be tested are different. The first determination module 202 determines the sampling quantity based on the test accuracy. For a camera module with low accuracy requirements, fewer sampling points can be collected; for a camera module with high accuracy requirements, more sampling points can be collected, thereby effectively reducing the number of sampling points. The second acquisition module 203 acquires the sampling information of the sampling quantity, the fitting module 204 fits the sampling curve based on the sampling information, and the second determination module 205 determines the peak value based on the sampling curve, and then determines the best shooting distance point. Determining the peak value by this method is more convenient and the determination speed is faster, which can effectively improve the production efficiency of the mobile phone camera module.

[0224] In a possible implementation manner of the embodiments of the present application, when the first determination module 201 determines the sampling quantity based on the test accuracy, it is specifically configured to:

[0225] Acquire product information;

[0226] Determine a test level corresponding to the test accuracy based on the product information;

[0227] Determine the sampling quantity based on the test level, and the sampling quantity is at least three.

[0228] In a possible implementation manner of the embodiments of the present application, when the second acquisition module 203 acquires the sampling information of the sampling quantity, it is specifically configured to:

[0229] Determine a minimum sampling point and a maximum sampling point, where the minimum sampling point corresponds to the nearest position of the test drawing, and the maximum sampling point corresponds to the farthest position of the test drawing;

[0230] Acquire the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points.

[0231] In a possible implementation manner of the embodiment of the present application, when the second acquisition module 203 acquires the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points, it specifically is used for:

[0232] Determine the remaining quantity of the remaining sampling points based on the sampling quantity;

[0233] Determine the sampling interval based on the remaining quantity and the sampling range, where the minimum value of the sampling range is the minimum sampling point, the maximum value of the sampling range is the maximum sampling point, and the sampling interval is the interval obtained by equally dividing the sampling range into the remaining quantity plus one;

[0234] Determine the boundary sampling points based on the minimum sampling point and the sampling interval;

[0235] Judge whether the boundary sampling point is the maximum sampling point;

[0236] If not, loop to execute the steps of determining new boundary sampling points based on the boundary sampling points and the sampling interval, and judging whether the new boundary sampling points are the maximum sampling point until the boundary sampling point is the maximum sampling point;

[0237] If so, acquire the sampling information of the boundary sampling points and the minimum sampling point.

[0238] In a possible implementation manner of the embodiment of the present application, when the second acquisition module 203 acquires the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points based on, it specifically is used for:

[0239] Determine the remaining quantity of the remaining sampling points based on the sampling quantity;

[0240] Determine the median sampling point based on the minimum sampling point and the maximum sampling point;

[0241] Determine the first range and the second range, where the minimum value of the first range is the minimum sampling point and the maximum value is the median sampling point, and the minimum value of the second range is the median sampling point and the maximum value is the maximum sampling point;

[0242] Judge whether the remaining quantity is odd and judge whether the remaining quantity is greater than one;

[0243] If it is odd, acquire the sampling information of the median sampling point, the minimum sampling point, and the maximum sampling point;

[0244] If it is odd and greater than one, calculate the first random quantity, where the first random quantity is the quantity obtained by subtracting one from the remaining quantity and then equally dividing;

[0245] Acquire the first random sampling points of the first random quantity in the first range and the second random sampling points of the first random quantity in the second range, and acquire the sampling information of the first random sampling points and the second random sampling points;

[0246] If it is not an odd number, calculate a second random quantity, which is the quantity obtained by evenly dividing the remaining quantity;

[0247] Obtain third random sampling points of the second random quantity within the first range, and obtain fourth random sampling points of the second random quantity within the second range, and obtain the sampling information of the third random sampling points and the fourth random sampling points.

[0248] In a possible implementation manner of the embodiment of the present application, when the fitting module 204 fits the sampling curve based on the sampling information, it is specifically used for:

[0249] Determine the curve function satisfied by the sampling information;

[0250] Substitute the sampling information into the curve function and calculate the unknowns in the curve function;

[0251] Determine the sampling curve based on the unknowns and the curve function.

[0252] In a possible implementation manner of the embodiment of the present application, the device 20 further includes:

[0253] A judgment module, used to judge whether the sampling quantity is greater than a preset quantity;

[0254] A first output module, used to output a peak value when it is greater;

[0255] A second output module, used to determine a calibration range based on the peak value and a preset range when it is not greater, the median of the calibration range is the peak value, and output the calibration range and the peak value.

[0256] In the embodiment of the present application, the first acquisition module 201 and the second acquisition module 203 may be the same acquisition module or different acquisition modules. The first determination module 202 and the second determination module 205 may be the same determination module or different determination modules. The first output module and the second output module may be the same output module or different output modules.

[0257] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0258] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of this application. The processor 301 may also be a combination that implements computing functions. For example, it includes a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0259] The bus 302 may include a path for transmitting information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.

[0260] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or it may also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired application code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0261] The memory 303 is used to store the application program code for executing the solution of this application, and is controlled by the processor 301 to execute. The processor 301 is used to execute the application program code stored in the memory 303 to implement the content shown in the foregoing method embodiments.

[0262] Among them, the electronic device includes but is not limited to: mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 3 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0263] The embodiments of this application provide a computer-readable storage medium on which a computer program is stored. When it runs on a computer, it enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the related art, in the embodiments of this application, the electronic device obtains the test accuracy, and the test accuracy requirements for the best shooting points of each camera module to be tested are different. The electronic device determines the sampling quantity based on the test accuracy. For a camera module with low accuracy requirements, fewer sampling points can be collected; for a camera module with high accuracy requirements, more sampling points can be collected, thereby effectively reducing the number of sampling points. The electronic device obtains the sampling information of the sampling quantity, the electronic device fits the sampling curve based on the sampling information, the electronic device determines the peak value based on the sampling curve, and then determines the best shooting distance point. It is more convenient and faster to determine the peak value through this method, and can effectively improve the production efficiency of the mobile phone camera module.

[0264] It should be understood that although the steps in the flowchart of the drawings are shown in sequence according to the indication of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the drawings may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. Their execution order does not necessarily have to be sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0265] The above is only a partial implementation manner of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A rapid focusing method, characterized in that, Including: Obtain the test accuracy; Determine the sampling quantity based on the test accuracy; Obtain the sampling information of the sampling quantity; Fit a sampling curve based on the sampling information; Determine the peak value based on the sampling curve; The obtaining the sampling information of the sampling quantity includes: Determine the minimum sampling point and the maximum sampling point, where the minimum sampling point corresponds to the nearest position on the test drawing, and the maximum sampling point corresponds to the farthest position on the test drawing; Obtain the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points; The obtaining the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points includes: Determine the remaining quantity of the remaining sampling points based on the sampling quantity; Determine the sampling interval based on the remaining quantity and the sampling range. The minimum value of the sampling range is the minimum sampling point, the maximum value of the sampling range is the maximum sampling point, and the sampling interval is the interval obtained by evenly dividing the sampling range into the remaining quantity plus one; Determine the boundary sampling points based on the minimum sampling point and the sampling interval; Judge whether the boundary sampling point is the maximum sampling point; If not, loop to execute the steps of determining new boundary sampling points based on the boundary sampling point and the sampling interval, and judge whether the new boundary sampling point is the maximum sampling point until the boundary sampling point is the maximum sampling point; If so, obtain the sampling information of the boundary sampling point and the minimum sampling point.

2. The rapid focusing method according to claim 1, wherein The determining the sampling quantity based on the test accuracy requirement includes: Obtain product information; Determine the test level corresponding to the test accuracy based on the product information; Determine the sampling quantity based on the test level, and the sampling quantity is at least three.

3. A rapid focusing method according to claim 1, characterized in that, The obtaining the sampling information of the minimum sampling point, the maximum sampling point, and the remaining sampling points includes: Determine the remaining quantity of the remaining sampling points based on the sampling quantity; Determine the median sampling point based on the minimum sampling point and the maximum sampling point; Determine the first range and the second range. The minimum value of the first range is the minimum sampling point, the maximum value is the median sampling point, the minimum value of the second range is the median sampling point, and the maximum value is the maximum sampling point; Judge whether the remaining quantity is odd and whether the remaining quantity is greater than one; If it is odd, obtain the sampling information of the median sampling point, the minimum sampling point, and the maximum sampling point; If it is odd and greater than one, calculate the first random quantity, where the first random quantity is the quantity obtained by subtracting one from the remaining quantity and then averaging; Obtain the first random sampling points of the first random quantity in the first range and the second random sampling points of the first random quantity in the second range, and obtain the sampling information of the first random sampling points and the second random sampling points; If it is not odd, calculate the second random quantity, where the second random quantity is the quantity obtained by averaging the remaining quantity; Obtain the second random number of third random sampling points within the first range, and obtain the second random number of fourth random sampling points within the second range, and obtain the sampling information of the third random sampling points and the fourth random sampling points.

4. A rapid focusing method according to claim 1, wherein The fitting of the sampling curve based on the sampling information includes: Determine the curve function satisfied by the sampling information; Substitute the sampling information into the curve function and calculate the unknowns in the curve function; Determine the sampling curve based on the unknowns and the curve function.

5. A rapid focusing method according to claim 1, characterized in that After determining the peak value based on the sampling curve, it further includes: Judge whether the sampling quantity is greater than a preset quantity; If it is greater, output the peak value; If it is not greater, determine a calibration range based on the peak value and a preset range, the median of the calibration range is the peak value, and output the calibration range and the peak value.

6. A rapid focusing device, characterized in that, It includes: A first acquisition module for acquiring the test accuracy; A first determination module for determining the sampling quantity based on the test accuracy; A second acquisition module for acquiring the sampling information of the sampling quantity; A fitting module for fitting a sampling curve based on the sampling information; A second determination module for determining the peak value based on the sampling curve; The second acquisition module is specifically used for acquiring the sampling information of the sampling quantity, including: Determine the minimum sampling point and the maximum sampling point, the minimum sampling point corresponds to the nearest position of the test drawing, and the maximum sampling point corresponds to the farthest position of the test drawing; Acquire the sampling information of the minimum sampling point, the maximum sampling point and the remaining sampling points; The second acquisition module is specifically used for acquiring the sampling information of the minimum sampling point, the maximum sampling point and the remaining sampling points, including: Determine the remaining quantity of the remaining sampling points based on the sampling quantity; Determine the sampling interval based on the remaining quantity and the sampling range, the minimum value of the sampling range is the minimum sampling point, the maximum value of the sampling range is the maximum sampling point, and the sampling interval is the interval obtained by dividing the sampling range evenly into the remaining quantity plus one; Determine the boundary sampling points based on the minimum sampling point and the sampling interval; Judge whether the boundary sampling point is the maximum sampling point; If not, loop to execute the steps of determining new boundary sampling points based on the boundary sampling points and the sampling interval, and judging whether the new boundary sampling points are the maximum sampling points until the boundary sampling point is the maximum sampling point; If so, acquire the sampling information of the boundary sampling point and the minimum sampling point.

7. An electronic device, characterized in that, It includes: One or more processors; A memory; One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the one or more processors, and the one or more applications are configured to: execute a fast focusing method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a fast focusing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Endoscope focusing method and device

    CN112904548A

  • Endoscope focusing method and device

    CN112911133A