CN103513395B - A kind of passive auto-focusing method and device - Google Patents

A kind of passive auto-focusing method and device Download PDF

Info

Publication number
CN103513395B
CN103513395B CN201210198011.6A CN201210198011A CN103513395B CN 103513395 B CN103513395 B CN 103513395B CN 201210198011 A CN201210198011 A CN 201210198011A CN 103513395 B CN103513395 B CN 103513395B
Authority
CN
China
Prior art keywords
lens
length
current
camera lens
focusing
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
CN201210198011.6A
Other languages
Chinese (zh)
Other versions
CN103513395A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201210198011.6A priority Critical patent/CN103513395B/en
Publication of CN103513395A publication Critical patent/CN103513395A/en
Application granted granted Critical
Publication of CN103513395B publication Critical patent/CN103513395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of passive auto-focusing method and device, solves the problems, such as that focusing speed is slow.The described method includes:Obtain raw image data;Sharpness computation is carried out, obtains the definition values of raw image data;The currently active focusing range is determined according to current zoom value, if the current location of camera lens is not in the currently active focusing range, then using big step-length coarse adjustment focusing strategy adjustment lens location, treat that the current location of camera lens is in the currently active focusing range, lens location is adjusted using small step-length accurate adjustment focusing strategy;If the current location of camera lens is in the currently active focusing range, using small step-length accurate adjustment focusing strategy adjustment lens location;The big step-length coarse adjustment focusing strategy includes:Using the first step-length moving lens until the current location of camera lens is in the currently active focusing range;The small step-length accurate adjustment focusing strategy includes:Using the step-length moving lens less than the first step-length, until the definition values calculated are best sharpness value.

Description

