CN100573219C - Automatic focusing method - Google Patents
Automatic focusing method Download PDFInfo
- Publication number
- CN100573219C CN100573219C CNB2007100079795A CN200710007979A CN100573219C CN 100573219 C CN100573219 C CN 100573219C CN B2007100079795 A CNB2007100079795 A CN B2007100079795A CN 200710007979 A CN200710007979 A CN 200710007979A CN 100573219 C CN100573219 C CN 100573219C
- Authority
- CN
- China
- Prior art keywords
- focusing
- value
- camera lens
- parameter
- peak value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Automatic Focus Adjustment (AREA)
Abstract
The invention provides a kind of method of automatic focusing, thus solve the consuming time and camera lens of focusing move many, and noise cause that focusing is slipped up and influence the problem of image definition value.The present invention utilizes the focusing step number table and the focusing parameter of camera lens, by defining the scope of sharpness peak value, searches number of times and reduce camera lens effectively.Therefore reduce the required search time of focusing automatically.The present invention has the short advantage of search time.In addition, the present invention can improve the puzzlement that noise causes in focusing.And the present invention proposes basic definition values BFV, and that make to judge definition values relatively has a reference data, thus automatically in the focusing judgement of definition values more clear and definite and stablize.
Description
Technical field
The present invention relates to a kind of automatic focusing method, relate in particular to the method for searching lens location in the automatic focusing with value of maximum articulation.
Background technology
Product such as digital camera, camera cell phone has been the camera installation of popularizing very much, and digital camera must be focused on correct object to obtain good photographic quality, and therefore, the method logarithmic code camera of focusing is very important automatically.
Prior art has some method for searching about automatic focusing, for example: universe search method (GlobalSearch).The universe search method is that the record camera lens whenever moves (or whenever moving a minimum sample unit) image that is obtained and the definition values of calculating its image that move a step, when camera lens is moved to all location searchings in regular turn, and obtain after the definition values of corresponding each location searching, and after search finishes, take out again and have utmost sharpness De Jing Head position , And moving lens and finish automatic focusing to having the utmost sharpness position.The search one of universe search method is looked for surely to the utmost sharpness image, and its search result is the most correct in all prior art focusing methods, but the number of times of needed search time and moving lens is maximum, so elapsed time.
Except time-consuming, the number of times that camera lens moves also must be listed consideration in, because camera lens moves around often, easily produces the collision of mechanical aspects and shortens the camera life-span.In addition, noise can impact the definition values of image, and the curve of its definition values and camera lens step number no longer is a smooth curve, but jagged irregular curve, because irregular articulation curve causes the error in the peak value judgement easily, thereby produce the error in the focusing.
Therefore need a kind of automatic focusing method that has correctness and focusing speed concurrently.
Summary of the invention
The objective of the invention is to provides a kind of automatic focusing method at the problems referred to above of prior art, especially a kind of focusing method of correctly and fast focusing automatically.
In a preferred embodiment, the present invention proposes a kind of automatic focusing method, and in order to judge the focusing position of camera lens, wherein camera lens is moved according to focusing step number table, comprises following steps:
(a) the record camera lens is at the pairing basic definition values BFV of reference position, and to write down this basis definition values BFV be value of maximum articulation MFV;
(b) according to focusing step number table moving lens to next focusing position, calculate and be recorded in the definition values of the image that this focusing position obtains, and be defined as present image definition value CFV;
(c) relatively this value of maximum articulation MFV and this present image definition value CFV, the greater is registered as value of maximum articulation MFV;
(d) calculate the ratio of present image definition value CFV and basic definition values BFV, wherein, during near parameter W, the peak detection number is added 1, and when this ratio was less than or equal to peak value near parameter W, this peak detection number did not change greater than peak value at this ratio;
(e) whether judge the peak detection number more than or equal to peak value range parameter C, and be focusing position during more than or equal to peak value range parameter C, move this camera lens to this focusing position and focusing with the pairing lens location of value of maximum articulation MFV at the peak detection number;
(f) at the peak detection number during less than peak value range parameter C, judge whether value of maximum articulation MFV and the ratio of present image definition value CFV leave parameter K greater than peak value, and when ratio leaves parameter K greater than peak value, with the pairing lens location of value of maximum articulation MFV is focusing position, moves this camera lens to this focusing position and focusing;
(g) when the ratio of value of maximum articulation MFV and present image definition value CFV does not leave parameter K greater than peak value, read in this focusing step number table next camera lens step number with respect to present camera lens step number, if not having next camera lens step number exists, with the pairing lens location of this value of maximum articulation MFV is this focusing position, move this camera lens to this focusing position and focusing, this focusing step number table is if there is next camera lens step number to exist
Repeating step (b) is to (g).
In a preferred embodiment, it is according to the characteristic decision of camera lens that focusing step number table, peak value leave parameter K near parameter W and peak value.
In a preferred embodiment, peak value range parameter C is according to the decision of the depth of field of camera lens.
The present invention compared with prior art has the short advantage of search time.In addition, the present invention also proposes peak value and leaves focusing parameters such as parameter K near parameter W, peak value range parameter C and peak value, can define the scope of sharpness peak value whereby, camera lens step number after this scope then needn't be searched again, reduce the camera lens step number of searching, further shortened search time.And when the definition values of image was affected by noise, the present invention still can hunt out the in-scope of its value of maximum articulation, so can improve the puzzlement that noise causes in focusing.In addition, the present invention proposes basic definition values BFV, and that make to judge definition values relatively has a reference data, thus automatically in the focusing judgement of definition values more clear and definite and stablize.
Description of drawings
This aspect can obtain more deep understanding by following accompanying drawing and explanation:
Fig. 1 is an automatic focusing process flow diagram of the present invention.
Fig. 2 (a), Fig. 2 (b) are the curve maps that definition values of the present invention and camera lens move step number.
Fig. 3 (a), Fig. 3 (b) are definition values of a preferred embodiment of the present invention and the curve map that camera lens moves step number.
The main element symbol description
The 101-109 step
BFV, CFV, MFV definition values
C peak value range parameter
CFV1-CFV10, CFVj, the present image definition value of CFVk, CFVt
The K peak value leaves parameter
S0-S10, Sc, Si, Sj, Sk, Sp, St camera lens step number
The W peak value is near parameter
Embodiment
As described in above-mentioned prior art, in order to improve the defective of prior art universe search method, the present invention proposes a kind of automatic focusing method.
Before beginning to carry out the inventive method, must calculate to obtain the focusing step number table of this camera lens according to the characteristic of camera lens.All step numbers that camera lens moves when being recorded in the focusing search in the focusing step number table.Because the characteristic difference of each camera lens, so the focusing step number table of each camera lens all is not quite similar.The depth of field (Depth of field) with camera lens is example, as is known to the person skilled in the art, optical element has the characteristic of the depth of field, that is the image that in field depth, obtained of object can be regarded as clear, therefore a plurality of camera lens step numbers in field depth can one of them camera lens step number be representative, so just can save some search times.And because the depth of field has the phenomenon that part overlaps mutually, therefore camera lens need only be moved in another field depth, can continue focusing with saving time and search.The representative of the camera lens step number in these depth of field then is recorded in the focusing step number table, more than is the formation principle of focusing step number table.
In addition, before the inventive method begins, need default remaining focusing parameter, comprise: peak value leaves parameter K near parameter W, peak value range parameter C and peak value, wherein peak value range parameter C is that the depth of field by camera lens decides, peak value leaves parameter K then by the characteristic decision of camera lens near parameter W and peak value, and these focusing parameters obtain via experiment.
See also Fig. 1, it is an automatic focusing process flow diagram of the present invention.When focusing begins automatically, camera lens and peak detection are counted initialization (just making zero), camera lens is when reference position, (Focus Value FV), and is defined as basic definition values (Based Focus Value with the definition values of this reference position to the record camera lens in the definition values of this reference position, BFV), and (Maximum Focus Value, MFV), this is a step 101 for value of maximum articulation to write down this value.Then read next focusing step number so that camera lens moves to next focusing position, and wait at new image (step 102) that focusing position obtained from focusing step number table.After new image obtains, calculate and write down the definition values of this new image and it is defined as present image definition value that (Current Focus Value, CFV), this is a step 103.Relatively value of maximum articulation and image definition value at present, and the record higher value is value of maximum articulation MFV, this is a step 104.Step 105 compares near parameter W for ratio (CFV/BFV just) and the peak value with present image definition value CFV and basic definition values BFV, when this ratio (CFV/BFV) greater than peak value during near parameter W, the peak detection number adds up 1, and when this ratio (CFV/BFV) not greater than peak value during near parameter W, the peak detection number does not change.After relatively finishing, enter step 106, judge that promptly whether the peak detection number is more than or equal to peak value range parameter C.If the peak detection number during more than or equal to peak value range parameter C, enters step 109, just moving lens finishes focusing then to the focusing position with value of maximum articulation MFV and gather image.If the peak detection number during less than peak value range parameter C, then enters step 107, promptly relatively value of maximum articulation MFV with ratio (MFV/CFV just) and the peak value of image definition value CFV leave parameter K at present.When this ratio (MFV/CFV) when leaving parameter K greater than peak value, then enter step 109, finish focusing afterwards.When this ratio (MFV/CFV) does not leave parameter K greater than peak value, enter step 108, just read in the focusing step number table next camera lens step number with respect to present camera lens step number.Do not exist if there has been next camera lens step number, all the camera lens step numbers in the step number table of promptly will having focused were searched, and then entered step 109.And if still have next camera lens step number to exist, then moving lens is to the position of next focusing step number, and this is a step 108.After the step 108, get back to step 102, circulation so repeatedly is till meeting the condition that finishes focusing.More than be focus the automatically flow process of method of the present invention.
Next the meaning of the focusing parameter that the present invention proposes is described, just peak value near parameter W, peak value range parameter C and peak value leave parameter K the meaning of representative separately.See also Fig. 2 (a), Fig. 2 (b), it moves the curve map of step number for definition values of the present invention and camera lens.Among Fig. 2 (a),, when promptly the camera lens step number is Si, has basic definition values BFV, and when the camera lens step number is the position of Sj, have present image definition value CFVj in reference position.Again camera lens is moved to the position that the camera lens step number is Sk, have present image definition value CFVk.After experiment repeatedly, find to go up the value of the value of CFVj/BFV less than CFVk/BFV at desirable articulation curve (smooth curve), just the ratio of image definition value and basic definition values can be increasing at present.And when camera lens has arrived the camera lens step number and has been the position of St, its present image definition value is CFVt, and the value of CFVt/BFV can be a bit larger tham peak value near parameter W, the position of then representing camera lens is near the position of sharpness peak value (being the image definition maximal value), just best focusing position.Learn by experiment, when CFVt/BFV value beginning greater than the W value, moving lens specific times again must search the position of sharpness peak value, and the present invention is defined as peak value range parameter C with this specific times.That is to say, when the camera lens step number is St, moving lens C time and to arrive the camera lens step number be Sc again, then the sharpness peak value must be in the scope between St and the Sc.But if articulation curve is affected by noise, then Ci Shi articulation curve has many fluctuatings, and causes CFV/BFV value beginning greater than after the W value, at the CFV/BFV of next focusing position ratio less than the W value, thus, even continuous moving lens more also can't be found out the scope of sharpness peak value for C time.When facing this kind situation, still continue moving lens, even the value of CFV/BFV still continues to search less than W, as long as the peak detection number more than or equal to peak value range parameter C, can be found out the scope of sharpness peak value.In other words, when peak detection number " accumulative total " during, promptly comprised the scope of sharpness peak value more than or equal to the C value.
Among Fig. 2 (b), position at camera lens step number Sp, has value of maximum articulation MFV (being the sharpness peak value), when camera lens is moved to the camera lens step number and is Sj, has present image definition value CFVj, camera lens is moved to the position that the camera lens step number is Sk, have present image definition value CFVk this moment again, and the MFV/CFVj value is less than the MFV/CFVk value.That is to say that value of maximum articulation is with the ratio of image definition value can be increasing at present.When camera lens moves to the camera lens step number and is St, the definition values of its position is CFVt, and being a bit larger tham peak value, MFV/CFVt leaves parameter K, with above-mentioned peak value near the situation of parameter W in like manner, represent that then camera lens begins away from the sharpness peak value, therefore do not need to proceed again the focusing of ensuing camera lens step number, only need the focusing position of value of maximum articulation MFV that camera lens is moved at that time to be write down can finish focusing.
See also Fig. 3 (a), Fig. 3 (b), it moves the curve map of step number for definition values of a preferred embodiment of the present invention and camera lens.In the present embodiment, default focusing step number table, and set peak value range parameter C and equal 5, peak value leaves parameter K and equals 1.5, and peak value equals 1.3 near parameter W.
Among Fig. 3 (a), camera lens is when reference position (being that the camera lens step number equals S0), and record is positioned at the definition values of reference position, just basic definition values BFV, and this moment, basic definition values was value of maximum articulation MFV also, and the peak detection number equals 0.Read focusing step number table, make camera lens move the S1 step, begin focusing and wait for new image, then calculate the present image definition value CFV1 that is positioned at S1.Compare BFV and CFV1 then, learn CFV1>BFV, then value of maximum articulation MFV is recorded as CFV1.Value and the peak value of CFV1/BFV are compared near parameter W (its value is 1.3), then obtain CFV1/BFV less than W, so the peak detection number does not change (remaining 0).And the peak detection number is certainly less than peak value range parameter C (its value is 5), then again the value of MFV/CFV1 is left parameter K (its value is 1.5) with peak value and compares, this moment MFV=CFV1, must MFV/CFV1=1, so MFV/CFV1<K.Whether read focusing step number table then has next camera lens step number to exist, read next camera lens step number this moment is S2, then moving lens equals the position of S2 to the camera lens step number, the present image definition value CFV2 of this moment is calculated in focusing then, CFV2>CFV1 again, so MFV changes to CFV2, then carry out every comparison in regular turn, obtain CFV2/BFV less than W, the peak detection number is less than peak value range parameter C, and MFV/CFV2=1<K.Read focusing step number table again, by that analogy, so to proceed to the camera lens step number repeatedly be S5 focusing when finishing to situation, MFV=CFV5 on this ideal articulation curve.
Among Fig. 3 (b), when camera lens moves to the camera lens step number when being S6, its definition values CFV6>CFV5, therefore MFV changes to CFV6, and the value of CFV6/BFV greater than peak value near parameter W, so the peak detection number is increased to 1 by 0, but the peak detection number is still less than K, and MFV/CFV6=1<K.Therefore read focusing step number table and camera lens is moved to the position of S7, get its definition values CFV7>CFV6, MFV changes to CFV7, and the value of CFV7/BFV,, is analogized on this ideal articulation curve so the peak detection number is increased to 2 by 1 near parameter W greater than peak value, when camera lens moves to the position of S9, its CFV9=MFV, the value of CFV9/BFV greater than peak value near parameter W, so the peak detection number becomes 4.And camera lens moves to the focusing position of S10, though its definition values CFV10<MFV, the value of CFV10/BFV still greater than peak value near parameter W, therefore so the peak detection number becomes 5=C, can learn, in the scope of sharpness peak value between S6 to S10.At this moment camera lens is moved to the position of the MFV of last record, just have the S9 position focusing of CFV9, focusing finishes automatically.As for satisfying the MFV/CFV value, in Fig. 2 (b), propose, so repeat no more greater than K value and situation affected by noise.
Automatic focusing method of the present invention is utilized the depth of field and the focusing step number table formulated, makes the present invention shorter than the search time of the universe search method of prior art.In addition, also propose peak value and leave focusing parameters such as parameter K near parameter W, peak value range parameter C and peak value, can define the scope of sharpness peak value whereby, the camera lens step number after this scope then needn't be searched again, make the camera lens step number of searching reduce, search time is also just shorter.When the definition values of image was affected by noise, the present invention still can hunt out the in-scope of its value of maximum articulation, did not influence the judgement of sharpness peak value because of noise, so the present invention can improve the puzzlement that noise is caused in focusing.In addition, in different scenes, the onesize readability that definition values showed is different.Therefore, the present invention proposes basic definition values BFV, can be at each focusing previous crops for comparing the benchmark of definition values, with the relative reference value as different scenes, make judge definition values relatively have a reference data, so automatically in the focusing judgement of definition values more clear and definite and stablize.
The above is preferred embodiment of the present invention only, is not in order to limiting scope of the present invention, and therefore all other do not break away from the equivalence of being finished under the disclosed spirit and change or revise, and all should be contained in the scope of the present invention.
Claims (3)
1, a kind of automatic focusing method, in order to judge the focusing position of camera lens, wherein this camera lens is moved according to focusing step number table, comprises following steps:
(a) write down this camera lens at the pairing basic definition values BFV of reference position, and to write down this basis definition values BFV be value of maximum articulation MFV;
(b) move this camera lens to next focusing position according to this focusing step number table, calculate and be recorded in the definition values of the image that this focusing position obtains, and be defined as present image definition value CFV;
(c) relatively this value of maximum articulation MFV and this present image definition value CFV, the greater is registered as value of maximum articulation MFV;
(d) calculate the ratio of this present image definition value CFV and this basis definition values BFV, wherein, during near parameter W, the peak detection number is added 1, and when this ratio was less than or equal to peak value near parameter W, this peak detection number did not change greater than peak value at this ratio;
(e) judge that whether this peak detection number is more than or equal to peak value range parameter C, and be this focusing position with the pairing lens location of this value of maximum articulation MFV at this peak detection number during more than or equal to this peak value range parameter C, move this camera lens to this focusing position and focusing;
(f) at this peak detection number during less than this peak value range parameter C, judge whether this value of maximum articulation MFV and the ratio of this present image definition value CFV leave parameter K greater than peak value, and when this ratio leaves parameter K greater than this peak value, with the pairing lens location of this value of maximum articulation MFV is this focusing position, moves this camera lens to this focusing position and focusing;
(g) when the ratio of this value of maximum articulation MFV and this present image definition value CFV does not leave parameter K greater than this peak value, read in this focusing step number table next camera lens step number with respect to present camera lens step number, if not having next camera lens step number exists, with the pairing lens location of this value of maximum articulation MFV is this focusing position, move this camera lens to this focusing position and focusing, this focusing step number table is if there is next camera lens step number to exist, and repeating step (b) is to (g).
2, automatic focusing method as claimed in claim 1, wherein to leave parameter K near parameter W and this peak value be according to the characteristic decision of this camera lens for this focusing step number table, this peak value.
3, automatic focusing method as claimed in claim 1, wherein this peak value range parameter C is according to the decision of the depth of field of this camera lens.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100079795A CN100573219C (en) | 2007-02-01 | 2007-02-01 | Automatic focusing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100079795A CN100573219C (en) | 2007-02-01 | 2007-02-01 | Automatic focusing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101236289A CN101236289A (en) | 2008-08-06 |
CN100573219C true CN100573219C (en) | 2009-12-23 |
Family
ID=39920028
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007100079795A Expired - Fee Related CN100573219C (en) | 2007-02-01 | 2007-02-01 | Automatic focusing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100573219C (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101778212B (en) * | 2009-01-12 | 2012-05-23 | 华晶科技股份有限公司 | Automatic focusing method in strong noise environment and device thereof |
KR101905408B1 (en) * | 2012-01-17 | 2018-10-08 | 엘지이노텍 주식회사 | Camera module, auto focus method and auto focus calibration method |
CN103777338A (en) * | 2012-10-26 | 2014-05-07 | 韩东 | Realization method and device for automatic focusing of early-stage cancer detection device |
CN106707462B (en) * | 2015-07-30 | 2019-07-23 | 炬芯(珠海)科技有限公司 | A kind of method and device of auto-focusing |
CN106507102B (en) * | 2016-11-18 | 2018-09-18 | 浙江宇视科技有限公司 | A kind of lens correction method and device |
CN110381261B (en) * | 2019-08-29 | 2020-11-03 | 重庆紫光华山智安科技有限公司 | Focusing method, focusing device, computer-readable storage medium and electronic equipment |
CN110855885B (en) * | 2019-11-14 | 2021-02-02 | 浙江大华技术股份有限公司 | Lens rotation control method and device |
-
2007
- 2007-02-01 CN CNB2007100079795A patent/CN100573219C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN101236289A (en) | 2008-08-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100573219C (en) | Automatic focusing method | |
CN106921830B (en) | Automatic focusing method and device | |
CN104102068B (en) | Atomatic focusing method and automatic focusing mechanism | |
US9767790B2 (en) | Voice retrieval apparatus, voice retrieval method, and non-transitory recording medium | |
CN110381261B (en) | Focusing method, focusing device, computer-readable storage medium and electronic equipment | |
CN110674396B (en) | Text information processing method and device, electronic equipment and readable storage medium | |
CN109993040A (en) | Text recognition method and device | |
CN103595920A (en) | Image collection equipment and auxiliary focusing method and device in zooming process | |
US9565356B2 (en) | Optimizing capture of focus stacks | |
CN105049723B (en) | Atomatic focusing method based on defocusing amount difference qualitative analysis | |
CN101071251B (en) | Method for estimating automatic focusing least effective sampling points | |
CN103970733A (en) | New Chinese word recognition method based on graph structure | |
CN110324536B (en) | Image change automatic sensing focusing method for microscope camera | |
CN103354599A (en) | Automatic focusing method applied to moving light source scene and automatic focusing apparatus | |
US8125560B1 (en) | System for topology based automatic focus | |
CN111010507B (en) | Camera auto-focusing method and apparatus, analysis instrument, and storage medium | |
CN114111758B (en) | Map data processing method and device | |
CN117579814B (en) | Quick lens detection method based on focusing detection | |
CN105827962A (en) | Correction method and device of movement back focal length deviation of camera | |
CN111753953A (en) | Method and device for acquiring neural network architecture | |
CN101751465A (en) | Method and system for determining similar word with input string | |
CN103472658A (en) | Auto-focusing method | |
CN111428589B (en) | Gradual transition identification method and system | |
CN111191587B (en) | Pedestrian re-identification method and system | |
CN112904548B (en) | Endoscope focusing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20091223 Termination date: 20190201 |
|
CF01 | Termination of patent right due to non-payment of annual fee |