A kind of fast automatic focusing method of imaging system and device
Technical field
The present invention relates to technical field of image processing, be specifically related to imaging system.
Background technology
Digital imaging system, the such as mobile phone etc. of digital camera, band camera function, in imaging process, usually need to focus, make shooting results clear.Focus process is completed by Atomatic focusing method usually, halfway without the need to human intervention, during focusing, whenever imageing sensor exports a two field picture, auto-focusing algorithm calculates with regard to utilizing the data of area-of-interest on image to carry out focusing, then according to result of calculation adjustment lens location.Afterwards, obtain the image that a frame is new, utilize the data of area-of-interest in new images again to carry out focusing and calculate, and adjust lens location.Above process constantly repeats, until obtain best focusing position.Every two field picture is only once focused calculating, and usually completes focusing and need to carry out several times focusing and calculate, and constantly adjusts lens location, to obtain best focus effects.Suppose that certain auto-focusing algorithm completes focusing after adjusting six lens locations, so this algorithm needs the regions of interest data of six two field pictures, complete six focusings to calculate, every two field picture carries out the focus process time sequencing of each calculating and camera lens adjustment with reference to shown in Fig. 1.
Therefore prior art needs multiple image data to meet the needs repeatedly calculated, the most of the time of whole focus process all consumes to be waited in the output of next frame view data, make focus process too time-consuming, satisfied shooting can not be provided to experience for user.
Summary of the invention
The object of the invention is to, provide a kind of imaging system fast automatic focusing method, solve above technical problem;
The present invention also aims to, provide a kind of imaging system fast automatic focusing mechanism, solve above technical problem.
Technical problem solved by the invention can realize by the following technical solutions:
The fast automatic focusing method of a kind of imaging system, be applied to imaging system, described imaging system comprises camera lens module, image sensing module, wherein,
In the viewfinder range of described camera lens module, one appointed area is set with the first pre-defined rule;
Described imaging system is provided with image output module, and described image output module is according to the second predefined procedure output image;
Described imaging system is provided with Region dividing module, and described imaging system is also provided with a Focusing module,
Described Region dividing module divides a setting number subregion arranged along described image outbound course in described appointed area, described Focusing module sequentially successively carries out focusing calculating according to the image output of described setting number sub regions and judges, and adjusts the relative position of described camera lens module and described image sensing module according to described result of focusing calculating and judgement; Until focused.
Preferably, specifically comprise the following steps:
Step 101, area-of-interest and sub-zone dividing; Be set as area-of-interest with described appointed area, and by described Region dividing module, described area-of-interest be divided into setting number sub regions;
Step 102, the view data that described image output module often completes a sub regions exports, and performs step 103;
Step 103, focusing judges and calculates: described Focusing module to has exported each described in the image of subregion carry out focus and calculate and judge whether the current lens location of described camera lens module has reached the best, if not, execution step 104, if so, step 105 is entered;
Step 104, camera lens adjusts: after described Focusing module adjusts the relative position of described camera lens module and described image sensor module, repeated execution of steps 102;
Step 105, focusing terminates.
Preferably, the focusing in step 103 and step 104 judges and to calculate and camera lens adjusts and completes before next subregion view data sequentially starts to export.
Preferably, described area-of-interest is divided at least two sub regions by described Region dividing module.
Preferably, described area-of-interest is divided into six sub regions by described Region dividing module.
Preferably, be provided with gap between described subregion, described gap is used within described off time, carry out focusing and calculates and camera lens adjustment.
Preferably, described first pre-defined rule is, undertaken specifying by user by an input unit or, be positioned at the default location that described camera lens module viewfinder range is preset.
Preferably, described second predefined procedure is:
Described image output module is according to the output image line by line of order from top to bottom or from top to bottom.
Preferably, described second predefined procedure is:
Image information is according to the output image by column of order from left to right or from right to left.
The fast automatic focusing mechanism of a kind of imaging system, for implementing the above-mentioned fast automatic focusing method of a kind of imaging system.
Beneficial effect: owing to adopting above technical scheme, the present invention makes full use of the output characteristic of image sensing module, in a frame image data output procedure, complete repeatedly focusing calculating adjust with camera lens, decrease the number of image frames required for focusing, accelerate focus process; Use this method can realize focusing faster than conventional method, better take experience for user provides.
Accompanying drawing explanation
Fig. 1 is that in prior art, every two field picture once calculates the time sequencing figure having adjusted focus process with camera lens;
Fig. 2 is a kind of specific embodiment of the present invention, arranges the schematic diagram of an appointed area;
Fig. 3 is the flow chart of the fast automatic focusing method of a kind of imaging system of the present invention;
Fig. 4 is a kind of specific embodiment of the present invention, area-of-interest is divided into the schematic diagram of the subregion of two longitudinal arrangements;
Fig. 5 is that the subregion divided according to Fig. 4 carries out focusing calculating and camera lens adjusts with the time sequencing figure completing a focus process;
Fig. 6 is a kind of specific embodiment of the present invention, area-of-interest is divided into the schematic diagram of the subregion of six longitudinal arrangements;
Fig. 7 is that the subregion divided according to Fig. 6 carries out focusing calculating and camera lens adjusts with the time sequencing figure completing a focus process.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite of not making creative work, all belongs to the scope of protection of the invention.
It should be noted that, when not conflicting, the embodiment in the present invention and the feature in embodiment can combine mutually.
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
With reference to Fig. 2, Fig. 3, Fig. 4, the fast automatic focusing method of a kind of imaging system, is applied to imaging system, and imaging system comprises camera lens module, image sensing module, in the viewfinder range of camera lens module, arrange an appointed area with the first pre-defined rule; Imaging system is provided with image output module, and image output module is according to the second predefined procedure output image; Imaging system is provided with Region dividing module, imaging system is also provided with a Focusing module, Region dividing module divides a setting number subregion arranged along image outbound course in appointed area, the image output order of Focusing module foundation setting number sub regions is successively carried out focusing and is calculated and judge, and the relative position of the result adjustment camera lens module calculated and judge according to focusing and image sensing module; Until focused.
The first above-mentioned pre-defined rule is, undertaken specifying by user by an input unit or, be positioned at the default location that camera lens module viewfinder range is preset.
Second predefined procedure can be according to the output image line by line of order from top to bottom or from top to bottom, or according to the output image by column of order from left to right or from right to left; Fig. 2 is the embodiment of output image line by line in accordance with the order from top to bottom.
With reference to Fig. 3, specifically comprise the following steps:
Step 101, area-of-interest and sub-zone dividing; Be set as area-of-interest 111 with appointed area, and by Region dividing module, area-of-interest 111 be divided into setting number sub regions;
Step 102, the view data that image output module often completes a sub regions exports, and performs step 103;
Step 103, focusing judges and calculates: Focusing module carries out focus to the image of each subregion exported and calculates and judge whether the current lens location of camera lens module has reached the best, if not, execution step 104, if so, enters step 105;
Step 104, camera lens adjusts: after the relative position of Focusing module adjustment camera lens module and image sensor module, repeated execution of steps 102;
Step 105, focusing terminates.
Further, the focusing in above-mentioned step 103 and step 104 judges and to calculate and camera lens adjusts and completes before next subregion view data sequentially starts to export.
Fig. 2 is the embodiment of output image line by line in accordance with the order from top to bottom, according to an aspect of this embodiment, the order that image exports is from left to right export the first row pixel, from left to right exports the second row pixel again after completing, by that analogy, until export whole frame image data.
In order to realize the present invention, area-of-interest 111 is divided at least two sub regions by Region dividing module, a kind of specific embodiment: with reference to Fig. 4, area-of-interest 111 is divided into the subregion of at least two longitudinal arrangements by Region dividing module, and subregion is respectively the first subregion 11 from top to bottom and is positioned at the second subregion 12 below the first subregion 11; The view data that the view data of the first subregion 11 exports early than the second subregion 12 exports, after the image of the first subregion 11 has exported, perform step 103, after calculating, if need to perform step 104, then the second subregion 12 view data export before adjust lens location, the second subregion 12 is obtained be adjustment lens location after image; After the image of the second subregion 12 exports, carry out focusing and calculate and camera lens adjustment.
In embodiment 1, view data is according to from left to right, and Sequential output from top to bottom, the data of the first subregion 11 complete output at first.After the data of the first subregion 11 have exported, get started focusing and calculated.The data that now calculating uses are the view data in the first subregion 11.After the calculating of the first subregion 11, adjustment camera lens module position at once.Camera lens adjustment herein completes before the view data of the second subregion 12 starts to export, and the data of such second subregion 12 will be the images after adjustment camera lens.After the view data of the second subregion 12 exports, start to utilize the data of the second subregion 12 to carry out focusing and calculate and camera lens adjustment.This adjustment completes before next frame image starts to export the data of the first subregion.Like this, with reference to Fig. 5, after the first two field picture has exported, twice focusing calculating and camera lens adjustment are carried out.By that analogy, after the second two field picture exports, complete the 3rd time and calculate and camera lens adjustment with the 4th focusing; After the 3rd two field picture exports, complete the 5th and the 6th focusing calculating and camera lens and adjust.Suppose that certain auto-focusing algorithm completes focusing after adjusting six lens locations, Fig. 5 gives image in said process and exports, and focusing calculates the time order and function order between camera lens adjustment.Visible, after image sensing module exports three two field pictures, complete six focusings and calculate and camera lens adjustment, namely complete auto-focusing.Compare with conventional method, above process saves half the time.
In order to obtain speed of focusing faster, suppose that certain auto-focusing algorithm completes focusing after adjusting six lens locations, area-of-interest 111 is divided into six sub regions by Region dividing module, as another kind of specific embodiment, with reference to Fig. 6, six sub regions are the subregion of longitudinal arrangement from top to bottom, are followed successively by the first subregion 13, second subregion 14, the 3rd subregion 15, the 4th subregion 16, the 5th subregion 17 and the 6th subregion 18; The view data that the view data of the first subregion 13 exports early than the second subregion 14 exports, after the image of the first subregion 13 has exported, perform step 103, after calculating, if need to perform step 104, then the second subregion 14 view data export before adjust lens location, the second subregion 14 is obtained be adjustment lens location after image; After the image of the second subregion 14 exports, carry out focusing and calculate and camera lens adjustment, the like, realize in a frame image data output procedure, complete six focusings and calculate and camera lens adjustment, namely realize completing focusing in a two field picture.
In sum, when the subregion number divided, when being equal to, or greater than the calculation times required for focusing, only need just can complete focusing in a frame image data output time.
Gap 23 can being provided with between the subregion of the above embodiments, calculating and camera lens adjustment for carrying out focusing in the time range of gap 23.Calculate according to focusing and camera lens is regulated the speed the difference of speed, the size in gap is also different.The speed that focusing calculates and camera lens adjusts is faster, and required gap is less; Otherwise, more greatly.
The present invention retains time enough to focusing calculating and the adjustment of camera lens below, make to complete camera lens adjustment before the output of next frame image starts, output last pixel in area-of-interest at image sensing module after, focus algorithm just can utilize the view data of area-of-interest to start working, and need not wait until that whole two field picture has exported.Area-of-interest 111 is specified according to user, is the area-of-interest 111 of a rectangle, circle or other shapes; Or, be positioned at the default location that camera lens module viewfinder range is preset.Method provided by the invention, does not change focusing calculating itself, does not require special lens adjusting method yet, but achieve the acceleration to tradition focusing.
The fast automatic focusing mechanism of a kind of imaging system, for implementing the above-mentioned fast automatic focusing method of a kind of imaging system.
The foregoing is only preferred embodiment of the present invention; not thereby embodiments of the present invention and protection range is limited; to those skilled in the art; should recognize and all should be included in the scheme that equivalent replacement done by all utilizations specification of the present invention and diagramatic content and apparent change obtain in protection scope of the present invention.