A kind of passive auto-focusing method and device
Technical field
The present invention relates to technical field of image processing, and in particular to a kind of passive auto-focusing method and device.
Background technology
Automatic (Auto Focus, the AF) technology that focuses on refers to that camera lens automatically focuses captured object, so as to obtain Most clearly image.The technology is widely used to video camera (Video Camera), digital camera (Digital Still Camera), in the audio and video products such as cell phone (Mobile Phone).
The video auto-focusing technology of video camera mainly has active focusing and passive type to focus on two kinds.Active focus on is led to Cross and receive the actively light wave of transmitting or the back wave of sound wave to measure the distance and bearing of target, then controlled by computer System is automatic to be focused on.Passive type focuses on and by camera lens and CCD/CMOS sensors collects a series of images, to each two field picture into Row processing in real time, judges whether it focuses on, and provides feedback signal control camera lens movement, until acquired image is clearly Only.Active focusing speed is fast, but focusing accuracy is relatively low, and larger using the general volume of the instrument of these methods, price is more expensive, And for being closely less applicable in.Passive type focussing mechanism based on image procossing, small, cheap, its precision is higher, But focusing speed is slower relative to active focusing.At present, generally focused on towards consumer influence product using passive type Mode.Focusing speed collects more fuzzy image slowly so that during focusing, the subjective vision effect given people compared with Difference.
The content of the invention
The technical problem to be solved in the present invention is to provide a kind of passive auto-focusing method and device, solves focusing speed The problem of slow.
In order to solve the above technical problems, the present invention provides a kind of passive auto-focusing method, including:
Obtain raw image data;
Sharpness computation is carried out, obtains the definition values of raw image data;
According to current zoom(zoom)Value determines the currently active focusing range, if the current location of camera lens is not at currently In effective focusing range, then using big step-length coarse adjustment focusing strategy adjustment lens location, treat that the current location of camera lens is in current In effective focusing range, lens location is adjusted using small step-length accurate adjustment focusing strategy;If the current location of camera lens is in current In effective focusing range, then using small step-length accurate adjustment focusing strategy adjustment lens location;The big step-length coarse adjustment focusing strategy bag Include:Using the first step-length moving lens until the current location of camera lens is in the currently active focusing range;The small step-length essence Focusing strategy is adjusted to include:Using the step-length moving lens less than the first step-length, until the definition values calculated are optimal clear Angle value.
Further, the maximum step-length that the stepper motor of a length of camera lens of the first step can move.
Further, if the current location of the camera lens is in the currently active focusing range, using small step-length essence Telomerization Jiao's Developing Tactics lens location, including:
Judge whether current lens are in Yuan Jiao areas, if being in Yuan Jiao areas, using the second step-length moving lens, until Current lens are in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, if being not at Yuan Jiao areas, whether judge current lens In Jin Jiao areas, if being in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, i.e., camera lens is continued to move to the 3rd step-length, Until current lens are in peak region, using processing of the camera lens at peak region, if being not at Jin Jiao areas, at current lens In peak region, using processing of the camera lens at peak region, i.e., camera lens is continued to move to the 4th step-length, calculated most after movement New definition values are less than the definition values calculated after last movement, then the definition values calculated after last movement are optimal Definition values, the position of last time movement rear lens is best focus position.
Further, the first step length is more than or equal to second step-length, and the second step length is more than the 3rd step Long, the 3rd step-length is more than or equal to the 4th step-length.
Further, the minimum step that the 4th step-length can move for the stepper motor of camera lens.
Further, it is described to judge whether current lens are in Yuan Jiao areas, including:Judge whether current definition values are less than Default Yuan Jiao areas threshold value, if it is less, judging that current lens are in Yuan Jiao areas, if it is not, then judging current mirror Head is not at Yuan Jiao areas.
Further, it is described whether to judge current lens in Jin Jiao areas, including:Changed factor ratio is calculated using following formula, Judge whether changed factor is less than default Jin Jiao areas ratio threshold value, if it is less, judging that current lens are near burnt Area, if it is not, then judging that current lens are in peak region;
Wherein, f1For the current definition values of current frame image, f2For the definition values of previous frame image, focus_lens1 For the current location of the corresponding camera lens of current frame image, focus_lens2 is the position of the corresponding camera lens of previous frame image.
Further, before sharpness computation is carried out, the method further includes:First the raw image data of acquisition is carried out Denoising disposal.
In order to solve the above technical problems, present invention also offers a kind of passive type autofocus, including Image Acquisition Module, sharpness computation module and analysis and regulation module, wherein:
Described image acquisition module, for obtaining raw image data;
The sharpness computation module, for carrying out sharpness computation, obtains the definition values of raw image data;
The analysis and regulation module, for according to current zoom(zoom)Value determines the currently active focusing range, judges such as The current location of fruit camera lens is not in the currently active focusing range, then using big step-length coarse adjustment focusing strategy adjustment camera lens position Put, treat that the current location of camera lens is in the currently active focusing range, lens location is adjusted using small step-length accurate adjustment focusing strategy; If judging that the current location of camera lens is in the currently active focusing range, using small step-length accurate adjustment focusing strategy adjustment camera lens Position;The big step-length coarse adjustment focusing strategy includes:Worked as using the first step-length moving lens until the current location of camera lens is in In preceding effective focusing range;The small step-length accurate adjustment focusing strategy includes:Using the step-length moving lens less than the first step-length, directly The definition values calculated to the sharpness computation module are best sharpness value.
Further, the maximum step-length that the stepper motor of a length of camera lens of the first step can move.
Further, if the analysis and regulation module judges that the current location of camera lens is in the currently active focusing range It is interior, then using small step-length accurate adjustment focusing strategy adjustment lens location, including:
The analysis and regulation module judges whether current lens are in Yuan Jiao areas, if Yuan Jiao areas are in, using second Step-length moving lens, until current lens are in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, if being not at remote Jiao Whether area, judge current lens in Jin Jiao areas, if being in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, i.e., with Three step-lengths continue to move to camera lens, until current lens are in peak region, using processing of the camera lens at peak region, if be not at Jin Jiao areas, then current lens be in peak region, using processing of the camera lens at peak region, i.e., continue to move to mirror with the 4th step-length Head, until the newest definition values calculated after movement are less than the definition values calculated after last movement, then the last time is mobile The definition values calculated afterwards are best sharpness value, and the position of last time movement rear lens is best focus position.
Further, the first step length is more than or equal to second step-length, and the second step length is more than the 3rd step Long, the 3rd step-length is more than or equal to the 4th step-length.
Further, the minimum step that the 4th step-length can move for the stepper motor of camera lens.
Further, the analysis and regulation module judges whether current lens are in Yuan Jiao areas, including:It is current clear to judge Whether angle value is less than default Yuan Jiao areas threshold value, if it is less, judge that current lens are in Yuan Jiao areas, if it is not, Then judge that current lens are not at Yuan Jiao areas.
Further, whether the analysis and regulation module judges current lens in Jin Jiao areas, including:Calculated and become using following formula Change factor ratio, judge whether changed factor is less than default Jin Jiao areas ratio threshold value, if it is less, judging current Camera lens is in Jin Jiao areas, if it is not, then judging that current lens are in peak region;
Wherein, f1For the current definition values of current frame image, f2For the definition values of previous frame image, focus_lens1 For the current location of the corresponding camera lens of current frame image, focus_lens2 is the position of the corresponding camera lens of previous frame image.
Further, the sharpness computation module, is additionally operable to before sharpness computation is carried out, first to the original graph of acquisition As data carry out Denoising disposal.
The embodiment of the present invention introduces effective focusing range, enables to video camera for different focal positions using different Focusing strategy, rapidly enters effective focusing range and is adjusted, improve the speed focused on automatically.In addition, the present invention need not Extra auxiliary device can realize fast, accurately video auto-focusing, have good subjective vision effect.
Brief description of the drawings
Fig. 1 is 1 method flow diagram of embodiment;
Fig. 2 is 2 apparatus structure schematic diagram of embodiment;
Fig. 3 is 3 method flow diagram of embodiment;
Fig. 4 a-d are effective focusing range schematic diagram under given focal length f;
Fig. 5 a-b are the schematic diagram that lens location is located at camera lens moving direction when outside effective focusing range;
Fig. 6 is the schematic diagram of articulation curve region division.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the case where there is no conflict, in the embodiment and embodiment in the application Feature can mutually be combined.
Embodiment 1
The present embodiment introduces passive auto-focusing method, as shown in Figure 1, comprising the following steps 110-160:
Step 110, raw image data is obtained;
Step 120, sharpness computation is carried out, obtains the definition values of raw image data;
Preferably, before sharpness computation is carried out, in order to obtain preferably as a result, first to the raw image data of acquisition into Row Denoising disposal.
Step 130, according to current zoom(Zoom)Value determines the currently active focusing range;
Step 140, judge that the current location of camera lens whether in the currently active focusing range, performs if being not at Step 150, if be in, step 160 is performed;
Step 150, lens location, return to step 140 are adjusted using big step-length coarse adjustment focusing strategy, which gathers Burnt strategy includes:Using the first step-length moving lens until the current location of camera lens is in the currently active focusing range;
Step 160, lens location is adjusted using small step-length accurate adjustment focusing strategy;The small step-length accurate adjustment focusing strategy includes: Using the step-length moving lens less than the first step-length, until the definition values calculated are best sharpness value.
The best sharpness value refers to the value of maximum articulation that can be calculated during the adjustment.
By using different focusing strategies according to the difference of camera lens position, camera lens can be made rapidly to move Optimal focal position is moved, solves the problems, such as that focusing speed is slow.
Embodiment 2
The device of 1 method of embodiment is realized in the present embodiment introduction, as shown in Fig. 2, including image capture module, sharpness meter Module and analysis and regulation module are calculated, wherein:
The image capture module, for obtaining raw image data;
The sharpness computation module, for carrying out sharpness computation, obtains the definition values of raw image data;
The analysis and regulation module, for determining the currently active focusing range according to current zoom values, if camera lens is current Position is not in the currently active focusing range, then using big step-length coarse adjustment focusing strategy adjustment lens location, treats working as camera lens Front position is in the currently active focusing range, and lens location is adjusted using small step-length accurate adjustment focusing strategy;If camera lens is worked as Front position is in the currently active focusing range, then using small step-length accurate adjustment focusing strategy adjustment lens location;The big step-length is thick Focusing strategy is adjusted to include:Using the first step-length moving lens until the current location of camera lens is in the currently active focusing range; The small step-length accurate adjustment focusing strategy includes:Using the step-length moving lens less than the first step-length, until the sharpness computation mould The definition values that block calculates are best sharpness value.
Above-mentioned analysis and regulation module judges that if the current location of camera lens is in the currently active focusing range, using small Step-length accurate adjustment focusing strategy adjusts lens location, including:
Analysis and regulation module judges whether current lens are in Yuan Jiao areas, if Yuan Jiao areas are in, using the second step-length Moving lens, until current lens are in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, if being not at Yuan Jiao areas, sentences Whether disconnected current lens are in Jin Jiao areas, if being in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, i.e., with the 3rd step-length Camera lens is continued to move to, until current lens are in peak region, using processing of the camera lens at peak region, if being not at nearly Jiao Area, then current lens be in peak region, using processing of the camera lens at peak region, i.e., continue to move to camera lens with the 4th step-length, directly The newest definition values calculated after to movement are less than the definition values calculated after last movement, then are calculated after last movement Definition values be best sharpness value, the last time position of mobile rear lens be best focus position.
Above-mentioned first step length is more than or equal to the second step-length, and second step length is more than the 3rd step-length, and the 3rd step-length is more than or equal to the Four step-lengths.The maximum step-length that the stepper motor of the wherein a length of camera lens of the first step can move, the 4th step-length are electric for the stepping of camera lens The minimum step that machine can move.
Specifically, analysis and regulation module judges to work as according to whether current definition values are less than default Yuan Jiao areas threshold value Whether preceding camera lens is in Yuan Jiao areas, if it is less, judging that current lens are in Yuan Jiao areas, if it is not, then judging current Camera lens is not at Yuan Jiao areas.
Whether analysis and regulation module can judge less than default Jin Jiao areas ratio threshold value according to changed factor ratio Whether current lens are in Jin Jiao areas, if it is less, judging that current lens are in Jin Jiao areas, if it is not, then judging current Camera lens is in peak region.Changed factor ratio calculating formulas:Wherein, f1To work as The current definition values of prior image frame, f2It is corresponding for current frame image for the definition values of previous frame image, focus_lens1 The current location of camera lens, focus_lens2 are the position of the corresponding camera lens of previous frame image.
Preferably, sharpness computation module, it may also be used for before sharpness computation is carried out, first to the original image of acquisition Data carry out Denoising disposal.
Embodiment 3
The present embodiment is that 1 method of embodiment is illustrated, as shown in figure 3, comprising the following steps:
Step 210, raw image data is obtained from camera;
Step 220, Denoising disposal is carried out to the raw image data of acquisition, and the view data after processing is carried out Sharpness computation, obtains definition values;
Such as with gradient operator either contrast the methods of carry out sharpness computation.
The step of sharpness computation, positioned at merely illustrative herein, can not also perform here, and follow-up any required When calculated.
Step 230, mirror is determined using the zoom numerical value of current lens, the position of current lens and the definition values of image Head moving direction and moving step length, it is final to obtain best sharpness value and the best focus position of camera lens;
In following automatic focusings, a lens location is often moved, will be obtained from camera by denoising etc. View data after reason, calculates definition values, is then subsequently judged again, determine direction and the step of the next moved further of camera lens It is long.It is succinct for description, the step of eliminating denoising in following embodiments.
Specifically include following steps:
Step 2301, current zoom values are obtained, the currently active focusing range are determined according to the zoom values, note is the currently active Focusing range be [near_range, far_range];
The zoom values are lens parameters, for characterizing the multiple of camera lens amplification and diminution, reflect the focal length of variable lens Length.
In advance its corresponding the currently active focusing range is configured for each zoom values.Each zoom values are corresponding effectively to be focused on Scope is determined using following methods:
For any one zoom value, its effective focusing range(The corresponding lens location of i.e. nearest focusing distance, and most Scope between the corresponding lens location of remote focusing distance)All it is a part for camera lens mobile range, setting this section can Effectively to accelerate focusing speed.
Effective focusing range Near end mirror heads positional value setting:In practical applications, each zoom values have one recently Focusing distance, the lens location after its corresponding focusing are also different.Be fitted using experiment test or binding curve etc. Means measure acquisition.
Effective focusing range Far end mirror heads positional value setting:For each zoom values, general farthest focusing distance is Infinite point, acquisition is measured using the means such as experiment test or binding curve fitting.
Effective focusing range of any one zoom value can be obtained by above method.This focusing range can be stored In video camera, as adjusting parameter.
Since the bound of effective focusing range is gradual change with the conversion of zoom values, in order to save in storage Deposit, all zoom values can be divided into continuous different section, it is corresponding to each zoom values in a zoom section effective Focusing range takes union, as the corresponding effective focusing range in current zoom sections., can in order to strengthen the robustness of test result Appropriate nargin is added at effective focusing range both ends.
If the uniformity of camera lens is preferable, the test result of effective focusing range can be all suitable to any camera lens With otherwise needing appropriate adjustment.
Step 2302, the current location focus_lens of camera lens is obtained, judges the current location of camera lens whether positioned at current In effective focusing range, if the current location of camera lens not in the currently active focusing range, performs step 2303, if mirror The current location of head in effective focusing range, then performs step 2304 in this prior;
When Fig. 4 gives given focal length f, the schematic diagram of effective focusing range.Wherein u expression things are away from v represents image distance. It can be seen from the figure that when focal length is f, the object of the given object distances of Fig. 4 a can not possibly focus on.Only object distance increases Be possible to focus on to a certain extent, as shown in Figure 4 b.With the increase of object distance, image distance is less and less, as shown in Fig. 4 c and 4d. From fig. 4, it can be seen that the effective focusing range of given focal length f is not the moveable scope of camera lens.Since different focal length institutes is right The effective focusing range answered is different.Can be that different focal lengths divide different effective focusing models for different applications Enclose so that the scope of focused search greatly reduces, so as to improve focusing speed.
Step 2303, according to camera lens current location and the position of the currently active focusing range, the mobile side of camera lens is determined To the direction to be moved into the currently active focusing range, the moving step length for determining camera lens is the first step-length, by definite direction After step-length moving lens, return to step 2302;
The direction of camera lens movement can be determined in the following ways:Judge delta_near=abs (focus_lens-near_ Range) with the size of delta_far=abs (focus_lens-far_range), if delta_near is less than delta_ Far, then the direction of camera lens movement is far directions shown in Fig. 5 a, and otherwise, the direction of camera lens movement is then near shown in Fig. 5 b Direction.Need camera lens being moved in the currently active focusing range in a word.In order to camera lens quickly be adjusted to the currently active focusing model In enclosing, maximum step-length that the stepper motor of the preferably a length of camera lens of the first step can move.By being sent out to the stepper motor of camera lens Control signal is sent to adjust the position of camera lens.
Step 2304, whether current lens are judged in the Yuan Jiao areas of captured scene, if so, step 2305 is performed, it is no Then perform step 2306;
Specifically, the definition values of current original image are read, its value is denoted as f, judge whether f is less than Yuan Jiao areas thresholding Threshold value, if it is less, thinking current lens in the Yuan Jiao areas of captured scene, as shown in Figure 6.
Step 2305, the moving direction for determining camera lens is the direction moved to initial best focal point, determines the shifting of camera lens Dynamic step-length is the corresponding basic step-length in the second step-length Ji Yuanjiao areas, behind definite direction and step-length moving lens, return to step 2304;
Preferably, the center that initial best focal point is the currently active focusing range can be set, and combine current mirror Head judges the direction of camera lens movement positioned at the position of the currently active focusing range, if the current location of camera lens is from the currently active The near ends of focusing range are nearer, then the direction of camera lens movement is far directions, conversely, then the direction of camera lens movement should be near Direction.Can also based on experience value or the final focal positions of former two field pictures determines a possible initial optimum focusing Point, to save the time of camera lens movement.But the initial best focal point is only the best focal point of an estimation, is moved in camera lens During, if it find that definition values decline, then moving direction is can adjust, finally so that definition values are more than Yuan Jiao areas thresholding threshold Value.
Step 2306, whether current lens are judged in the Jin Jiao areas of captured scene, if so, step 2307 is performed, it is no Then perform step 2308;
Preferably, whether default Jin Jiao areas ratio threshold value can be less than according to changed factor ratio, if it is, Current lens are thought in the Jin Jiao areas of captured scene, if as shown in fig. 6, ratio is more than the Jin Jiao areas ratio threshold value, Current lens are then thought near actual best focal point, and the clarity of present image is near clarity peak value.
The changed factor ratio of the articulation curve of current lens position is:
Wherein, f1For the current definition values of current frame image, f2For the definition values of previous frame image, focus_lens1 For the current location of the corresponding camera lens of current frame image, focus_lens2 is the position of the corresponding camera lens of previous frame image.
Changed factor ratio has reacted the slope of articulation curve, when slope is increasing, illustrates to become closer to clear Clear degree peak value.Except of course that carrying out outside location determination using changed factor ratio, can also continue to carry out using definition values Judge, as long as default corresponding Jin Jiao areas threshold value.
Step 2307, determine that the moving direction of camera lens is constant, the moving step length of camera lens corresponds to for the 3rd step-length Ji Jinjiao areas Basic step-length, behind definite direction and step-length moving lens, return to step 2306;
Step 2308, at this time, current lens are near actual best focal point(That is peak region), calculate the clear of present image Clear angle value, is denoted as fa
Step 2309, determine that the moving direction of camera lens is constant, the moving step length of camera lens is the 4th step-length, and the 4th step-length is excellent Elect the minimum step that the stepper motor of camera lens can move as, after definite direction and step-length moving lens, calculate current figure The definition values of picture, are denoted as fb
4th step-length uses the minimum step that camera lens stepper motor can move, and avoids giving people when clarity is across peak as far as possible Bring the sensation of video " deceptive movement ".
Step 2310, f is judgedbWhether f is less thana, if it is, faAs best sharpness, camera lens return to last position Put, which is best focus position, and current scene, which focuses on, to be terminated, otherwise, using the definition values of latest computed as the last time Definition values after movement, return to step 2309, moving lens, calculates newest definition values after movement, by constantly moving And judgement, until the newest definition values calculated after movement are less than the definition values calculated after last movement, the last time moves The definition values calculated after dynamic are best sharpness value, and the position of last time movement rear lens is best focus position.
By the continuous moving lens position in set direction, it should be ever-increasing just to have started definition values, because clarity Corresponding change curve is in ascent stage, and the definition values until newly obtaining a two field picture are less than the definition values of previous frame, then Camera lens returns to the lens location corresponding to previous frame image, this lens location is the best focus position of current scene.Namely Say, only definition values first increase and reduce afterwards, and just can determine that may cross top, and last mobile position is only corresponding Clarity peak-peak position.
When the definition values of latest computed are less than or equal to the definition values of last calculating, it is believed that the last time calculates Clarity be best sharpness, which is the maximum clarity in being calculated during above-mentioned adjustment Value, due to step-length, it is possible to which the best sharpness is not actual best sharpness, but focuses on the figure of acquisition at this time As can meet the clear requirement of naked eyes in one's power, definition values at this time are set to the corresponding clarity peak of present image Value, lens location are best focus position, and present image, which focuses on, to be terminated.
The relation of four step-lengths mentioned above is preferably as follows, and first step length is more than or equal to the second step-length, and second step is grown up In the 3rd step-length, the 3rd step-length is more than or equal to the 4th step-length.For example, the 3rd step-lengths of first the second step-lengths of step-length > > are more than the 4th Step-length, or the first step-length >=the 4th step-lengths of the second the 3rd step-length > of step-length >.
The division in the present embodiment Zhong Yuanjiao areas, Jin Jiao areas and peak region can voluntarily be determined by those skilled in the art. In other embodiments, also in effective focusing range when, can also only divide Liang Ge areas, different step-lengths is respectively adopted.Respectively Threshold value involved by region, such as Yuan Jiao areas threshold value, Jin Jiao areas ratio threshold value can determine based on experience value.
In order to improve focusing speed so that the position of camera lens reaches the position corresponding to the peak value of articulation curve as early as possible, When camera lens is located at outside the currently active focusing range, it is necessary to be adjusted with larger step-length, camera lens is set to be moved quickly to effectively In focusing range., can also be closer according to the different moving step length of different location determinations in the currently active focusing range Clarity peak value, the step-length of camera lens movement are smaller.So as on the premise of search precision is ensured, improve the speed of search.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program Related hardware is completed, and described program can be stored in computer-readable recording medium, such as read-only storage, disk or CD Deng.Alternatively, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly Ground, each module/unit in above-described embodiment can be realized in the form of hardware, can also use the shape of software function module Formula is realized.The present invention is not restricted to the combination of the hardware and software of any particular form.
Certainly, the present invention can also have other various embodiments, ripe in the case of without departing substantially from spirit of the invention and its essence Know those skilled in the art and make various corresponding changes and deformation in accordance with the present invention, but these change and become accordingly Shape should all belong to the protection domain of appended claims of the invention.

