CN101236289A - Automatic focusing method - Google Patents

Automatic focusing method Download PDF

Info

Publication number
CN101236289A
CN101236289A CNA2007100079795A CN200710007979A CN101236289A CN 101236289 A CN101236289 A CN 101236289A CN A2007100079795 A CNA2007100079795 A CN A2007100079795A CN 200710007979 A CN200710007979 A CN 200710007979A CN 101236289 A CN101236289 A CN 101236289A
Authority
CN
China
Prior art keywords
value
focusing
camera lens
peak value
parameter
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.)
Granted
Application number
CNA2007100079795A
Other languages
Chinese (zh)
Other versions
CN100573219C (en
Inventor
徐纬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Primax Electronics Ltd
Original Assignee
Primax Electronics Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Primax Electronics Ltd filed Critical Primax Electronics Ltd
Priority to CNB2007100079795A priority Critical patent/CN100573219C/en
Publication of CN101236289A publication Critical patent/CN101236289A/en
Application granted granted Critical
Publication of CN100573219C publication Critical patent/CN100573219C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Automatic Focus Adjustment (AREA)

Abstract

The present invention provides a method for automatic focusing, which solves the problems that the focusing time consumption and the lens displacement are excessive, and the image fineness is influenced by the focusing failure caused by noise. By defining the range of fineness peak value, the times of lens searching can be effectively reduced through the utilization of a focusing procedure table and focusing parameters, so that the searching time required by automatic focusing is reduced. The method has the advantage of short searching time. Besides, the method is capable of improving the fact that focusing is disturbed by noise; and the invention provides a basic fineness value BFV, which facilitates that a basis reference for judging the comparison of the fineness values is provided, so that the judgment of the fineness value during automatic focusing is clearer and more stable.

Description

Automatic focusing method
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;
(b) foundation is focused step number table moving lens to current position, and calculates the present image definition value CFV of corresponding current position;
(c) record value of maximum articulation MFV;
(d) calculate the ratio of present image definition value CFV and basic definition values BFV, and the peak detection number is added 1 greater than peak value during near parameter W at 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 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, be focusing position with the pairing lens location of value of maximum articulation MFV;
(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, foundation focusing step number table moving lens is to next focusing position; And
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. 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;
(b) move this camera lens to current position according to this focusing step number table, and calculate present image definition value CFV that should current position;
(c) record value of maximum articulation MFV;
(d) calculate the ratio of this present image definition value CFV and this basis definition values BFV, and the peak detection number is added 1 greater than peak value during near parameter W at this ratio;
(e) whether judge this peak detection number more than or equal to peak value range parameter C, and be this focusing position during more than or equal to this peak value range parameter C with the pairing lens location of this value of maximum articulation MFV at this peak detection number;
(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, be this focusing position with the pairing lens location of this value of maximum articulation MFV;
(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, move this camera lens to next focusing position according to this focusing step number table; 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.
CNB2007100079795A 2007-02-01 2007-02-01 Automatic focusing method Expired - Fee Related CN100573219C (en)

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 true CN101236289A (en) 2008-08-06
CN100573219C 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)

Cited By (7)

* Cited by examiner, † Cited by third party
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
CN103209306A (en) * 2012-01-17 2013-07-17 Lg伊诺特有限公司 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
CN106507102A (en) * 2016-11-18 2017-03-15 浙江宇视科技有限公司 A kind of lens correction method and device
CN106707462A (en) * 2015-07-30 2017-05-24 炬芯(珠海)科技有限公司 Automatic focusing method and device
CN110381261A (en) * 2019-08-29 2019-10-25 重庆紫光华山智安科技有限公司 Focus method, device, computer readable storage medium and electronic equipment
CN110855885A (en) * 2019-11-14 2020-02-28 浙江大华技术股份有限公司 Lens rotation control method and device

Cited By (10)

* Cited by examiner, † Cited by third party
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
CN103209306A (en) * 2012-01-17 2013-07-17 Lg伊诺特有限公司 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
CN106707462A (en) * 2015-07-30 2017-05-24 炬芯(珠海)科技有限公司 Automatic focusing method and device
CN106707462B (en) * 2015-07-30 2019-07-23 炬芯(珠海)科技有限公司 A kind of method and device of auto-focusing
CN106507102A (en) * 2016-11-18 2017-03-15 浙江宇视科技有限公司 A kind of lens correction method and device
CN106507102B (en) * 2016-11-18 2018-09-18 浙江宇视科技有限公司 A kind of lens correction method and device
CN110381261A (en) * 2019-08-29 2019-10-25 重庆紫光华山智安科技有限公司 Focus method, device, computer readable storage medium and electronic equipment
CN110381261B (en) * 2019-08-29 2020-11-03 重庆紫光华山智安科技有限公司 Focusing method, focusing device, computer-readable storage medium and electronic equipment
CN110855885A (en) * 2019-11-14 2020-02-28 浙江大华技术股份有限公司 Lens rotation control method and device

Also Published As

Publication number Publication date
CN100573219C (en) 2009-12-23

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
CN106534676B (en) Autofocus adjustment method towards zooming camera system
CN103595920B (en) Assisted focused method and device during image capture device, zoom
CN110381261B (en) Focusing method, focusing device, computer-readable storage medium and electronic equipment
CN108628061B (en) Self-adaptive automatic focusing method and device for industrial camera
CN110324536B (en) Image change automatic sensing focusing method for microscope camera
US20150312469A1 (en) Passive auto-focus device and method
CN101071251B (en) Method for estimating automatic focusing least effective sampling points
CN107590234B (en) RANSAC-based indoor visual positioning database redundant information reduction method
CN105049723B (en) Atomatic focusing method based on defocusing amount difference qualitative analysis
CN103354599A (en) Automatic focusing method applied to moving light source scene and automatic focusing apparatus
CN117579814B (en) Quick lens detection method based on focusing detection
CN111010507A (en) Camera auto-focusing method and apparatus, analysis instrument, and storage medium
CN105827962A (en) Correction method and device of movement back focal length deviation of camera
CN112904548B (en) Endoscope focusing method and device
CN110428447B (en) Target tracking method and system based on strategy gradient
CN112857376A (en) Vehicle road matching method and device
JP2006220914A (en) Designing method for optical system, computer program and computer program recording medium
CN116664867A (en) Feature extraction method and device for selecting training samples based on multi-evidence fusion
CN116980757A (en) Quick focusing method, focusing map updating method, device and storage medium
CN115393655A (en) Method for detecting industrial carrier loader based on YOLOv5s network model
CN108154521B (en) Moving target detection method based on target block fusion
CN111191587A (en) Pedestrian re-identification method and system

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