CN104238237B - The method and test device of auto-focusing - Google Patents

The method and test device of auto-focusing Download PDF

Info

Publication number
CN104238237B
CN104238237B CN201310238941.4A CN201310238941A CN104238237B CN 104238237 B CN104238237 B CN 104238237B CN 201310238941 A CN201310238941 A CN 201310238941A CN 104238237 B CN104238237 B CN 104238237B
Authority
CN
China
Prior art keywords
value
lst
group
image
voice coil
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.)
Active
Application number
CN201310238941.4A
Other languages
Chinese (zh)
Other versions
CN104238237A (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.)
Shenzhen core Ruishi Technology Co., Ltd
Original Assignee
Shenzhen Vision Technology Co 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 Shenzhen Vision Technology Co Ltd filed Critical Shenzhen Vision Technology Co Ltd
Priority to CN201310238941.4A priority Critical patent/CN104238237B/en
Publication of CN104238237A publication Critical patent/CN104238237A/en
Application granted granted Critical
Publication of CN104238237B publication Critical patent/CN104238237B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Studio Devices (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

The present invention provides a kind of method and test device of auto-focusing, the method of the auto-focusing is used to determine the focusing position of camera lens in image acquiring device, the camera lens can be moved by the driving of a voice coil motor relative to an image sensor, the method of the auto-focusing first judges roughly the place of focusing position on a large scale, then in small-scale fine search, until a difference value is more than predetermined value.The Atomatic focusing method of the present invention first judges roughly the place of focusing position on a large scale, then can comparatively fast and accurately determine the focusing position of camera lens by verification experimental verification in small-scale fine search.

Description

The method and test device of auto-focusing
Technical field
The present invention relates to a kind of methods of auto-focusing.
Background technology
The camera model for having automatic focusing function is to drive camera lens to change between sensing component using voice coil motor Relative position so that camera model obtains clear image, and common video recording analysis power analytic function is that letter is transmitted in modulation Number (modulation transfer function, MTF).
Due to effective mtf value calculate need to be only in best focusing position it is effective and objective, therefore, when seeking burnt position Time production efficiency will be caused too low too long.Best focusing position, universe search side are searched using universe search pattern at present Formula is scheduled electric current spacing into line search, and MFT values when calculating different electric currents, and can finally find can be with there are one current value Keep mtf value maximum.When search spacing is smaller, universe search method will be unable to that producing line is made to obtain preferable production efficiency;If conversely, Search spacing is excessive, then focus effects are bad.
In order to improve above-mentioned universe search pattern, first with the calculating mtf value one by one of larger search spacing, mtf value is found When crossing peak value, then change and search direction, and reduces search spacing to recalculate mtf value simultaneously;Above-mentioned steps repeatedly, until When the peak value that mtf value is crossed no longer changes, then automatic focusing function is completed, but when a little oscillation is presented in MTF curve, then It is easy to fall into the search result of plots peak, is not universe peak value.
Invention content
In view of this, it is necessary to propose a kind of method of auto-focusing, can solve the above problems.
A kind of method of auto-focusing, the focusing position for determining camera lens in image acquiring device, the camera lens by The driving of one voice coil motor and can be moved relative to an image sensor, the method for the auto-focusing includes:According to function S= Lst+ (n-1) * k obtain one group of sampling value, wherein the initial value of Lst is the minimum drive current value of voice coil motor, and n is to be opened from 1 The one group of consecution natural number to begin, k is constant;Successively using the sampling value as the driving current value of voice coil motor, to drive Camera lens is stated to different positions;The picture in image when being located at the different location according to the camera lens on the image sensor Maximum gradation value, minimum gradation value and the average gray value of vegetarian refreshments calculate one group of modulation corresponding with each sampling value and pass Delivery function value;Using one group of modulating transfer function value as variable a variation value is calculated according to scheduled formula;If institute It states variation value and is less than predetermined value, then then the sum of Lst and k repeat the above steps as new Lst;When the variation value is big When predetermined value, constant k is replaced with another parameter m, parameter m is less than constant k, repeats the above steps;When the variation value is big When predetermined value, select a sampling value as opposite with lens focusing position from one group of sampling value according to pre-defined rule The driving current value for the voice coil motor answered.
A kind of test device, the focusing position for determining camera lens in image acquiring device, the camera lens is by a voice coil The driving of motor and can be moved relative to an image sensor, the test device includes processor and driving unit, the place It manages device and one group of sampling value is obtained according to function S=Lst+ (n-1) * k, wherein the initial value of Lst is the simulation of voice coil motor Current value, n are one group of consecution natural number since 1, and k is constant;Driving unit is successively using the sampling value as voice coil horse The driving current value reached, to drive the camera lens to different positions;The processor is located at the difference according to the camera lens Maximum gradation value, minimum gradation value and the average gray value of the pixel in image when position on the image sensor calculate Go out one group of modulating transfer function value corresponding with each sampling value;The processor is with one group of modulating transfer function value As variable a variation value is calculated according to scheduled formula;If the variation value is less than predetermined value, the processor will Then the sum of Lst and k repeat the above steps as new Lst;When the variation value is more than predetermined value, by constant k with another Parameter m is replaced, and parameter m is less than constant k, repeats the above steps;When the variation value be more than predetermined value when, the processor according to Pre-defined rule selects a sampling value as voice coil motor corresponding with lens focusing position from one group of sampling value Driving current value.
The Atomatic focusing method of the present invention first judges roughly the place of focusing position on a large scale, then in small-scale essence Fine searching can comparatively fast and accurately determine the focusing position of camera lens by verification experimental verification.
Description of the drawings
Fig. 1 is the block diagram of the test device of the present invention.
Fig. 2 is the flow chart of the Atomatic focusing method of the present invention.
Fig. 3 is the modulation transfer function curve of the camera lens of image acquiring device to be tested.
Main element symbol description
Following specific implementation mode will be further illustrated the present invention in conjunction with above-mentioned attached drawing.
Specific implementation mode
Referring to Fig. 1, test device 100 is used to determine an image acquiring device 200 to be tested (such as mobile phone, photograph Machine) in camera lens 210 focusing position, the camera lens 210 can be relative to an image sensing by the driving of a voice coil motor 220 Device 230 moves.
Referring to Fig. 2, test device 100 includes processor 10, driving unit 20 and memory 30, stored in memory 30 There are test program, processor 10 to execute the focusing position that the test program can determine the camera lens 210.Specifically, the processing Device 10 obtains one group of sampling value according to function S=Lst+ (n-1) * k, wherein the initial value of Lst is the minimum of voice coil motor 220 Driving current value, n are one group of consecution natural number since 1, and k is constant.
Driving unit 20 is successively using the sampling value as the driving current value of voice coil motor 220, to drive the camera lens 210 to different positions.
In image of the processor 10 when being located at the different location according to the camera lens 210 on the image sensor 230 Maximum gradation value, minimum gradation value and the average gray value of pixel calculate one group of tune corresponding with each sampling value Modulation trnasfer function value.
The processor 10 calculates a change as variable using one group of modulating transfer function value according to scheduled formula Different value.
If the variation value is less than predetermined value, the processor 10 as new Lst, then weighs the sum of Lst and k Multiple above-mentioned steps.
When the variation value is more than predetermined value, constant k is replaced with another parameter m, parameter m is less than constant k, in repetition State step.
When the variation value is more than predetermined value, the processor 10 is selected according to pre-defined rule from one group of sampling value Select driving current value of the sampling value as voice coil motor corresponding with 210 focusing position of camera lens 220.
It is specifically described by taking Fig. 3 as an example, since the drive current range of voice coil motor 220 is 0~80mA, sets Lst Minimum value and maximum value be respectively 0 and 80, set k=10, set n as the consecution natural number from 1 to 3.Also that is, sampling every time Including 3 sampling values, the spacing between sampling value is 10.When the first sub-sampling, sampling value S is respectively 0,10 and 20, processor 10 calculate modulating transfer function value according to formula MTF=(High-Low)/(High+Low), wherein High=Ave+0.6 (Max-Ave), Low=Ave-0.6 (Ave-Min), Ave are the average gray value of the pixel in image, and Max is in image The maximum gradation value of pixel, Min are the minimum gradation value of the pixel in image.That is, driving unit 20 respectively with The driving current of 0mA, 10mA and 20mA drive camera lens 210 to 3 different positions, and then processor 10 is according to above-mentioned 3 Maximum gradation value, minimum gradation value and the average gray value meter of the pixel in image when a position on image sensor 230 Calculate 3 modulating transfer function values.
In the present embodiment, variation value is calculated by the following formula:
Wherein, S=Lst+ (n-1) * k, N indicate the number of sample point Amount, in the present embodiment, N are equal to ratio of the sum of the mtf value corresponding when 3, Ave systems S is 0,10 and 20 with N, Avri systems S The ratio of corresponding mtf value and the absolute value and N of the difference of Ave when being 0,10 and 20.
If variation value Avri is less than predetermined value (being in the present embodiment 0.01), continue to sample, i.e. hereafter several Group sampling value is respectively 10,20,30,20,30,40,30,40,50,40,50,60, when sampling value is 50,60,70, variation value Avri is more than the predetermined value, indicates that focusing position is located between the position corresponding to driving current value 50mA and 70mA.
Hereafter, the spacing between sampling value is adjusted to m by k, in the present embodiment, m is equal to 1, then repeats above-mentioned Step is until the value Avri that morphs again is more than the situation of predetermined value.The processor 10 is according to pre-defined rule from described one group Select a sampling value as the driving current value of voice coil motor corresponding with 210 focusing position of camera lens 220, example in sampling value Such as, it is voice coil horse corresponding with 210 focusing position of camera lens that the processor 10, which chooses the current value corresponding to maximum mtf value, Up to 220 driving current value.
The Atomatic focusing method of the present invention first judges roughly the place of focusing position on a large scale, then in small-scale essence Fine searching can comparatively fast and accurately determine the focusing position of camera lens 210 by verification experimental verification.

Claims (2)

1. a kind of method of auto-focusing, the focusing position for determining camera lens in image acquiring device, the camera lens is by one The driving of voice coil motor and can be moved relative to an image sensor, the method for the auto-focusing includes:
One group of sampling value is obtained according to function S=Lst+ (n-1) * k, wherein the initial value of Lst is the simulation of voice coil motor Current value, n are one group of consecution natural number since 1, and k is constant;
Successively using the sampling value as the driving current value of voice coil motor, to drive the camera lens to different positions;
The maximum gray scale of the pixel in image when being located at the different location according to the camera lens on the image sensor Value, minimum gradation value and average gray value and according to formula:MTF=(High-Low)/(High+Low) calculates one group and institute State the corresponding modulating transfer function value of each sampling value, wherein High=Ave+0.6 (Max-Ave), Low=Ave-0.6 (Ave-Min), Ave is the average gray value of the pixel in image, and Max is the maximum gradation value of the pixel in image, Min For the minimum gradation value of the pixel in image;
Using one group of modulating transfer function value as variable according to formula:
A variation value is calculated, Wherein, S=Lst+ (n-1) * k, N indicate that the quantity of sample point, Avri are variation value;
If then the variation value repeats the above steps less than predetermined value by the sum of Lst and k as new Lst;
When the variation value is more than predetermined value, constant k is replaced with another parameter m, parameter m is less than constant k, repeats above-mentioned step Suddenly;
When the variation value is more than predetermined value, obtains one group of sampling value according to function S=Lst+ (n-1) * k and taken from described one group Select a sampling value as the driving current value of voice coil motor corresponding with lens focusing position in sample value, wherein Lst's Initial value is voice coil motor(220)Minimum drive current value, n is one group of consecution natural number since 1, and k is constant.
2. a kind of test device, the focusing position for determining camera lens in image acquiring device, the camera lens is by a voice coil horse The driving that reaches and can be moved relative to an image sensor, the test device includes processor and driving unit, and feature exists In:
The processor obtains one group of sampling value according to function S=Lst+ (n-1) * k, wherein the initial value of Lst is voice coil motor Minimum drive current value, n is one group of consecution natural number since 1, and k is constant;
Driving unit is successively using the sampling value as the driving current value of voice coil motor, to drive the camera lens to different positions It sets;
Pixel in image of processor when being located at the different location according to the camera lens on the image sensor Maximum gradation value, minimum gradation value and average gray value and calculated according to formula MTF=(High-Low)/(High+Low) One group of modulating transfer function value corresponding with each sampling value, wherein High=Ave+0.6 (Max-Ave), Low= Ave-0.6 (Ave-Min), Ave are the average gray value of the pixel in image, and Max is the maximum ash of the pixel in image Angle value, Min are the minimum gradation value of the pixel in image;
The processor is using one group of modulating transfer function value as variable according to formula:
Calculate a variation value, wherein S=Lst+ (n-1) * k, N expressions take The quantity of sampling point, Avri are variation value;
If the variation value is less than predetermined value, the processor as new Lst, then repeats the sum of Lst and k above-mentioned Step;
When the variation value is more than predetermined value, constant k is replaced with another parameter m, parameter m is less than constant k, repeats above-mentioned step Suddenly;
When the variation value is more than predetermined value, the processor according to function S=Lst+ (n-1) * k obtain one group of sampling value from Select a sampling value as the driving current value of voice coil motor corresponding with lens focusing position in one group of sampling value, Wherein, the initial value of Lst is voice coil motor(220)Minimum drive current value, n is one group of consecution natural number since 1, k For constant.
CN201310238941.4A 2013-06-17 2013-06-17 The method and test device of auto-focusing Active CN104238237B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310238941.4A CN104238237B (en) 2013-06-17 2013-06-17 The method and test device of auto-focusing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310238941.4A CN104238237B (en) 2013-06-17 2013-06-17 The method and test device of auto-focusing

Publications (2)

Publication Number Publication Date
CN104238237A CN104238237A (en) 2014-12-24
CN104238237B true CN104238237B (en) 2018-07-31

Family

ID=52226620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310238941.4A Active CN104238237B (en) 2013-06-17 2013-06-17 The method and test device of auto-focusing

Country Status (1)

Country Link
CN (1) CN104238237B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105681668B (en) * 2016-02-29 2019-02-12 Oppo广东移动通信有限公司 Control method, control device and electronic device
CN106101697B (en) * 2016-06-21 2017-12-05 深圳市辰卓科技有限公司 Approach for detecting image sharpness, device and test equipment
CN111083347B (en) * 2018-10-22 2021-04-20 杭州海康威视数字技术股份有限公司 Lens drive control device, lens drive device and camera
CN109714581B (en) * 2018-12-26 2021-04-06 深圳市橙子数字科技有限公司 Automatic focusing method of projector

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102037241A (en) * 2008-05-21 2011-04-27 柯尼卡美能达精密光学株式会社 Position control device, position control method, drive device and imaging device
CN102147556A (en) * 2011-03-09 2011-08-10 华为终端有限公司 Focusing method and device for mobile device and mobile device
CN102736361A (en) * 2011-04-08 2012-10-17 鸿富锦精密工业(深圳)有限公司 Automatic focusing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3902492B2 (en) * 2002-03-13 2007-04-04 株式会社リコー Imaging device
US8049811B2 (en) * 2009-01-28 2011-11-01 Board Of Regents, The University Of Texas System Automatic focusing apparatus and method for digital images using automatic filter switching

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102037241A (en) * 2008-05-21 2011-04-27 柯尼卡美能达精密光学株式会社 Position control device, position control method, drive device and imaging device
CN102147556A (en) * 2011-03-09 2011-08-10 华为终端有限公司 Focusing method and device for mobile device and mobile device
CN102736361A (en) * 2011-04-08 2012-10-17 鸿富锦精密工业(深圳)有限公司 Automatic focusing method

Also Published As

Publication number Publication date
CN104238237A (en) 2014-12-24

Similar Documents

Publication Publication Date Title
CN104238237B (en) The method and test device of auto-focusing
CN103546692A (en) Method and system achieving integrated camera automatic focusing
CN105391945B (en) Camera autofocus control method and device
CN102062929B (en) Automatic focusing method and device for microscope system
CN104931957B (en) A kind of distance measuring method and device based on mobile terminal
CN115456002A (en) Two-dimensional code identification method, two-dimensional code positioning identification model establishment method and device
TW201520633A (en) Automatic focusing method, and automatic focusing device, image capturing device using the same
CN108076278A (en) A kind of Atomatic focusing method, device and electronic equipment
CN107787463B (en) The capture of optimization focusing storehouse
CN109635661B (en) Far-field wireless charging receiving target detection method based on convolutional neural network
CN108600638B (en) Automatic focusing system and method for camera
TWI524107B (en) Method of auto-focus
CN104811608A (en) Image capturing apparatus and image defect correction method thereof
US8433187B2 (en) Distance estimation systems and method based on a two-state auto-focus lens
CN110533643A (en) Certificate identification method and device
US20160292873A1 (en) Image capturing apparatus and method for obtaining depth information of field thereof
CN105592258B (en) Auto focusing method and device
CN103472658B (en) Atomatic focusing method
CN107026979A (en) Double-camera photographing method and device
CN103424978A (en) System and method for testing camera module
CN106595489A (en) Mobile terminal for real-time distance measurement and method
WO2016161734A1 (en) Autofocusing method and device
JPWO2012133371A1 (en) Imaging position and imaging direction estimation apparatus, imaging apparatus, imaging position and imaging direction estimation method, and program
JPWO2016166871A1 (en) Microscope observation system, microscope observation method, and microscope observation program
CN107682691B (en) A kind of method, terminal and the computer readable storage medium of camera focus calibration

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20170920

Address after: 518000 Guangdong Province, Shenzhen New District of Longhua City, Dalang street, Longsheng Gold Dragon Road community e-commerce incubator exhibition Tao Commercial Plaza E block 706

Applicant after: Shenzhen step Technology Transfer Center Co., Ltd.

Address before: 518109 Guangdong city of Shenzhen province Baoan District Longhua Town Industrial Zone tabulaeformis tenth East Ring Road No. 2 two

Applicant before: Hongfujin Precise Industry (Shenzhen) Co., Ltd.

Applicant before: Hon Hai Precision Industry Co., Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180625

Address after: 518129 D, two or three and four floor, Wei Yu Long Industrial Park, 16 Bantian Road, Longgang District, Shenzhen, Guangdong.

Applicant after: Shenzhen Vision Technology Co., Ltd.

Address before: 518000 Guangdong Shenzhen Longhua New District big wave street Longsheng community Tenglong road gold rush e-commerce incubation base exhibition hall E commercial block 706

Applicant before: Shenzhen step Technology Transfer Center Co., Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200917

Address after: 4 / F, B, Weiyu longbuji factory building, 2016 Xuegang Road, Gangtou community, Bantian street, Longgang District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen core Ruishi Technology Co., Ltd

Address before: 518129 D, two or three and four floor, Wei Yu Long Industrial Park, 16 Bantian Road, Longgang District, Shenzhen, Guangdong.

Patentee before: SHENZHEN RUISION TECHNOLOGY Co.,Ltd.