Claims (16)

1. a kind of passive auto-focusing method, including:
In advance its corresponding effective focusing range is configured for each zoom zoom values;
Obtain raw image data;
Sharpness computation is carried out, obtains the definition values of raw image data;
The currently active focusing range is determined according to current zoom zoom values, if the current location of camera lens is not at the currently active gather In burnt scope, then using big step-length coarse adjustment focusing strategy adjustment lens location, treat that the current location of camera lens is in the currently active poly- In burnt scope, lens location is adjusted using small step-length accurate adjustment focusing strategy;If the current location of camera lens is in the currently active poly- In burnt scope, then using small step-length accurate adjustment focusing strategy adjustment lens location;The big step-length coarse adjustment focusing strategy includes:Using First step-length moving lens is in the currently active focusing range until the current location of camera lens;The small step-length accurate adjustment focuses on plan Slightly include:Using the step-length moving lens less than the first step-length, until the definition values calculated are best sharpness value;
Wherein, the effectively focusing range refers to the corresponding lens location of nearest focusing distance mirror corresponding with farthest focusing distance Scope between head position, and the effectively focusing range is less than camera lens mobile range.
2. the method as described in claim 1, it is characterised in that:
The maximum step-length that the stepper motor of a length of camera lens of the first step can move.
3. method as claimed in claim 1 or 2, it is characterised in that:
If the current location of the camera lens is in the currently active focusing range, adjusted using small step-length accurate adjustment focusing strategy Lens location, including:
Judge whether current lens are in Yuan Jiao areas, if Yuan Jiao areas are in, using the second step-length moving lens, until current Whether camera lens is in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, if being not at Yuan Jiao areas, judge current lens near Jiao Qu, if being in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, i.e., continues to move to camera lens with the 3rd step-length, until Current lens are in peak region, and using processing of the camera lens at peak region, if being not at Jin Jiao areas, current lens are in peak It is worth area, using processing of the camera lens at peak region, i.e., continues to move to camera lens with the 4th step-length, what is calculated after movement is newest Definition values are less than the definition values calculated after last time movement, then the definition values calculated after last movement is most preferably clearly Angle value, the position of last time movement rear lens is best focus position.
4. method as claimed in claim 3, it is characterised in that:
The first step length is more than or equal to second step-length, and the second step length is more than the 3rd step-length, the 3rd step Length is more than or equal to the 4th step-length.
5. method as claimed in claim 4, it is characterised in that:
The minimum step that 4th step-length can move for the stepper motor of camera lens.
6. method as claimed in claim 3, it is characterised in that:
It is described to judge whether current lens are in Yuan Jiao areas, including:Judge whether current definition values are less than default Yuan Jiao areas door Threshold value is limited, if it is less, judging that current lens are in Yuan Jiao areas, if it is not, then judging that current lens are not at remote Jiao Area.
7. method as claimed in claim 3, it is characterised in that:
It is described whether to judge current lens in Jin Jiao areas, including:Changed factor ratio is calculated using following formula, judges changed factor Whether default Jin Jiao areas ratio threshold value is less than, if it is less, judging that current lens are in Jin Jiao areas, if not small In then judging that current lens are in peak region;
<mrow> <mi>r</mi> <mi>a</mi> <mi>t</mi> <mi>i</mi> <mi>o</mi> <mo>=</mo> <mo>|</mo> <mfrac> <mrow> <msub> <mi>f</mi> <mn>1</mn> </msub> <mo>-</mo> <msub> <mi>f</mi> <mn>2</mn> </msub> </mrow> <mrow> <mi>f</mi> <mi>o</mi> <mi>c</mi> <mi>u</mi> <mi>s</mi> <mo>_</mo> <mi>l</mi> <mi>e</mi> <mi>n</mi> <mi>s</mi> <mn>1</mn> <mo>-</mo> <mi>f</mi> <mi>o</mi> <mi>c</mi> <mi>u</mi> <mi>s</mi> <mo>_</mo> <mi>l</mi> <mi>e</mi> <mi>n</mi> <mi>s</mi> <mn>2</mn> </mrow> </mfrac> <mo>|</mo> </mrow>
Wherein, f1For the current definition values of current frame image, f2For the definition values of previous frame image, focus_lens1 is to work as The current location of the corresponding camera lens of prior image frame, focus_lens2 are the position of the corresponding camera lens of previous frame image.
8. the method as described in claim 1, it is characterised in that:
Before sharpness computation is carried out, the method further includes:Denoising disposal first is carried out to the raw image data of acquisition.
9. a kind of passive type autofocus, including image capture module, sharpness computation module and analysis and regulation module, Wherein:
Described image acquisition module, for obtaining raw image data;
The sharpness computation module, for carrying out sharpness computation, obtains the definition values of raw image data;
The analysis and regulation module, for determining the currently active focusing range according to current zoom zoom values, if judging camera lens Current location be not in the currently active focusing range, then using big step-length coarse adjustment focusing strategy adjustment lens location, treat mirror The current location of head is in the currently active focusing range, and lens location is adjusted using small step-length accurate adjustment focusing strategy;Judge such as The current location of fruit camera lens is in the currently active focusing range, then using small step-length accurate adjustment focusing strategy adjustment lens location; The big step-length coarse adjustment focusing strategy includes:Using the first step-length moving lens until the current location of camera lens is in the currently active In focusing range;The small step-length accurate adjustment focusing strategy includes:Using the step-length moving lens less than the first step-length, until described The definition values that sharpness computation module calculates are best sharpness value;
Wherein, the corresponding the currently active focusing range of the current zoom zoom values is preconfigured the effectively focusing model The scope referred between the corresponding lens location of nearest focusing distance lens location corresponding with farthest focusing distance is enclosed, and it is described Effective focusing range is less than camera lens mobile range.
10. device as claimed in claim 9, it is characterised in that:
The maximum step-length that the stepper motor of a length of camera lens of the first step can move.
11. the device as described in claim 9 or 10, it is characterised in that:
The analysis and regulation module judges that if the current location of camera lens is in the currently active focusing range, using small step-length Accurate adjustment focusing strategy adjusts lens location, including:
The analysis and regulation module judges whether current lens are in Yuan Jiao areas, if Yuan Jiao areas are in, using the second step-length Moving lens, until current lens are in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, if being not at Yuan Jiao areas, sentences Whether disconnected current lens are in Jin Jiao areas, if being in Jin Jiao areas, using processing of the camera lens at Jin Jiao areas, i.e., with the 3rd step-length Camera lens is continued to move to, until current lens are in peak region, using processing of the camera lens at peak region, if being not at nearly Jiao Area, then current lens be in peak region, using processing of the camera lens at peak region, i.e., continue to move to camera lens with the 4th step-length, directly The newest definition values calculated after to movement are less than the definition values calculated after last movement, then are calculated after last movement Definition values be best sharpness value, the last time position of mobile rear lens be best focus position.
12. device as claimed in claim 11, it is characterised in that:
The first step length is more than or equal to second step-length, and the second step length is more than the 3rd step-length, the 3rd step Length is more than or equal to the 4th step-length.
13. device as claimed in claim 12, it is characterised in that:
The minimum step that 4th step-length can move for the stepper motor of camera lens.
14. device as claimed in claim 11, it is characterised in that:
The analysis and regulation module judges whether current lens are in Yuan Jiao areas, including:Judge whether current definition values are less than Default Yuan Jiao areas threshold value, if it is less, judging that current lens are in Yuan Jiao areas, if it is not, then judging current mirror Head is not at Yuan Jiao areas.
15. device as claimed in claim 11, it is characterised in that:
Whether the analysis and regulation module judges current lens in Jin Jiao areas, including:Changed factor ratio is calculated using following formula, Judge whether changed factor is less than default Jin Jiao areas ratio threshold value, if it is less, judging that current lens are near burnt Area, if it is not, then judging that current lens are in peak region;
<mrow> <mi>r</mi> <mi>a</mi> <mi>t</mi> <mi>i</mi> <mi>o</mi> <mo>=</mo> <mo>|</mo> <mfrac> <mrow> <msub> <mi>f</mi> <mn>1</mn> </msub> <mo>-</mo> <msub> <mi>f</mi> <mn>2</mn> </msub> </mrow> <mrow> <mi>f</mi> <mi>o</mi> <mi>c</mi> <mi>u</mi> <mi>s</mi> <mo>_</mo> <mi>l</mi> <mi>e</mi> <mi>n</mi> <mi>s</mi> <mn>1</mn> <mo>-</mo> <mi>f</mi> <mi>o</mi> <mi>c</mi> <mi>u</mi> <mi>s</mi> <mo>_</mo> <mi>l</mi> <mi>e</mi> <mi>n</mi> <mi>s</mi> <mn>2</mn> </mrow> </mfrac> <mo>|</mo> </mrow>
Wherein, f1For the current definition values of current frame image, f2For the definition values of previous frame image, focus_lens1 is to work as The current location of the corresponding camera lens of prior image frame, focus_lens2 are the position of the corresponding camera lens of previous frame image.
16. device as claimed in claim 9, it is characterised in that:
The sharpness computation module, is additionally operable to before sharpness computation is carried out, first the raw image data of acquisition is gone Noise processed.
CN201210198011.6A 2012-06-15 2012-06-15 A kind of passive auto-focusing method and device Active CN103513395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210198011.6A CN103513395B (en) 2012-06-15 2012-06-15 A kind of passive auto-focusing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210198011.6A CN103513395B (en) 2012-06-15 2012-06-15 A kind of passive auto-focusing method and device

