Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Embodiment one, specify referring to Fig. 2, Fig. 2 is the method flow sketch map of the embodiment of the invention.
Step 101: obtain the corresponding points of focusing evaluation value and focusing lens position under at least two object distances, the variation tendency of said corresponding points is the chevron curve.
Can be earlier obtain the corresponding points of focusing evaluation value and focusing lens position under at least two object distances according to following steps:
1, the aperture of fixed lens and convergent-divergent lens position are constant;
2, will test article and be fixed on camera lens before, the record resolution chart is to the distance between the camera lens; The test article can be resolution charts;
3, hold burnt end far away micro-stepping to move focusing lens from nearly Jiao, write down the focusing evaluation value in per step;
4, change the test article to the distance between the camera lens;
5, hold burnt end far away micro-stepping to move focusing lens from nearly Jiao, write down the focusing evaluation value in per step.
Along with hold more and more near the limit position from nearly Jiao the position of focusing lens, the focusing evaluation value also rises gradually, more and more near limit; And cross the limit position in the position of focusing lens, the focusing evaluation value then descends gradually, away from limit; So the variation tendency of the corresponding points of focusing evaluation value and focusing lens position is a chevron curve.
Step 102: adjust said corresponding points, corresponding points are evenly distributed in the hillside district of said curve, in the district of mountain top, have and have only three.
Usually, the hillside district is positioned at the scope of the 10%-90% of the curve longitudinal axis (normalization focusing evaluation value) greatest measure, and the mountain top district is positioned at the scope of the 88%-100% of curve longitudinal axis greatest measure, and the process of adjustment preferred point can be described as " chevron demarcation ".In the focusing process, focusing lens then only moves on selected good preferred point, and each preferred point number that strides across that moves can be described as step-length, and certainly, step-length is defined as the realization that other length do not influence the embodiment of the invention yet.
The available formula of normalization focusing evaluation value obtains:
fev=FEV/MAX
FEV
Wherein, fev is normalization focusing evaluation value (Nomalized FEV), and FEV is focusing evaluation value (Focus Evaluation Value), MAX
FEVThe maximum that refers to the focusing evaluation value.
Normalization focusing evaluation value image the most clearly the position be 1, this value more little image fuzzy more.The curvilinear motion contrast of " chevron demarcation " can be referring to Fig. 3 a and Fig. 3 b, and Fig. 3 a is the normalization assessed value curve synoptic diagram before chevron is demarcated, and Fig. 3 b is the calibrated normalization assessed value of a chevron curve synoptic diagram; Wherein, (1) is object distance when big, and (2) be object distance when moderate, (3) be object distance than hour.
Step 103: the Position Number of preserving said corresponding points.
The Position Number of preserving said corresponding points can adopt form, the position of said corresponding points numbered, and with the corresponding focusing lens position of N Position Number of Pos (N) expression.
Obviously, the Position Number of taking other forms to preserve corresponding points does not influence the realization of the embodiment of the invention yet.
The Pos (N) that the embodiment of the invention obtains can be preset in the audio and video products, also can before automatic focus, manually accomplish or acquisition automatically, does not influence the realization of the embodiment of the invention.
Embodiment of the invention utilization " chevron demarcation " method, the curve regular smooth of the variation tendency of the corresponding points of feasible reflection focusing evaluation value and focusing lens position, the bigger situation of focusing evaluation value deviation ratio of corresponding points before and after avoiding to a certain extent.
What following examples two were explained is the process of decision focusing lens moving step length in the automatic focus process, needs the Position Number of the corresponding points of use embodiment one preservation, obtains the focusing evaluation value of said corresponding points correspondence.
Embodiment two, specify referring to Fig. 4, Fig. 4 is the method flow sketch map of the embodiment of the invention.
Step 201: the focusing evaluation value of upgrading the focusing lens current location.
Step 202: according to the Position Number of the corresponding points of preserving, obtain the previous corresponding points and the corresponding focusing evaluation value of back corresponding points of focusing lens current location, said corresponding points are the corresponding points of focusing evaluation value and focusing lens position.
According to preset or manually or the Position Number of the corresponding points of obtaining automatically, obtain the corresponding focusing evaluation value of corresponding points.
Step 203: the variation tendency of obtaining the focusing lens current location focusing evaluation value corresponding with the front and back corresponding points.
Can be according to the focusing evaluation value of the current corresponding points of focusing lens position, previous corresponding points Position Number and a back corresponding points Position Number; Or the focusing evaluation value of focusing lens current location, previous corresponding points Position Number and the first two corresponding points Position Number; Calculate the variation tendency of the focusing evaluation value of current location, do not influence the realization of the embodiment of the invention.Variation tendency can be represented with focusing evaluation value deviation ratio.
Focusing evaluation value deviation ratio computing formula can for:
Focusing evaluation value deviation ratio DEV (N-1)=(FEV (N-1)-FEV (N))/FEV (N);
Focusing evaluation value deviation ratio DEV (N+1)=(FEV (N+1)-FEV (N))/FEV (N); Wherein, N represents the current location numbering, and N-1 then represents the previous Position Number of current location numbering, and N+1 then represents a back Position Number of current location numbering, and FEV (N), FEV (N-1), FEV (N+1) are the focusing evaluation value under the correspondence position.
Step 204: according to said variation tendency, the step-length that the decision focusing lens moves.
According to the relation of focusing evaluation value deviation ratio and predefined threshold value, judge the focusing lens current location at flat site, perhaps in the hillside district, perhaps in the mountain top district, perhaps in bottom zone.When focusing lens is in flat site, move focusing lens, when being in hillside district or mountain top district or bottom zone, then reduce moving step length with big step-length.
Big step-length can be the length that focusing lens once moves 3 preferred point, and little step-length can be once to move the length of 1 preferred point.When step-length was longer, the focusing lens change in location was big, step-length more in short-term, the focusing lens change in location is little.
Therefore, with the focusing of small step progress row, the focusing lens change in location is little in the mountain top district, and it is little to focus on the estimated value rate of change, avoids producing " deceptive movement " phenomenon.
The embodiment of the invention determines the step-length that focusing lens moves through the focusing evaluation value deviation ratio of the focusing evaluation value of the focusing lens current location focusing evaluation value corresponding with the front and back corresponding points; Make focusing lens only finely tune in the mountain top district, then step-length is less when finding limit, and the focusing lens shift in position is little, and the rate of change of focusing evaluation value is little, and image is not prone to " deceptive movement " phenomenon.
All scenery can be arranged on the different object distances in the practical application scene, so possibly there are a plurality of peak values in normalization focusing evaluation value with the corresponding curve of focusing lens position, Fig. 5 is a multi-peak normalization focusing evaluation value curve chart.4 top peak values are arranged among the figure, and top 1 is to be caused by the distant view contribution, and top 2 is to be caused by middle scape contribution, and top 3 is to be caused by the close shot contribution, and automatic focus can converge to one of them top peak value nearby according to current lens location.
Embodiment three, specify referring to Fig. 6, Fig. 6 is the method flow sketch map of the embodiment of the invention.
Step 301: the focusing evaluation value of upgrading the focusing lens current location.
Step 302: the rate of change that calculates focusing evaluation value before and after upgrading.
Step 303: judge whether said focusing evaluation value rate of change surpasses preset threshold value, if do not surpass, goes back to step 301, if surpass, changes step 304.
Threshold value can rule of thumb be worth flexible setting.
Step 301 to step 303 can be closed and is called monitor state, below each step can close and be called status of action.
Step 304: carry out the aspect test,, judge whether the focusing lens current location is positioned at the mountain top district, is then to go back to step 301 promptly according to focusing evaluation value deviation ratio.
Can be according to the focusing evaluation value of the current preferred point of focusing lens, adjacent last preferred point and an adjacent back preferred point correspondence position, calculate the focusing evaluation value deviation ratio of focusing evaluation value of focusing evaluation value and the adjacent front and back preferred point of current preferred point again.
Move the amasthenic lens position to Pos (N-1), obtain the focusing evaluation value FEV (N-1) of this position; Move the amasthenic lens position to Pos (N+1), obtain the focusing evaluation value FEV (N+1) of this position.
Focusing evaluation value deviation ratio computing formula can for:
Focusing evaluation value deviation ratio DEV (N-1)=(FEV (N-1)-FEV (N))/FEV (N);
Focusing evaluation value deviation ratio DEV (N+1)=(FEV (N+1)-FEV (N))/FEV (N); Wherein, N represents the numbering of current location, and N-1 then represents the numbering of the previous position of current location, and N+1 then represents the numbering of a back position of current location.According to DEV that calculates (N-1) and DEV (N+1), handle according to following principle respectively:
1., just think that position Pos (N) is positioned at the mountain top district if DEV (N-1) and DEV (N+1) are not more than-8%;
2., just think that Pos (N) is positioned at the bottom if DEV (N-1) and DEV (N+1) are not less than 8%;
If DEV (N-1) be not less than 8% and also DEV (N+1) be not more than 8%, just think that Pos (N-1) is positioned at nearly Jiao Po;
If DEV (N-1) between ± 8% and also DEV (N+1) be not more than-8%, just think that Pos (N-1) is positioned at nearly Jiao Po;
If DEV (N+1) be not less than 8% and also DEV (N-1) be not more than 8%, just think that Pos (N+1) is positioned at Jiao Po far away;
If DEV (N+1) between ± 8% and also DEV (N-1) be not more than-8%, just think that Pos (N+1) is positioned at Jiao Po far away;
7. if DEV (N-1) and DEV (N+1) between ± 8%, just think that Pos (N) is positioned at the flat region.
Step 305: confirm moving direction, little step-length moves 3 times.
The direction and the step-length that move can be carried out according to following rule:
A.Pos (N-1) then moves 3 times to burnt direction far away at nearly Jiao Po, each 1 little step-length;
B.Pos (N+1) then moves 3 times to nearly burnt direction at Jiao Po far away, each 1 little step-length;
C.Pos (N) divides two kinds of situation to handle in the bottom or the flat region:
1) N≤(FarEnd+NearEnd)/2, then move 3 times each 1 little step-length to burnt direction far away;
2) N>(FarEnd+NearEnd)/2, then move 3 times each 1 little step-length to nearly burnt direction.
Wherein, FarEnd and NearEnd are the pairing focusing lens Position Number of both sides end points in mountain area, the current place of focusing lens.
Step 306: carry out the aspect analysis.
The trend of analyzing the slope district is related to next step direction that moves of focusing lens, and analytic process can be described as " aspect analysis ".
The aspect analysis is after process is no less than moving of 3 little step-lengths, focusing evaluation value FEV (j) and the focusing lens Position Number N (j) that writes down to be analyzed, and confirms the focusing lens current position in the mountain top district, or flat region, perhaps mountain top district.Can carry out the aspect analysis according to following steps:
A. after this initialization j=0 whenever moves a focusing lens position j and adds 1, and record position numbering N (j) and focusing evaluation value FEV (j);
B. find the maximum FEVmax among FEV (j), FEV (j-1), the FEV (j-2) earlier; FEV (j-1) is the corresponding focusing evaluation value of previous Position Number; FEV (j-2) is the corresponding focusing evaluation values of preceding two Position Numbers, calculates focusing evaluation value deviation ratio DEV (j)=(FEV (j)-FEVmax)/FEVmax again; And the corresponding Nmax of record;
C. find minimum value Nfar and corresponding focusing evaluation value deviation ratio DEVfar among N (j), N (j-1), the N (j-2); And find maximum Nnear and the corresponding focusing evaluation value deviation ratio DEVnear among N (j), N (j-1), the N (j-2); Relatively the relation of DEVfar, DEVnear and threshold value confirms focusing lens is arranged in which zone of top, nearly Jiao Po, Jiao Po far away, flat region.With threshold value is 8% to be example, concrete rule as follows:
1) DEVfar and DEVnear are not more than-8%, think that then position Pos (Nmax) is positioned at the mountain top district;
2) DEVfar and DEVnear are not less than 8%, think that then Pos (Nmax) is positioned at the bottom;
3) DEVnear be not less than 8% and also DEVfar be not more than 8%, think that then Pos (Nfar) is positioned at nearly Jiao Po;
4) DEVfar between ± 8% and also DEVnear be not more than-8%, think that then Pos (Nfar) is positioned at nearly Jiao Po;
5) DEVnear be not less than 8% and also DEVfar be not more than 8%, think that then Pos (Nnear) is positioned at Jiao Po far away;
6) DEVnear between ± 8% and also DEVfar be not more than-8%, think that then Pos (Nnear) is positioned at Jiao Po far away;
7) DEVnear and DEVfar between ± 8%, think that then Pos (Nmax) is positioned at the flat region.
Step 307:, confirm direction and step-length that focusing lens moves according to the zone of living in of said focusing lens current location on said curve.
Step-length is divided into big step-length and little step-length, and big step-length can be defined as and once move 3 preferred point, and little step-length can be defined as and once move 1 preferred point, and certainly, the length that big step-length and little step-length are defined as other does not influence the realization of the embodiment of the invention yet.
Concrete moving direction and step-length are following:
If Pos (Nfar) at nearly Jiao Po, then moves 1 little step-length to burnt direction far away, get back to step 306 then;
If Pos (Nnear) at Jiao Po far away, then moves 1 little step-length to nearly burnt direction, get back to step 306 then;
If Pos (Nmax) in the bottom, then moves following 1 little step-length by former direction, get back to step 306 then;
If Pos (Nmax) in the flat region, then moves a big step-length by former direction, get back to step 306 then;
If Pos (Nmax) is on the mountain top, then next step gets back to Pos (Nmax), gets into step 308 then.
The embodiment of the invention when getting into sloping region or top region or bottom zone, initiatively reduces the step-length of focusing in the position that flat site moves focusing lens with bigger step-length.In the actual application, therefore limit possibly, all possibly repeat step 306 to 307 at any time moving after moving each time, adjust direction and step-length that focusing lens moves at any time, after finding at least one peak value, gets into step 308.
Step 308: after focusing lens moves on to the top peak, judge whether the peak change rate surpasses threshold value, surpasses and then thinks that peak changes, and goes back to step 306, seeks peak value again; If do not surpass threshold value, then think and found an effective peak value, then can return monitor state after the imaging.
Threshold value can rule of thumb be provided with flexibly.
The embodiment of the invention is confirmed focusing lens current location zone of living in through the focusing evaluation value deviation ratio of the focusing lens current location focusing evaluation value corresponding with the front and back corresponding points; Different according to the of living in zone of current location on the focusing evaluation value curve of rule; The step-length that the decision focusing lens moves: as move the position of focusing lens with bigger step-length at flat site; When getting into sloping region or top region or bottom zone, initiatively reduce the step-length of focusing; Make focusing lens only finely tune in the mountain top district, then step-length is less when finding limit, and the focusing lens shift in position is little, and the rate of change of focusing evaluation value is little, and image is not prone to " deceptive movement " phenomenon.The embodiment of the invention also adopts the feasible chevron curve regular smooth that embodies the corresponding points variation tendency of the method for " chevron demarcation "; The Position Number of corresponding points capable of using obtains corresponding focusing evaluation value in the automatic focus process; Accelerate to seek mountain speed, and promoted the accuracy of mountain top convergence.
The embodiment of the invention adopts " aspect test " and " aspect analysis " method, the zone of living in of initiatively grasping focusing lens, and direction that the active adjustment focusing lens moves and step-length make that focusing lens step-length when finding limit is less.
Need to prove; For aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions; But those skilled in the art should know; The present invention does not receive the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that details among certain embodiment, can be referring to the associated description of other embodiment.
The method of auto focus control more than is provided, and the embodiment of the invention also provides the device of auto focus control.
A kind of device 700 can be used for auto focus control, and referring to Fig. 7, Fig. 7 is the structural representation of embodiment of the invention device, comprising:
Corresponding points acquiring unit 701 is used to obtain the corresponding points of focusing evaluation value and focusing lens position under at least two object distances, and the variation tendency of said corresponding points is the chevron curve.
Adjustment unit 702 is used to adjust and obtains the said corresponding points that corresponding points unit 701 obtains, and corresponding points are evenly distributed in the hillside district of said curve, in the district of mountain top, has and have only three;
The hillside district is positioned at the scope of the 10%-90% of the curve longitudinal axis (normalization focusing evaluation value) greatest measure, and the available formula of normalization focusing evaluation value obtains:
fev=FEV/MAX
FEV
Wherein, fev is normalization focusing evaluation value (Nomalized FEV), and FEV is focusing evaluation value (Focus Evaluation Value), MAX
FEVThe maximum that refers to the focusing evaluation value.
Preserve Position Number unit 703, be used to preserve the Position Number of adjustment unit 702 adjusted said corresponding points, the corresponding focusing lens position of N Position Number of available Pos (N) expression.
Said corresponding points acquiring unit 701, also be used to change aperture and/or convergent-divergent lens position after, obtain the corresponding points of focusing evaluation value and focusing lens position under at least two object distances once more, the variation tendency of said corresponding points is the chevron curve;
Correspondingly, said adjustment unit 702 also is used for adjusting once more and obtains the said corresponding points that the corresponding points unit obtains once more, and corresponding points are evenly distributed in the hillside district of said curve, in the district of mountain top, has and have only three;
Said preservation Position Number unit 703 then also is used to preserve the adjustment unit Position Number of adjusted said corresponding points once more.A kind of device 800 can be used for auto focus control, and referring to Fig. 8, Fig. 8 is another structural representation of embodiment of the invention device, comprising:
Updating block 801 is used to upgrade the focusing evaluation value of focusing lens current location.
Obtain focusing evaluation value cell 802; Be used for Position Number according to the corresponding points of preserving; Obtain the previous corresponding points and the corresponding focusing evaluation value of back corresponding points of focusing lens current location, said corresponding points are the corresponding points of focusing evaluation value and focusing lens position; Position Number can be preset or before upgrading the focusing evaluation value of current location, manually or automatically obtain, do not influence the realization of the embodiment of the invention.
Obtain variation tendency unit 803, the focusing evaluation value that is used to obtain the focusing lens current location after updating block 801 upgrades with obtain focusing evaluation value cell 802 and obtain the variation tendency between the corresponding focusing evaluation value of previous corresponding points and back corresponding points of focusing lens current location;
Decision step-length unit 804 is used for according to obtaining the said variation tendency that variation tendency unit 803 obtains, the step-length that the decision focusing lens moves.
Said decision step-length unit 804 also can specifically be used for the focusing evaluation value deviation ratio according to the focusing evaluation value of the focusing lens current location focusing evaluation value corresponding with the front and back corresponding points; Judge the focusing lens current location when flat site, move focusing lens with big step-length; According to the focusing evaluation value deviation ratio of the focusing evaluation value of the focusing lens current location focusing evaluation value corresponding with the front and back corresponding points, judge the focusing lens current position in the hillside district or when mountain top district or bottom zone, reduce moving step length.
Further, said decision step-length unit 804 also can specifically be used for the relation according to focusing evaluation value deviation ratio and predefined threshold value, judges the focusing lens current location at flat site, perhaps in the hillside district, perhaps in the mountain top district, perhaps in bottom zone.
Said device 700 can be included in any one autofocus controlling apparatus with device 800, does not influence the realization of the embodiment of the invention.
The embodiment of the invention is confirmed focusing lens current location zone of living in through the focusing evaluation value deviation ratio of the focusing lens current location focusing evaluation value corresponding with the front and back corresponding points; Different according to the of living in zone of current location on the focusing evaluation value curve of rule; The step-length that the decision focusing lens moves: as move the position of focusing lens with bigger step-length at flat site; When getting into sloping region or top region or bottom zone, initiatively reduce the step-length of focusing; Make focusing lens only finely tune in the mountain top district, then step-length is less when finding limit, and the focusing lens shift in position is little, and the rate of change of focusing evaluation value is little, and image is not prone to " deceptive movement " phenomenon.
One of ordinary skill in the art will appreciate that; Realize all or part of flow process in the foregoing description method; Be to instruct relevant hardware to accomplish through computer program; Described program can be stored in the computer read/write memory medium, and this program can comprise the flow process like the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
More than the method and the device thereof of a kind of auto focus control that the embodiment of the invention provided carried out detailed introduction; Used concrete example among this paper principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.