CN107483820A - A kind of quick focus method and device of the focusing of contrast formula - Google Patents
A kind of quick focus method and device of the focusing of contrast formula Download PDFInfo
- Publication number
- CN107483820A CN107483820A CN201710730780.9A CN201710730780A CN107483820A CN 107483820 A CN107483820 A CN 107483820A CN 201710730780 A CN201710730780 A CN 201710730780A CN 107483820 A CN107483820 A CN 107483820A
- Authority
- CN
- China
- Prior art keywords
- depth
- focusing
- field parameter
- camera lens
- field
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Automatic Focus Adjustment (AREA)
Abstract
The present invention provides a kind of quick focus method of contrast formula focusing, determines camera lens, the depth of field parameter that the camera lens is in each position is calculated;By the depth of field parameter being calculated, the step-length of lens focusing is determined;The present invention also provides a kind of quick focus device of contrast formula focusing, determines that the field depth characteristic of camera lens can be made full use of after camera lens, simple to determine camera lens per the most long step-length of moved further.Use this method, it is ensured that often walked all in the case of most long step-length in camera lens, judge whether focus, so as to will not both make step-length is too poor to cause to run Jiao, and can makes focusing time shorten significantly.
Description
Technical field
The present invention relates to the quick focus method and device of a kind of contrast formula focusing.
Background technology
Contrast formula, which is focused, is widely used in camera, mobile phone, and in the focusing of camera, it can be in no increase physical hardware
On the basis of, realize fast and accurate focus, the principle of contrast formula focusing is as follows:Drive camera lens movement, the position passed through to camera lens
Image sampling is carried out, the contrast value of image is obtained, by the comparison of contrast value, obtains the position of the camera lens of maximum contrast value, is driven
Index glass head is to the position, so as to obtain clearly image.Briefly the focusing of contrast formula is exactly an algorithm for looking for maximum, is calculated
The each manufacturer of method has, but every algorithm all differs widely, and performance difference is huge, and can realize high performance algorithm is even more to bend
Refer to denumerable.Realize fast and accurate focusing, except the hardware supporteds such as imaging sensor, image processor, lens driving motor it
Outside, with greater need for the support of outstanding algorithm.
In the focusing of contrast formula, camera lens can be moved by drives edge axis, and determine the step-length that camera lens moves every time is a weight
The problem of wanting, if step-length is too small, although can improve the precision of image sampling, the shifting in entirely focusing stroke can be caused
The dynamic time is elongated, and focusing speed is slow;If step-length is too big, although traveling time contracting of the camera lens in entirely focusing stroke can be made
It is short, but the sampling precision of image can be caused to decline, focusing is inaccurate.
The content of the invention
The technical problem to be solved in the present invention, it is to provide a kind of quick focus method and device of the focusing of contrast formula,
It is easy to camera lens rapid focus, and ensures the sampling precision of image.
What one of present invention was realized in:A kind of quick focus method of contrast formula focusing, it is characterised in that:Including such as
Lower step:
Step 1, camera lens is determined, the depth of field parameter that the camera lens is in each position is calculated;
Step 2, the depth of field parameter by being calculated, determine the step-length of lens focusing.
Further, depth of field parameter includes preceding depth of field parameter and rear depth of field parameter, the preceding depth of field parameter in the step 1
Calculation formula is:L1=(F* δ * L^2)/(f^2+F* δ * L);Depth of field parameter calculation formula is after described:L2=(F* δ * L^2)/
(f^2-F*δ*L);Wherein, δ is allows disperse circular diameter, and f is lens focus, and F is the aperture of camera lens, and L is object distance.
Further, the step 2 is specially further:By the depth of field parameter being calculated, by camera lens current location
Subtract the position before movement and obtain difference, if the depth of field parameter of current location and the depth of field parameter of the position before movement be not heavy
Close, then take step-length of the absolute value of the difference as focusing;It is no, then the absolute value of the difference is subtracted into camera lens movement minimum bit
Move the step-length as focusing.
What the two of the present invention were realized in:A kind of quick focus device of contrast formula focusing, it is characterised in that:Including such as
Lower module:
Depth of field determining module, determines camera lens, and the depth of field parameter that the camera lens is in each position is calculated;
It is determined that focusing step-length module, by the depth of field parameter being calculated, determines the step-length of lens focusing.
Further, depth of field parameter includes preceding depth of field parameter and rear depth of field parameter in the depth of field determining module, before described
Depth of field parameter calculation formula is:L1=(F* δ * L^2)/(f^2+F* δ * L);Depth of field parameter calculation formula is after described:L2=(F*
δ*L^2)/(f^2-F*δ*L);Wherein, δ is allows disperse circular diameter, and f is lens focus, and F is the aperture of camera lens, L be object away from
From.
Further, it is described to determine that focusing step-length module is specially further:By the depth of field parameter being calculated, by mirror
The position that head current location is subtracted before movement obtains difference, if the depth of field parameter of current location and the depth of field of the position before movement are joined
Number does not overlap, then takes step-length of the absolute value of the difference as focusing;It is no, then the absolute value of the difference is subtracted into the camera lens and moved
Step-length of the dynamic least displacement as focusing.
The invention has the advantages that:The present invention a kind of quick focus method and device of the focusing of contrast formula, determine mirror
The field depth characteristic of camera lens can be made full use of after head, it is simple to determine camera lens per the most long step-length of moved further., can be with using this method
Ensure often to walk all in the case of most long step-length in camera lens, judge whether focus, so as to will not both make step-length is too poor to cause to run Jiao,
And can makes focusing time shorten significantly.
Brief description of the drawings
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is the inventive method execution flow chart.
Embodiment
As shown in figure 1, the quick focus method of contrast formula focusing of the present invention, it is characterised in that:Comprise the following steps:
Step 1, camera lens is determined, the depth of field parameter that the camera lens is in each position is calculated, the depth of field parameter includes
Preceding depth of field parameter and rear depth of field parameter, the preceding depth of field parameter calculation formula are:L1=(F* δ * L^2)/(f^2+F* δ * L);Institute
Stating rear depth of field parameter calculation formula is:L2=(F* δ * L^2)/(f^2-F* δ * L);Wherein, for δ to allow disperse circular diameter, f is mirror
Head focal length, F are the aperture of camera lens, and L is object distance;
Step 2, the depth of field parameter by being calculated, the position that camera lens current location is subtracted before movement is obtained into difference,
If the depth of field parameter of current location does not overlap with the depth of field parameter of the position before movement, the absolute value conduct pair of the difference is taken
Burnt step-length;It is no, then the absolute value of the difference is subtracted into step-length of the camera lens movement least displacement as focusing.
The quick focus device of contrast formula focusing of the present invention, it is characterised in that:Including following module:
Depth of field determining module, determines camera lens, and the depth of field parameter that the camera lens is in each position, the depth of field ginseng is calculated
Number includes preceding depth of field parameter and rear depth of field parameter, and the preceding depth of field parameter calculation formula is:L1=(F* δ * L^2)/(f^2+F* δ *
L);Depth of field parameter calculation formula is after described:L2=(F* δ * L^2)/(f^2-F* δ * L);Wherein, δ is to allow disperse circular diameter,
F is lens focus, and F is the aperture of camera lens, and L is object distance;
It is determined that focusing step-length module, by the depth of field parameter being calculated, the position before movement is subtracted by camera lens current location
Put to obtain difference, if the depth of field parameter of current location does not overlap with the depth of field parameter of the position before movement, take the difference
Step-length of the absolute value as focusing;It is no, then the absolute value of the difference is subtracted into step of the camera lens movement least displacement as focusing
It is long.
Step 1. first, determines the depth of field parameter of the camera lens, and after the determination of camera lens type selecting, this parameter can be calculated
Out.
Field depth principle and calculating:Parallel rays inject convex lens when, preferable camera lens by all light-ray condensings on one point, this
It is individual, just it is called focus, the distance of focus and lens optical center is called focal length.Light continues to diverge with taper after overfocus
Come.
Blur circle:Before and after focus, light then has diffusion from diffusion, the video of point is gathered from circle to point (focus)
To circle, the circle of this focus front and back is just called blur circle.Allow disperse circular diameter:If this circle is sufficiently small, naked eyes
Imaging a little can be still considered as.This can be referred to as allowing disperse circular diameter with received maximum gauge.Herein can be with
Find out:The depth of field is relative, is not absolute, and disperse circular diameter δ value size has direct relation.While we
It can be seen that:The size of disperse circular diameter δ value is relevant with the technical capability of camera lens production firm.Typically conventional numerical value is:
Picture | 24mm*36mm | 6cm*9cm | 4"*5" |
Allow disperse circular diameter δ | 0.035mm | 0.0817mm | 0.146mm |
The depth of field:In focusing, by camera lens will on focal plane blur-free imaging, and the prospect of focusing and background are also in Jiao
Planar imaging, as long as the blur circle that they are imaged, which is equal to or less than, is allowed disperse circular diameter, we are considered clearly, so
Image just has the clearly section of one, and here it is the depth of field
Respectively there is one before and after focus and allow blur circle, we call it and are depth of focus the distance between the two blur circles,
It and the depth of field are corresponding.Calculate scape-depth of focus corresponding table:
Step 2. confirms the depth of field before the step-length that lens focusing often walks according to above scape-depth of focus corresponding table:L1=(F* δ * L^
2)/(f^2+F* δ * L), the rear depth of field:L2=(F* δ * L^2)/(f^2-F* δ * L), δ:Allow disperse circular diameter, f:Lens focus,
F:The aperture of camera lens, L:Object distance,
Lens shift are camera lens current location in table, and Far Field are rear depth of field parameter, and Near Field are the preceding depth of field
Parameter, this table can be calculated by formula above, but be to test multiple samples by laboratory to determine.
When lens location is 1um (i.e. -0.0001mm in table), all focuss from infinity INF to near-end 2.42m, camera lens moves
When moving 10um (i.e. -0.0010mm in table), all focuss from distal end 2.49m to near-end 0.97m.Wherein 2.42 and 2.49 have coincidence
Part, infer that the most long step-length of camera lens can be 9um (i.e. 0.0010-0.0001mm).
Camera lens is in 10um, all focuss from distal end 2.49m to near-end 0.97m, when camera lens is moved to 21um, from distal end
0.89m is to near-end 0.58m focuss.Although 0.97m to 0.89m is not overlapped, it assume that this step-length is more slightly shorter than 11um,
10um proper (i.e. 21-10-1=10um, wherein 1um are the minimum displacement of camera lens).
1um=0.001mm it is exactly the lens shift values of secondary series.
Mentioning 2.42 and 2.49 has intersection and 0.97 to 0.89 not overlap, before and after camera lens movement, before having movement
Field depth and it is mobile after field depth change.As above far field and the near field of form:Camera lens exists
During 0.001mm a positions, field depth is INF (infinity) -- 2.42m;When camera lens is moved to 0.010mm b positions, the depth of field
Scope is 2.49m--0.97m, then the field depth of a, b position has coincidence.Similarly, 0.021mm c positions, field depth are
0.89m-0.58m, then b, the field depth of c positions do not have intersection.
Although the foregoing describing the embodiment of the present invention, those familiar with the art should manage
Solution, the specific embodiment described by us are merely exemplary, rather than for the restriction to the scope of the present invention, are familiar with this
The equivalent modification and change that the technical staff in field is made in the spirit according to the present invention, should all cover the present invention's
In scope of the claimed protection.
Claims (6)
- A kind of 1. quick focus method of contrast formula focusing, it is characterised in that:Comprise the following steps:Step 1, camera lens is determined, the depth of field parameter that the camera lens is in each position is calculated;Step 2, the depth of field parameter by being calculated, determine the step-length of lens focusing.
- A kind of 2. quick focus method of contrast formula focusing as claimed in claim 1, it is characterised in that:Scape in the step 1 Deep parameter includes preceding depth of field parameter and rear depth of field parameter, and the preceding depth of field parameter calculation formula is:L1=(F* δ * L^2)/(f^2+ F*δ*L);Depth of field parameter calculation formula is after described:L2=(F* δ * L^2)/(f^2-F* δ * L);Wherein, δ is to allow blur circle Diameter, f are lens focus, and F is the aperture of camera lens, and L is object distance.
- A kind of 3. quick focus method of contrast formula focusing as claimed in claim 1, it is characterised in that:The step 2 enters one Step is specially:By the depth of field parameter being calculated, the position that camera lens current location is subtracted before movement is obtained into difference, if currently The depth of field parameter of position does not overlap with the depth of field parameter of the position before movement, then takes step of the absolute value of the difference as focusing It is long;It is no, then the absolute value of the difference is subtracted into step-length of the camera lens movement least displacement as focusing.
- A kind of 4. quick focus device of contrast formula focusing, it is characterised in that:Including following module:Depth of field determining module, determines camera lens, and the depth of field parameter that the camera lens is in each position is calculated;It is determined that focusing step-length module, by the depth of field parameter being calculated, determines the step-length of lens focusing.
- A kind of 5. quick focus device of contrast formula focusing as claimed in claim 4, it is characterised in that:The depth of field determines mould Depth of field parameter includes preceding depth of field parameter and rear depth of field parameter in block, and the preceding depth of field parameter calculation formula is:L1=(F* δ * L^ 2)/(f^2+F*δ*L);Depth of field parameter calculation formula is after described:L2=(F* δ * L^2)/(f^2-F* δ * L);Wherein, δ is appearance Perhaps disperse circular diameter, f are lens focus, and F is the aperture of camera lens, and L is object distance.
- A kind of 6. quick focus device of contrast formula focusing as claimed in claim 4, it is characterised in that:It is described to determine focusing step Long module is specially further:By the depth of field parameter being calculated, the position that camera lens current location is subtracted before movement is obtained Difference, if the depth of field parameter of current location does not overlap with the depth of field parameter of the position before movement, take the absolute value of the difference Step-length as focusing;It is no, then the absolute value of the difference is subtracted into step-length of the camera lens movement least displacement as focusing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710730780.9A CN107483820A (en) | 2017-08-23 | 2017-08-23 | A kind of quick focus method and device of the focusing of contrast formula |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710730780.9A CN107483820A (en) | 2017-08-23 | 2017-08-23 | A kind of quick focus method and device of the focusing of contrast formula |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107483820A true CN107483820A (en) | 2017-12-15 |
Family
ID=60601736
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710730780.9A Pending CN107483820A (en) | 2017-08-23 | 2017-08-23 | A kind of quick focus method and device of the focusing of contrast formula |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107483820A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234884A (en) * | 2018-02-12 | 2018-06-29 | 西安电子科技大学 | A kind of automatic focusing method of camera of view-based access control model conspicuousness |
CN110336951A (en) * | 2019-08-26 | 2019-10-15 | 厦门美图之家科技有限公司 | Contrast formula focusing method, device and electronic equipment |
CN112135060A (en) * | 2020-10-22 | 2020-12-25 | 努比亚技术有限公司 | Focusing processing method, mobile terminal and computer storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101477291A (en) * | 2008-12-17 | 2009-07-08 | 杭州海康威视数字技术股份有限公司 | Fast automatic focusing method and camera thereof |
CN101911671A (en) * | 2008-01-10 | 2010-12-08 | 夏普株式会社 | Imaging device and optical axis control method |
CN102665087A (en) * | 2012-04-24 | 2012-09-12 | 浙江工业大学 | Automatic shooting parameter adjusting system of three dimensional (3D) camera device |
CN103630072A (en) * | 2013-10-25 | 2014-03-12 | 大连理工大学 | Layout optimization method for camera in binocular vision measuring system |
CN103759837A (en) * | 2014-01-02 | 2014-04-30 | 上海大学 | Method for measuring curved surface temperature through infrared microscope |
CN104202518A (en) * | 2014-08-25 | 2014-12-10 | 深圳市菲特数码技术有限公司 | Zooming method and system of integrated video camera |
CN105141840A (en) * | 2015-08-24 | 2015-12-09 | 联想(北京)有限公司 | Information processing method and electronic device |
CN105827945A (en) * | 2015-11-25 | 2016-08-03 | 维沃移动通信有限公司 | Real-time focusing method and mobile terminal |
-
2017
- 2017-08-23 CN CN201710730780.9A patent/CN107483820A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101911671A (en) * | 2008-01-10 | 2010-12-08 | 夏普株式会社 | Imaging device and optical axis control method |
CN101477291A (en) * | 2008-12-17 | 2009-07-08 | 杭州海康威视数字技术股份有限公司 | Fast automatic focusing method and camera thereof |
CN102665087A (en) * | 2012-04-24 | 2012-09-12 | 浙江工业大学 | Automatic shooting parameter adjusting system of three dimensional (3D) camera device |
CN103630072A (en) * | 2013-10-25 | 2014-03-12 | 大连理工大学 | Layout optimization method for camera in binocular vision measuring system |
CN103759837A (en) * | 2014-01-02 | 2014-04-30 | 上海大学 | Method for measuring curved surface temperature through infrared microscope |
CN104202518A (en) * | 2014-08-25 | 2014-12-10 | 深圳市菲特数码技术有限公司 | Zooming method and system of integrated video camera |
CN105141840A (en) * | 2015-08-24 | 2015-12-09 | 联想(北京)有限公司 | Information processing method and electronic device |
CN105827945A (en) * | 2015-11-25 | 2016-08-03 | 维沃移动通信有限公司 | Real-time focusing method and mobile terminal |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234884A (en) * | 2018-02-12 | 2018-06-29 | 西安电子科技大学 | A kind of automatic focusing method of camera of view-based access control model conspicuousness |
CN110336951A (en) * | 2019-08-26 | 2019-10-15 | 厦门美图之家科技有限公司 | Contrast formula focusing method, device and electronic equipment |
CN112135060A (en) * | 2020-10-22 | 2020-12-25 | 努比亚技术有限公司 | Focusing processing method, mobile terminal and computer storage medium |
CN112135060B (en) * | 2020-10-22 | 2022-06-10 | 努比亚技术有限公司 | Focusing processing method, mobile terminal and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108152869B (en) | Small step focusing method suitable for bionic vision rapid focusing | |
CN107483820A (en) | A kind of quick focus method and device of the focusing of contrast formula | |
CN108519654B (en) | Automatic focusing method based on electro-hydraulic adjustable-focus lens | |
CN106896622B (en) | Bearing calibration based on multiple spurs from auto-focusing | |
WO2016155074A1 (en) | Correcting and focusing method and system for included angle of optical axis, and dual-camera equipment | |
CN112203012B (en) | Image definition calculation method, automatic focusing method and system | |
WO2022160452A1 (en) | Optical fiber automatic focus method for laser processing, and automatic focus system | |
WO2021057422A1 (en) | Microscope system, smart medical device, automatic focusing method and storage medium | |
CN104469169A (en) | Phase ranging camera shooting module and automatic focusing method thereof | |
CN107534723B (en) | Automatic focusing method, device and equipment | |
WO2016101092A1 (en) | Digital microscope and focusing method thereof | |
CN109084688B (en) | Binocular vision distance measurement method based on variable-focus camera | |
CN106842178A (en) | A kind of light field method for estimating distance and optical field imaging system | |
CN105049723A (en) | Auto-focusing method based on defocus distance difference qualitative analysis | |
CN103048766B (en) | Automatic focusing method and automatic focusing device | |
RU2013157195A (en) | VARIO LENS, OPTICAL DEVICE AND METHOD FOR PRODUCING A VARIO LENS | |
CN105785561A (en) | Digital microscope and focusing method thereof | |
CN112911133A (en) | Endoscope focusing method and device | |
CN104921697A (en) | Method for quickly measuring longitudinal distances of sight of human eyes | |
TW201111752A (en) | Portable electric device using auto focus for distance measurement and distance measuring method using the same | |
CN112904548B (en) | Endoscope focusing method and device | |
CN201662646U (en) | Manual focusing zoom lens | |
CN201796184U (en) | Telescope and lens set with additional focal-length adjusting lens | |
JP2012063520A (en) | Distance-measuring device, lens system and image pickup device | |
CN112817118B (en) | Infrared automatic focusing fast searching method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20171215 |