Publications (2)

Publication Number Publication Date
CN103513395A CN103513395A (en) 2014-01-15
CN103513395B true CN103513395B (en) 2018-05-04

Family

ID=49896388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210198011.6A Active CN103513395B (en) 2012-06-15 2012-06-15 A kind of passive auto-focusing method and device

Country Status (1)

Country Link
CN (1) CN103513395B (en)

Families Citing this family (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105025218B (en) * 2014-04-30 2018-08-28 瑞昱半导体股份有限公司 Passive type automatic focusing mechanism and method
CN105319801B (en) * 2014-07-07 2018-05-29 宁波舜宇光电信息有限公司 A kind of method of automatic focusing camera module focusing positioning camera lens
CN104079837B (en) * 2014-07-17 2018-03-30 广东欧珀移动通信有限公司 A kind of focusing method and device based on imaging sensor
CN104767937A (en) * 2015-03-27 2015-07-08 深圳市艾优尼科技有限公司 Photographing method
CN106154688B (en) * 2015-04-07 2021-04-16 中兴通讯股份有限公司 Automatic focusing method and device
CN106813635B (en) * 2015-12-02 2019-12-03 南宁富桂精密工业有限公司 A kind of bearing calibration of lens motor focusing curve and device
CN105372781B (en) * 2015-12-05 2018-02-13 中国航空工业集团公司洛阳电光设备研究所 The zoom control device and control method of a kind of axial variable-power optical system
CN106896622B (en) * 2015-12-21 2019-08-30 宁波舜宇光电信息有限公司 Bearing calibration based on multiple spurs from auto-focusing
CN105578048B (en) * 2015-12-23 2019-02-22 北京奇虎科技有限公司 A kind of quick focusing method and device, mobile terminal
CN105430279B (en) * 2015-12-23 2019-02-12 北京奇虎科技有限公司 Camera fast automatic focusing method and device
CN109889721B (en) * 2015-12-23 2021-01-29 北京奇虎科技有限公司 Camera automatic focusing control method and device
CN106921830B (en) * 2015-12-28 2020-10-30 浙江大华技术股份有限公司 Automatic focusing method and device
CN106231171B (en) * 2015-12-31 2019-08-20 天津天地伟业物联网技术有限公司 A kind of quick focusing method for video camera
JP6028876B1 (en) * 2016-02-02 2016-11-24 ソニー株式会社 Lens unit, imaging device, and control method
CN105959577B (en) * 2016-07-15 2019-07-02 苏州科达科技股份有限公司 A kind of focus method and device of video camera
CN106303481B (en) * 2016-09-09 2019-03-19 深圳市Tcl高新技术开发有限公司 A kind of method and system of projection TV focusing
CN106412423A (en) * 2016-09-19 2017-02-15 珠海格力电器股份有限公司 Focusing method and device
CN106791432A (en) * 2017-01-18 2017-05-31 深圳竹信科技有限公司 A kind of focal length determines method and device
CN107664899B (en) * 2017-10-19 2020-07-07 广东顺德工业设计研究院(广东顺德创新设计研究院) Automatic focusing method, device and system
CN112322713B (en) * 2017-12-15 2022-06-03 深圳市真迈生物科技有限公司 Imaging method, device and system and storage medium
CN107942601A (en) * 2017-12-25 2018-04-20 天津天地伟业电子工业制造有限公司 A kind of stepper motor lens focus method based on temperature-compensating
CN110392200B (en) * 2018-04-20 2021-01-26 杭州海康威视数字技术股份有限公司 Method and apparatus for auto-focusing
CN110579854A (en) * 2018-06-07 2019-12-17 杭州海康威视数字技术股份有限公司 lens position adjusting method, lens position adjusting device, zoom camera and storage medium
CN112333378A (en) * 2018-07-23 2021-02-05 深圳市真迈生物科技有限公司 Imaging method, device and system
CN112291469A (en) * 2018-07-23 2021-01-29 深圳市真迈生物科技有限公司 Imaging method, device and system
CN110754080B (en) * 2018-07-27 2021-10-15 深圳市大疆创新科技有限公司 Image acquisition method, imaging device and shooting system
CN109286751B (en) * 2018-09-28 2021-01-19 深圳市盛世智能装备有限公司 Linear array camera focusing method, device, equipment and storage medium
CN111050061B (en) * 2018-10-12 2021-06-29 杭州易现先进科技有限公司 Focusing method, focusing device, medium and computing equipment
CN109254382B (en) * 2018-10-12 2021-11-26 南通大学 Thread detection automatic focusing method based on machine vision
CN109451244B (en) * 2018-12-21 2020-12-04 广州医软智能科技有限公司 Automatic focusing method and system based on liquid lens
CN109633860A (en) * 2019-01-22 2019-04-16 成都市极米科技有限公司 Automatically adjust method, lens position adjusting device and the projector of lens location
CN109884032A (en) * 2019-02-19 2019-06-14 中国科学院合肥物质科学研究院 The pinpoint laser induced breakdown spectroscopy detection system of ablation point and method
CN110049300A (en) * 2019-04-19 2019-07-23 深圳市当智科技有限公司 Projector lens focus method based on variable step motion control
CN110381261B (en) * 2019-08-29 2020-11-03 重庆紫光华山智安科技有限公司 Focusing method, focusing device, computer-readable storage medium and electronic equipment
CN110719404B (en) * 2019-10-10 2021-09-21 浙江大华技术股份有限公司 Electric lens control method and device
CN111246082B (en) * 2019-12-31 2021-03-09 深圳市景阳科技股份有限公司 Direct current motor focusing method and device, terminal equipment and storage medium
CN113747042B (en) * 2020-05-29 2022-11-04 杭州海康威视数字技术股份有限公司 Stepping step length control method and method for determining stepping step length of stepping motor
CN112203012B (en) * 2020-08-25 2022-04-22 武汉高德智感科技有限公司 Image definition calculation method, automatic focusing method and system
CN113299575B (en) * 2021-05-24 2023-03-21 深圳中科飞测科技股份有限公司 Focusing method and apparatus, focusing device, and storage medium
CN113810616B (en) * 2021-09-27 2023-05-09 季华实验室 Aperture focal length adjustment method, system, electronic device and storage medium
CN116489511A (en) * 2021-10-20 2023-07-25 武汉高德智感科技有限公司 Image definition assignment method for automatic focusing and focusing method
CN114422690B (en) * 2021-12-16 2022-12-20 北京波谱华光科技有限公司 Control method and device for automatic focusing, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1304901C (en) * 2001-10-31 2007-03-14 金宝电子工业股份有限公司 Automatic focusing method of camera
CN100407038C (en) * 2005-12-19 2008-07-30 佛山普立华科技有限公司 Automatic focusing method for digit imaging system
CN101470326B (en) * 2007-12-28 2010-06-09 佛山普立华科技有限公司 Shooting apparatus and its automatic focusing method
CN101790043B (en) * 2009-01-22 2012-07-11 华为终端有限公司 Control method for automatic focusing and device thereof
CN102375316A (en) * 2010-08-27 2012-03-14 鸿富锦精密工业(深圳)有限公司 Projector and automatic focusing method thereof

Also Published As

Publication number Publication date
CN103513395A (en) 2014-01-15

Similar Documents

Publication Publication Date Title
CN103513395B (en) A kind of passive auto-focusing method and device
US20080247741A1 (en) Image-taking apparatus
JP5869883B2 (en) Image processing device
US8135268B2 (en) Lens control apparatus, optical apparatus and lens control method
CN102236147B (en) Lens apparatus
CN100561326C (en) Autofocus system and automatic focusing method
US20080297648A1 (en) Focus detection apparatus
CN105430279B (en) Camera fast automatic focusing method and device
EP1580984A1 (en) Lens controlling apparatus and image-taking apparatus
JP2015032144A (en) Imaging device and control method therefor
CN101494737A (en) Integrated camera device and self-adapting automatic focus method
CN101115146A (en) Image-pickup apparatus and focus control method
CN103945133B (en) Auto-focus device and method for visible light lens
CN105527778A (en) Automatic focusing method for electric adjustable liquid lens
CN109521547A (en) A kind of automatic focusing method and system of variable step
JP2008032963A (en) Optical device, imaging apparatus and its control method
CN101950116A (en) Video automatic focusing method applied to multi-main-body scene
CN103487927A (en) Automatic focusing method of microscope
CN105554387A (en) Zoom tracking curve correction method and device
CN103168271A (en) Image capture device, semiconductor integrated circuit, and image capture method
JP2003274258A (en) Camera
US7589768B2 (en) Image-taking apparatus and focus control method of image-taking apparatus with first and second control method in first zoom state and only second control method in second zoom state
CN110196491B (en) Modeling simulation method for defocusing of double-view-field infrared imaging system
CN201667683U (en) Large focal variation ratio automatic focusing all-in-one video camera
CN107806830A (en) A kind of range unit and application method based on zoom camera

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant