An autofocusing method for a limited-teleconverter zoom lens
By constructing a coarse-score and fitted two-dimensional lookup table, and combining the full-range scanning method and the hill-climbing search method, the problems of large measurement workload and poor accuracy of finite-distance variable conjugate distance zoom lenses are solved, realizing fast zoom tracking and autofocus, improving user experience and focusing speed.
Patent Information
- Application Number
- CN202310065568.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-01-16
AI Technical Summary
Existing zoom-following methods for finite-distance variable conjugate zoom lenses suffer from problems such as large measurement workload, poor fitting accuracy, complex nonlinear relationships, and object distance mapping errors, resulting in poor user experience and slow focusing speed.
By employing coarse-scale measurement and fitting of two-dimensional lookup tables, and through full-range scanning and polynomial fitting, a fast focusing method with variable magnification tracking and autofocus is constructed, reducing the measurement workload and improving the fitting accuracy. Combined with hill-climbing search method, precise focusing is achieved.
It greatly reduces the workload of measurement, improves the user experience, and shortens the autofocus time, making it suitable for applications with high real-time requirements.
Smart Images

Figure CN116047708B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of zoom following and auto-focusing technology in machine vision or microscopic observation, and particularly relates to an auto-focusing method of a limited distance variable conjugate distance zoom lens. BACKGROUND
[0002] The current continuous zoom auto-focusing lens is mainly divided into three categories: one is a common manual continuous zoom auto-focusing lens, mainly applied to single-lens reflex or micro-single cameras. The second is an electric continuous zoom auto-focusing lens, mainly applied to surveillance or micro-single cameras. The object distance of the above two lenses is from infinity to a limited distance, and the zoom group and the focusing group can be connected or can be independently zoomed or focused. The third is a limited distance variable conjugate distance zoom lens, in which the zoom group and the focusing group are connected during the electric zoom process under the condition of fixed object distance, thus ensuring zoom following.
[0003] With the continuous expansion of the application of the continuous zoom auto-focusing lens in the field of industrial detection or microscopic observation, a zoom lens for imaging at a short distance has appeared. The zoom group and the focusing group of this kind of lens are independently controlled, and if they are independently controlled according to a certain relationship, continuous zoom following can be achieved. The optical structure is shown in Figure 1 The zoom lens has a structure in order of a far object distance 1, a standard object distance 2, a near object distance 3, a front fixed group 4, a zoom group 5, a focusing group 6, a rear fixed group 7 and an image plane 8. In a normal state, the zoom lens forms a clear image on the position of the standard object distance 2. When zoom following is performed, the zoom group 5 and the focusing group 6 move according to the corresponding relationship of a zoom curve 9 and a focusing curve 10, thus ensuring that the entire zoom process is clear. After zooming is completed, the focusing group 6 can independently perform accurate refocusing on the object at the current object distance. When the observed object changes between the far object distance 1 and the near object distance 3, the focusing group 6 of the zoom lens is started to perform auto-focusing, thus ensuring that the observed object is imaged on the image plane 8. This kind of lens has the advantage of a relatively large object distance range and clear imaging at all magnifications within the object distance range, and is therefore called a limited distance variable conjugate distance zoom lens.
[0004] The existing variable magnification following methods mainly include: lookup table method, geometric method, adaptive method, simplified method, prediction method, correlation method, feedback method and improved feedback method. These methods are all based on the relationship curve between focusing group and variable magnification group under different object distance conditions, and variable magnification following data is constructed to realize variable magnification following with different accuracy or speed. For example, a Chinese patent with publication number CN111147732A discloses a focusing curve establishment method and device, which relates to the field of image processing. The method comprises: establishing a coordinate system with variable magnification parameters as the horizontal coordinates and focusing parameters as the vertical coordinates, wherein the object distance during the process of capturing the image by the lens is a constant value; using a monotonous hill climbing algorithm to determine preset variable magnification parameter key points and focusing parameter points corresponding to the preset variable magnification parameter key points in the coordinate system and meeting the preset clear condition; and generating a focusing curve according to the focusing parameter points corresponding to the preset variable magnification parameter key points and meeting the preset clear condition. For example, a Chinese patent with publication number CN111385466A discloses an automatic focusing method, device, equipment and storage medium. The method comprises: determining the variable magnification following curve of the lens under the current object distance by determining the proportion of infrared light in the current monitoring environment and according to the proportion of infrared light, then determining at least two variable magnification positions of the lens in the variable magnification operation process of the lens, and following focusing at the focusing positions associated with each variable magnification position according to the variable magnification following curve of the lens under the current object distance, and performing automatic focusing according to the obtained focusing positions after the variable magnification operation.
[0005] However, the relationship curve between the focusing group position (vertical coordinate) and the variable magnification group magnification (horizontal coordinate) has the following problems: 1) overlapping area and nonlinearity; 2) easy to occur object distance mapping error; 3) nonlinearity increases the difficulty of fitting, often requiring complex least square method for fitting; and 4) poor fitting accuracy.
[0006] In view of the above problems existing in the current method, it is necessary to invent a new two-dimensional lookup table fast construction method to reduce the measurement workload as much as possible, and use a simple data fitting method to output high-precision fitting results, to provide better user experience for subsequent variable magnification following, and to speed up the precision focusing speed. SUMMARY
[0007] The purpose of the present application is to provide an automatic focusing method for a limited distance variable conjugate distance variable magnification lens, which greatly reduces the measurement workload by measuring the two-dimensional lookup table, and the fitting two-dimensional lookup table ensures the accuracy of the subsequent variable magnification following, improves the user experience, and the accurate variable magnification following and the determined search range can reduce the time of subsequent automatic focusing, which has great value for applications with high real-time requirements.
[0008] The present application provides the following technical solutions:
[0009] An autofocusing method of a limited far variable conjugate distance zoom lens, the autofocusing method comprising the following steps:
[0010] (1) dividing magnification of a zoom group uniformly as column index, dividing object distance of the zoom lens uniformly as row index, and obtaining a focusing group position by a full range scanning method according to the column index and the row index to construct a measurement two-dimensional lookup table;
[0011] (2) performing polynomial fitting on each column data of the measurement two-dimensional lookup table, subdividing the object distance uniformly as new row index, calculating a fitting value of the corresponding focusing group position according to the fitting polynomial to construct a fitting two-dimensional lookup table;
[0012] (3) moving the zoom group and the focusing group according to a current actual object distance of the zoom lens and the fitting two-dimensional lookup table to realize zoom following;
[0013] (4) after the zoom following is completed, determining a search range of the focusing group and a single search step in the fitting two-dimensional lookup table according to a current zoom group magnification, and performing autofocusing by a hill climbing search method;
[0014] (5) according to a current zoom group magnification and a current focusing group position value in a result of the autofocusing, reversely searching a closest focusing group position in the fitting two-dimensional lookup table, and taking an object distance corresponding to the closest focusing group position as a new current object distance;
[0015] (6) repeating steps (3)-(4) according to the new current object distance and the fitting two-dimensional lookup table to perform subsequent zoom following and autofocusing.
[0016] In the step (2), the uniform subdivision of the object distance refers to division with smaller precision, compared with the uniform subdivision in the step (1). The measurement two-dimensional lookup table constructed by the uniform subdivision greatly reduces the measurement workload, and the fitting two-dimensional lookup table guarantees the precision of subsequent zoom following, thereby improving the user experience. The accurate zoom following can further reduce the time of subsequent autofocusing, and has great value for applications with high real-time requirements.
[0017] In the present application, the object distance, the zoom group magnification, the focusing group position, the measurement two-dimensional lookup table and the fitting two-dimensional lookup table can be respectively represented by the following symbols: WD, Z, FP, FP(WD, Z) and FP'(WD, Z).
[0018] In the step (1), the method of constructing the measurement two-dimensional lookup table FP(WD i , Z j ) comprises the following steps: j scanning the zoom group to j positions according to j=1~N positions to obtain Z i , scanning the object distance WD according to i=1~M to obtain WD iThe position focusing group uses a full-scan method to scan the entire mechanical travel of the focusing group to find the optimal focusing group position (FP). ij The focus group positions corresponding to all working distances are denoted as FP. 1j FP 2j , ...,FP Mj Continue moving the variable-multiplication group until j = N, to obtain FP. 1N FP 2N , ...,FP MB Complete the measurement of the last column of data, and then complete the FP(WD) measurement. i Z j Construction of )
[0019]
[0020] Where M and N are finite integers with practical application significance, M is generally preferably taken as 5 to 10, and N is a finite integer that can be sampled at intervals of 0.1 according to the scaling range. For example, if the scaling ratio is 8 and the interval is 0.1, then N is int(8 / 0.1+1) = 81.
[0021] In step (2), since the accuracy of the two-dimensional lookup table in the object distance direction is not sufficient, the data in each column of the two-dimensional lookup table is fitted with a cubic or higher-order polynomial according to the column direction. The object distance WD is divided into (j-1)(M-1) equal parts according to the accuracy (i.e., j-equal division of accuracy), where j is an integer, to complete the fitting of the two-dimensional lookup table FP′(WD). i Z j Construction of )
[0022]
[0023] Where j is a finite integer with practical application significance, and (j-1) is generally selected as 5, 10, 20 or even 100 to facilitate the subdivision and fitting of data based on the working distance as the horizontal axis.
[0024] In step (3), the current actual object distance is used as the row index WD. i Scan column index Z j Control the zoom group movement; based on column index Z j The changing focus group position FP was obtained by fitting a two-dimensional lookup table. ij Control the movement of the focusing group motor to achieve zoom following.
[0025] The following example illustrates variable scaling: Assume the current WD i For WD2, Z j From Z2 to Z N This will simply require moving the zoom group from position Z2 to Z. N Location, find WDi , Z j Two indexes correspond to the fitting two-dimensional lookup table of the moving focus group value FP 22 to FP 2N value to drive the focus group motor.
[0026] In step (4), under the condition of the zoom group magnification Z j determination, the focus group position within the object distance WD1~WD kM The limited range of FP 1j ~FP kMj , the focus group finds the maximum FV value of the focus area in this limited range to complete the precision focusing, and obtains the current focus group position value F xj .
[0027] In step (4), the search step under each magnification takes the average slope of the corresponding magnification Z j fitting curve reference point:
[0028]
[0029] In the formula, SearchStep(Z j ) is the search step when the magnification is Z j , M is the maximum row index, The slope of the fitting curve when the object distance is WD i , INT is the rounding function, which outputs the result of the formula inside the parentheses after rounding.
[0030] After the zoom following is completed, the hill climbing method is used again for precision focusing. Assuming the current zoom group magnification is Z j , WD i is WD2, and the focus group position is FP 2j . From Z j , the focus group range is (FP 1j , FP kMj ), so the focus group only needs to find the maximum FV value of the focus area in this range to complete the precision focusing, and get the new F xj value. According to the F xj value, the new WD x can be determined by the reverse lookup table method.
[0031] In step (5), through the current zoom group magnification Z j and the current focus group position value F xj , the closest focus group position is found by comparing the fitting two-dimensional lookup table, and the object distance WD i corresponding to the focus group position is taken as the new current object distance WD x .
[0032] After each zoom follow and precision autofocus is completed, if the user is interested in areas of different heights of the sample, the autofocus method provided by this invention can automatically refocus by clicking on the area and repeating step (4).
[0033] Compared with existing technologies, this invention uses a fitted two-dimensional lookup table method to achieve zoom tracking and fast autofocus of zoom lenses. The zoom tracking improves the user experience, and after zoom tracking is completed, since the current focus area is in a near-sharp state, restarting the autofocus command can quickly autofocus by searching for the optimal focus group position within the limited search range (the focus group positions corresponding to the nearest and farthest object distances). On the other hand, when the area of interest changes, the object distance may be different. In this case, the system will also restart autofocus within the range of the nearest and farthest focus group positions based on the current zoom group magnification to find the optimal focus group position and ensure that the new area of interest is in sharp image. Attached Figure Description
[0034] Figure 1 The working principle of a finite-distance variable conjugate zoom lens;
[0035] Figure 2 This is the image sharpness evaluation value curve for the full-scan search method;
[0036] Figure 3 To measure a two-dimensional lookup table at different magnifications Z j Lower focus group position FP ij Distance WD i Relationship;
[0037] Figure 4 To measure the ploidy ratio of the variable magnification group in a two-dimensional lookup table, Z 11 (20X) Focus group position FP ij , and object distance WD i The fitted curve;
[0038] Figure 5 To fit a two-dimensional lookup table with different magnifications Z j Lower Sharp Focus Group Position FP ij Distance WD i The relationship. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0040] like Figure 1 As shown, the entire structure of a finite-distance variable conjugate distance zoom lens consists of the following components: distant object distance 1, standard object distance 2, near object distance 3, front fixed group 4, zoom group 5, focusing group 6, rear fixed group 7, and image plane 8. Since the focusing group can move independently, the distance between the object and the image can vary, hence the name finite-distance variable conjugate distance lens. Under normal conditions, the zoom process is as follows: the zoom group and the focusing group move according to a certain curve relationship (zoom curve 9 and focusing curve 10) or a two-dimensional lookup table to achieve zoom following, resulting in clear imaging throughout the zoom process. After zoom following ends, the image can be precisely and quickly refocused based on the image sharpness evaluation value, enabling clear imaging observation of objects at different heights. After zoom following and fast autofocus are completed, a new object distance can be obtained by reverse-searching the fitted two-dimensional lookup table based on the current magnification and the position of the focusing group. Repeating the above steps based on the new object distance will achieve a new zoom following and fast autofocus.
[0041] To illustrate the technical solution of this invention, some terms are explained below to facilitate understanding by those skilled in the art:
[0042] Zoom Follow: This refers to the process of moving the zoom group to change the magnification during zooming, while simultaneously controlling the movement of the focus group to ensure that the zoom group and focus group move in tandem during zooming, achieving real-time clear imaging and improving the user experience.
[0043] Focus Value (FV): The image's sharpness is evaluated. The higher the value, the sharper the image. It can be calculated from the pixel data of the region of interest.
[0044] Autofocus: refers to the focusing process that, based on the image sharpness evaluation value, drives the focus group motor (focus group position) to make the image sharp at the current magnification.
[0045] Magnification group motor and focus group motor: The magnification group motor controls the movement of the magnification group, and the focus group motor controls the movement of the focus group.
[0046] Two-dimensional lookup table: by object distance (WD) i ) and variable ploidy ratio (Z) j Find the focus group position (FP) that will make the lens image sharp, based on two conditions.ij ), wherein the object distance determines the row index of the look-up table, and the zoom group magnification determines the column index of the look-up table. The row index and the column index correspond to the focusing group position value.
[0047] The measurement two-dimensional look-up table: a two-dimensional look-up table obtained by uniformly and coarsely measuring the object distance of the variable conjugate distance zoom lens is called a measurement look-up table, and the measurement look-up table is characterized by less measurement row data and fast measurement speed.
[0048] The fitting two-dimensional look-up table: polynomial fitting is performed on the object distance in the row index direction of the measurement two-dimensional look-up table as the horizontal coordinate and all the focusing group position values corresponding to the column index as the vertical coordinate, and then the fitting position value of the focusing group is calculated by taking the subdivided object distance value as the new row index and by using the fitting polynomial, thereby forming a new column of the fitting two-dimensional look-up table; the next column index is continued, and all the data columns are fitted and calculated, thereby obtaining the fitting two-dimensional look-up table.
[0049] The hill-climbing search method: the FV value of each focusing group position is measured, and the change trend of the FV value is observed; if the FV value continuously rises during the movement and then continuously falls after rising to the peak point, it can be judged that the hill-climbing search method has found the peak point of the FV value, and the focusing group position corresponding to the peak point is the target position of the automatic focusing, as shown in FIG. 6. Figure 2
[0050] The automatic focusing method: the automatic focusing method is combined according to the zoom following and the hill-climbing search method. When the zoom group magnification changes, the zoom lens first follows the current object distance to reach the target magnification position in the two-dimensional look-up table, and then determines the search range according to the positions of the focusing groups corresponding to the nearest and farthest object distances, and performs the fast automatic focusing based on the hill-climbing search method by setting a reasonable search step of the single focusing group movement in the limited search range, thereby ensuring that the image is in the sharpest state.
[0051] The current object distance: the closest focusing group position value in the two-dimensional look-up table is found by inversely searching the current zoom group magnification and the current focusing group position value (the automatic focusing result after the following is completed), and the object distance corresponding to the closest focusing group position value is the current object distance.
[0052] The automatic focusing result: the automatic focusing result includes the zoom group magnification and the focusing group position after the automatic focusing is clear, and the current object distance determined according to the two values.
[0053] In order to illustrate the technical solutions of the present application, the following specific embodiments are used for illustration.
[0054] As a possible embodiment of the present application: a certain object distance range is the object distance range that ensures the lens can be focused clearly at all magnifications, and in this embodiment, the range is 150mm-190mm. For the convenience of illustration, this embodiment takes 1mm as the precision unit (in practice, it can be smaller).
[0055] The actual zoom range is 1X-20X, and the magnification subdivision in this embodiment takes 0.1X as the unit. This embodiment takes 1X as the precision unit to select several to illustrate the essence of the present application.
[0056] In this embodiment, the full-range scanning method includes: moving the preset step size to change the focusing group position by driving the focusing group motor, and obtaining the corresponding image sharpness evaluation value FV, scanning the entire mechanical movement stroke of the focusing group, after scanning the entire range, judging the point with the maximum FV value in the scanning process as the sharpest FV peak point, such as Figure 2 In the figure, the focusing group position of the highest point P (FV=2609) is 2255, which is the sharpest focusing group position required by the present application. In order to better illustrate the effect, Figure 2 The focusing group range 1890 to 2340 in the figure is only a part of the mechanical movement stroke.
[0057] S1, construct a measurement two-dimensional lookup table
[0058] Discretely and uniformly subdivide the zoom range of the zoom lens, which is used as the column index of the two-dimensional lookup table, and uniformly coarsely subdivide the object distance of the finite conjugate distance zoom lens, which is used as the row index of the two-dimensional lookup table. The full-range scanning method is used to scan in row-column order, and the position value of the focusing group when each object distance and each magnification is clear is obtained, which is stored in the corresponding position of the row-column index combination to form a complete measurement two-dimensional lookup table.
[0059] For example, in the object distance WD i (mm) 150-190 range, only 5 values in Table 1 are taken as row indexes, and for each row index WD i , the magnification scanning is performed, and for each Z j , the full-range scanning method of the sharpness evaluation value FV and the focusing group is combined to record the focusing group position after focusing, i.e. FP ij . For example, in Table 1, WD2: 160mm; Z2: 2X; FP 22 : 1688, indicating that when the object distance is 160mm and the magnification is 2X, the focusing group position value when imaging is clear is 1688.
[0060] Table 1 measures the focusing group position FP i according to 5 different row indexes WD j and column indexes Z ij to construct a measurement two-dimensional lookup table
[0061]
[0062] S2. Construct a fitted two-dimensional lookup table
[0063] Using the object distance range along the row index direction of the two-dimensional lookup table as the x-axis, and the position values of all focus groups corresponding to a certain magnification group in the column index direction as the y-axis, a polynomial fitting is performed to obtain a fitting polynomial characterizing the working distance and focus group position at a certain resolution. The object distance range is then subdivided, and the subdivided object distance values are used as new row indices. By calculating the fitting polynomial, the fitted values of the focus group positions are obtained, forming a new fitted two-dimensional lookup table column. The process continues with the next column index magnification, fitting and calculating for all data columns to complete the construction of the fitted two-dimensional lookup table after object distance subdivision.
[0064] For example, after obtaining the data shown in Table 1, the index Z of each column is... j Corresponding to different WD i The obtained focus group data FP ij | i=1~5 Two-dimensional diagram Figure 3 As shown. From Figure 3 It can be observed that FP ij | j=1~11 =f(WD) i Z j |j =1~11 The expression represents 11 discrete two-dimensional monotonic curves (depending on the maximum value of j). Such two-dimensional monotonic curves can be fitted using low-order polynomials. For example, Z in Table 1... 11 The mathematical formula for the curve obtained by fitting the data in column (20X) is: y = 0.021833x 3 -10.337857x 2 +1705.338095x-95520.400000. (e.g., ...) Figure 4 As shown, the measured data are compared with the fitted curve, from... Figure 4 It's not hard to see that the two almost completely overlap. If we consider the object distance WD... i Set the accuracy to 1mm (accuracy can be set to 0.1mm or less as needed), and set the object distance WD. i Substituting into the fitting polynomial, we can then obtain the result at an object distance WD when the magnification of the variable magnification group is 20X. i = All 41 focus group positions with an accuracy of 1mm within the range of 150-190mm (FP) ij The fitted two-dimensional lookup table, as shown in Table 2, is Z. 11 (20X) column is shown. Other Z j The fitted data below can be presented using the same method. Due to space limitations, only 11 Z values are given here. j Data under certain circumstances.
[0065] Wherein, the thick solid line in Table 2 represents the zoom following process, WD 21 = 170mm, the zoom group moves from 4X to 14X, and the focus group moves from FP 11 At the zoom ratio, 41 object distances correspond to the focus group position range or upper and lower limits.
[0066] Table 2 is fitted to obtain the object distance WD i The range is 150-190, the accuracy is 1mm, and 11 Z j The focus group position FP ij
[0067]
[0068]
[0069] S3, zoom following
[0070] According to the current object distance of the zoom lens, i.e., the row index, the column index is scanned, i.e., the zoom group is moved, and the position value corresponding to the row and column indexes is taken out to move the focus group, so that continuous zoom following can be realized.
[0071] For example, the data in the fitted two-dimensional lookup table in Table 2 is used to realize this. In Table 2, it is assumed that the object distance of the zoom lens is WD 21 = 170mm, Z j Zoom following is performed from Z3(4X) to Z8(14X). When zooming starts, the program acquires the current object distance WD 21 = 170mm, the zoom group zoom ratio Z3(4X), and according to the fitted two-dimensional lookup table, the moving path of the zoom group and the focus group during zooming is planned, as shown in the thick line box in Table 2. The zoom group moves from Z3(4X) to Z8(14X), and the focus group motor moves from FP 213 = 752 to FP 218 = 1848, and the image is always clear.
[0072] S4, auto focusing
[0073] After zoom following is completed, the position range of the focus group can be found according to the current zoom ratio, i.e., the column index, and accurate and fast (small scanning range) auto focusing can be realized by using the hill climbing method, and fast auto focusing of the region of interest (the object distance may change later) can also be realized.
[0074] Specifically, the search range of the focus group and the single reasonable search step are determined in the fitted two-dimensional lookup table according to the current zoom group zoom ratio, and then the hill climbing method is used to realize fast auto focusing.
[0075] S4.1, Limit the focus search range
[0076] The focus search range of the focus group is determined by fitting a two-dimensional lookup table. Based on the characteristics of a finite-distance variable conjugate zoom lens, its object distance is finite. Therefore, the search range of the focus group at the current zoom level can be limited by fitting a complete two-dimensional lookup table, avoiding unnecessary lens search movements and shortening the focusing time.
[0077] Table 2 shows the fitted two-dimensional lookup table under different Z-axis conditions. j The clearly drawn focus group position FP ij Distance WD i Relationship such as Figure 5 As shown, under the same zoom level, when the object distance WD i When FP changes, ij Distance WD i The relationship exhibits monotonicity. Therefore, when the plural group is fixed at Z... 11 (20X), object distance WD i When the value is unknown, based on the same multiplier, FP i11 Distance WD i Based on the monotonicity of the relationship curve and a fitted two-dimensional lookup table, this invention can determine the focus group in Z... 11 The focus search range at (20X) magnification is FP. 1 11 =1368~FP 41 11 =5054 (indicated by the thick dashed box), no need for the focus group to search back and forth within the maximum mechanical travel range.
[0078] S4.2. Set a reasonable search step size for a single focus group movement based on the zoom group magnification.
[0079] According to the variable ploid ratio Z j Set the search step size based on different Z-multipliers. j The depth of focus varies, and the search step size should be adjusted accordingly. Depth of focus refers to the distance the image plane or object plane can move while maintaining sharpness; that is, the distance the focus group FP can move when the image is sharp in this invention. ij The range. To effectively improve focusing accuracy and efficiency, the search step size should be matched as closely as possible to the depth of focus of the current zoom group, so that the FV value changes significantly during the search process. As shown in Table 2, when the zoom group is Z1 = 1X, the object distance changes from WD1 = 150mm to WD 41 =190mm, the focus group motor position when in focus is from FP 11 =2716 to FP 41 1 =2732 only changed by 16; while when the multiplier of the variable group is Z 11 At 20X, the object distance changes from WD1 = 150mm to WD 41= 190mm, the motor position of the focusing group when the image is in focus is from FP 1 11 = 1368 to FP 4 111 = 5054 changed 3686. It can be seen that when the zoom group magnification Z j is increased, the object distance WD i changes by the same amount, but the focusing group needs to move a greater distance to find the position FP ij of focus. If the same search step is always used, the following problems will inevitably occur:
[0080] 1. The search step is too small, and when the zoom group magnification Z j is high, it is easy to find a false peak, and it will take a long time to search;
[0081] 2. The search step is too large, and when the zoom group magnification Z j is low, the focusing group is easy to miss the clearest focus position, resulting in the inability to find the best clear position.
[0082] The present application is based on the characteristics of fitting a two-dimensional lookup table and a finite distance variable conjugate distance zoom lens, and different search steps are set for each different zoom group magnification Z j , and the search step at each magnification is one quarter of the average slope of the fitting curve reference point corresponding to the magnification Z j .
[0083]
[0084] In the formula, SearchStep(Z j ) is the search step when the magnification Z j is, M is the maximum row index, and the slope of the fitting curve when the object distance is WD i .
[0085] For example Figure 4 , the fitting curve function is: y = 0.021833x 3 -10.337857x 2 +1705.338095x-95520.400000, the slope of which is, The present application uses 41 fitting object distances. After the fitting object distances are substituted to obtain the corresponding slopes, the average slope of the fitting curve is 92.339, and the search step should be reduced based on this value to ensure the accuracy of the focusing algorithm. Accordingly, the search step is set to one quarter of the size of the slope and is rounded, i.e., 23 steps, and such a step size can ensure that the FV changes significantly during focusing, and the clear position can be quickly found.
[0086] S4.3, auto focusing
[0087] The embodiment adopts a fast auto-focusing method, which is a focusing method combined with zoom following and hill climbing search. When the zoom group magnification of the lens changes, the lens first performs zoom following to reach the target focusing group position in the two-dimensional lookup table, and then performs auto-focusing based on the hill climbing search method according to the focusing search range and focusing search step, to ensure that the image is in the sharpest state.
[0088] As shown in Table 2, the zoom lens is ready to zoom from Z3 (4X) to Z8 (14X), and the current object distance is WD 21 = 170 mm. The moving route of the zoom group and the focusing group during zooming is planned according to the fitted two-dimensional lookup table, and the moving path is shown in the thick line box part of Table 2. The focusing group finally moves to the FP 218 = 1848 position. Because the actual difference of the zoom lens or other operations of the user in the middle process (such as the user moving the observed object) cannot determine that the FP position in the fitted two-dimensional lookup table is the position of the sharpest image, a second auto-focusing is performed after the zoom following is completed. The auto-focusing is performed by searching for the best sharpness position in the focusing search range of the focusing group through the single reasonable search step determined according to the zoom group magnification in the present application. The auto-focusing method of the present application adopts the hill climbing search method. The hill climbing search method is to measure the FV value of the focusing group position after each movement is completed, observe the change trend of the FV value, and if the FV value continuously rises during the movement process and then continuously decreases after rising to the peak point, it can be judged that the hill climbing method has found the sharpest position. The sharpest position is the focusing group motor position corresponding to the FV peak point.
[0089] S5, subsequent zoom following and auto-focusing
[0090] Calibrate the current object distance, and re-determine the current object distance, to prepare for subsequent zoom following or auto-focusing.
[0091] Calibrate the current object distance, which is to find the closest focusing group position by inversely comparing the current zoom group magnification Z j and the focusing group position FP ij , according to the fitted two-dimensional lookup table, and the object distance WD i index corresponding to the closest focusing group position is the current object distance.
[0092] Specifically, after each auto-focusing is completed, the current zoom group magnification Z j and the current focusing group position FP ij are obtained, the current zoom group magnification Z j is used as the column index of the fitted two-dimensional lookup table, the object distances WD1- WD kMthe difference between the current actual focusing group position value and all focusing group position values in the range, find the closest focusing group position FP in the two-dimensional look-up table xj , whose corresponding row index WD x is the actual object distance WD x . In the subsequent zoom following process, according to the new row index found by the reverse lookup, scan the column index, and get the focusing group position value by fitting the two-dimensional look-up table to control the focusing group movement, and continue the zoom following.
[0093] As shown in Table 2, when the lens is focused on the zoom group Z6 (10X) position, assuming that the actual FP is 1120, the closest FP to 1120 in the Z6 (10X) fitting two-dimensional look-up table can be found ij , which is 1110 in Table 2, and the object distance WD 316 corresponding to FP 31 = 1110 is 180mm, which is the latest object distance after calibration.
[0094] S6, the user can perform zoom following or fast automatic focusing again, and the process is repeated as described above.
[0095] Specifically, under the zoom group magnification Z j , the object distance WD i may be different for different high and low regions of the observed object, and to achieve clear focusing of different regions of interest, the new limited range of the focusing group can be determined as the lens movement range during automatic focusing according to the current zoom group magnification Z j . According to the limited range of the focusing group position under the fixed zoom group magnification Z j , the most reasonable search step of single focusing group movement is analyzed to complete fast automatic focusing of the region of interest again.
[0096] In summary, after the object distance range of the zoom lens is determined, the zoom following relationship between the zoom group and the focusing group, i.e. the accurate two-dimensional look-up table, is established, thereby realizing zoom following and fast automatic focusing of the limited distance variable conjugate distance zoom lens. After the zoom following is completed, the two-dimensional look-up table can also be used to realize fast automatic refocusing for the object distance changes caused by different high and low regions of interest.
[0097] The above only describes the preferred embodiments of the present application, and is not intended to limit the present application. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An autofocusing method for a limited-teleconverter- conjugate- distance- variable- magnification lens, characterized by, The automatic focusing method comprises the following steps: (1) uniformly divide the magnification of the variable magnification group as the column index, uniformly divide the object distance of the variable magnification lens as the row index, and obtain the focusing group position by the full scan method according to the column index and the row index to construct a measurement two-dimensional lookup table; (2) polynomial fitting is performed on each column of data of the measurement two-dimensional lookup table, then the uniformly subdivided object distance is taken as a new row index, the fitting value of the corresponding focusing group position is calculated according to the fitted polynomial, and a fitting two-dimensional lookup table is constructed; (3) according to the current actual object distance of the variable magnification lens and the fitting two-dimensional lookup table, the variable magnification group and the focusing group are moved to realize variable magnification following; (4) after the variable magnification following is completed, the search range and the single search step of the focusing group are determined in the fitting two-dimensional lookup table according to the current variable magnification group magnification, and the hill climbing search method is used for rapid automatic focusing; (5) according to the current variable magnification group magnification and the current focusing group position value in the result of the automatic focusing, the closest focusing group position is reversely searched in the fitting two-dimensional lookup table, and the corresponding object distance is taken as a new current object distance; (6) according to the new current object distance and the fitting two-dimensional lookup table, steps (3)-(4) are repeated to perform subsequent variable magnification following and rapid automatic focusing; Wherein, compared with the uniform coarse division in step (1), the uniform subdivision of the object distance in step (2) means that the division is performed with smaller precision.
2. The method of claim 1, wherein, In step (1), the method for constructing the measurement two-dimensional lookup table FP(WD i ,Z j ) comprises the following steps: scanning the variable magnification group to j by j=1~N to obtain Z j , scanning the object distance WD by i=1~M to obtain WD i , scanning the entire mechanical stroke of the focusing group at the current WD i position by using the full-range scanning method to find the optimal focusing group position FP ij , and recording the optimal focusing group positions FP 1j , FP 2j ,…, FP Mj , respectively; and continuing to move the variable magnification group until j=N, and completing the construction of FP(WD i ,Z j ) as follows: Wherein, M and N are limited integers with practical application significance, and M generally takes a value between 5 and 10.
3. The method of claim 2, wherein the lens group is moved in the direction of the optical axis of the lens system by a distance corresponding to a distance between the lens group and the image sensor. In step (2), each column of data in the measurement two-dimensional lookup table is fitted with a cubic or higher order polynomial in the column direction, and the object distance WD is divided into k(M-1) equal parts according to the accuracy, k being an integer, to complete the fitting of the two-dimensional lookup table FP'(WD i j ) construction: Wherein, k is a limited integer with practical application significance, representing that the uniformly coarse divided object distance is uniformly subdivided into k equal parts according to the precision, and k is selected as 5, 10, 20 or 100 to facilitate the subdivision fitting of the data based on the working distance as the horizontal coordinate.
4. The method of claim 3, wherein the lens group is moved by a distance of 0.5 to 1.5 times a maximum movement distance of the lens group in the infinity variable conjugate zoom lens. In step (3), the current actual object distance is used as the row index WD i , the scan column index Z j controls the motion of the variable magnification group; the column index Z j acquires the variable focus group position FP ij from the fitted two-dimensional lookup table, and controls the motion of the focus group motor to achieve variable magnification following.
5. The method of claim 4, wherein, In step (4), the magnification of the power variation group Z j In the case of determination, the object distance WD1~WD kM The limited range FP of the focus group position within the focus group 1j ~FP kMj The focus group finds the maximum FV value of the focus area in this limited range to complete the fine focusing, and obtains the current focus group position value F xj .
6. The method of claim 5, wherein the lens is a limited teleconverter lens. In step (4), the search step size at each rate is taken as the corresponding rate Z j Quartile of the average slope of the curve reference points: SearchStep(Z j ) is the search step size at magnification Z j , M is the maximum row index, WD i is the distance between the object and the camera, and INT is the integer function.
7. The autofocus method for a finite-distance variable conjugate-distance zoom lens according to claim 5, characterized in that, In step (5), the closest focus group position is found by fitting a two-dimensional lookup table inverse contrast to the current zoom group magnification Z j and the current focus group position value F xj , which corresponds to the object distance WD i as the new current object distance WD x .
8. The method of claim 1, wherein, After each variable magnification following and automatic focusing is completed, if the user is interested in the areas with different heights of the sample, the automatic refocusing can be performed by clicking the area, and step (4) is repeated.
Citation Information
Patent Citations
Focusing curve establishing method and device
CN111147732A
Automatic focusing method, device and equipment and storage medium
CN111385466A
Synchronous focusing method and device during zoom process, storage medium and electronic terminal
CN110045562A
Method and device for correcting zoom tracking curve
WO2017107770A1