Summary of the invention
Fundamental purpose of the present invention is to propose a kind of focusing method, is applicable to image capture unit (as digital camera or digital code camera), can improve the unbalance problem of its resolution, promotes whole resolution and usefulness.Another object of the present invention is to propose a kind of method of adjustment of camera lens focusing step number, is applicable to digital camera or digital code camera, its camera lens can be adjusted to best focusing step number, the whole resolution when improving the camera lens focusing.
For reaching aforementioned purpose, image capture unit focusing method of the present invention is to comprise the following step:
Carry out a focusing program to determine a described primary importance to focus lens, wherein said primary importance is corresponding to a maximum contrast value;
With described focus lens is set in a plurality of diverse locations respectively, respectively takes the focusing picture of a correspondence in each diverse location; Corresponding focusing picture has been divided a central area and a plurality of outer peripheral areas at least; When taking the focusing picture, be that object is taken with a sample figure; Described sample figure cooperates the dividing mode of the picture of focusing and designs the corresponding diagram file size unanimity of zoning to guarantee; Described diverse location comprises primary importance, and the interval step number of adjacent position is identical;
The maximal value of corresponding diagram file size according to the central area of all focusing pictures, the focusing picture that will satisfy " the corresponding diagram file size of its central area is higher than a critical value with respect to described peaked percent value " remains, the corresponding diagram file size of a plurality of outer peripheral areas of the picture of respectively focusing that foundation is kept determines a second place from described these diverse locations;
More described first with the described second place, adjust step number to produce one; And
Adjust described position according to described adjustment step number to focus lens;
The corresponding diagram file size of the described central area of the pairing described focusing picture of the described second place is not less than described critical value with respect to a described peaked percent value.
On the other hand, camera lens focusing step number method of adjustment of the present invention is to be used for a digital imaging device, and described digital imaging device comprises a pair of focus lens.This method of adjustment comprises the following step:
Carry out a focusing program to determine described one first step number to focus lens, wherein said first step number is corresponding to a maximum contrast value;
With described focus lens is set in a plurality of different step numbers respectively, respectively takes the focusing picture of a correspondence in each different step number; Corresponding focusing picture has been divided a central area and a plurality of outer peripheral areas at least; When taking the focusing picture, be that object is taken with a sample figure; Described sample figure cooperates the dividing mode of focusing picture and designs the corresponding diagram file size unanimity of zoning to guarantee; Described a plurality of different step numbers comprise first step number, and the interval of adjacent step number is identical;
The maximal value of corresponding diagram file size according to the central area of all focusing pictures, the focusing picture that will satisfy " the corresponding diagram file size of its central area is higher than a critical value with respect to described peaked percent value " remains, the corresponding diagram file size of a plurality of outer peripheral areas of the picture of respectively focusing that foundation is kept determines one second step number from described these different step numbers;
More described first with described second step number, adjust step number to produce one; And
Adjust described focusing step number according to described adjustment step number to focus lens;
The corresponding diagram file size of the described central area of the pairing described focusing picture of described second step number is not less than described critical value with respect to a described peaked percent value.
Embodiment
Fig. 2 is the process flow diagram of a preferred embodiment of focusing method of the present invention.This focusing method is to be used for image capture unit, for example digital camera or digital code camera.Image capture unit has a camera lens, includes a pair of focus lens, can move forward and backward when focusing, and the size of displacement is to represent with step number.As shown in Figure 2, this flow process comprises the following step:
Step 21: carry out a focusing program with the primary importance of decision to focus lens;
Step 22: will be set in a plurality of diverse locations respectively to focus lens, and respectively take the focusing picture of a correspondence in each diverse location;
Step 23: the corresponding diagram file size of a plurality of outer peripheral areas according to each focusing picture determines the second place from described these diverse locations;
Step 24: compare first and second position, adjust step number to produce one; And
Step 25: according to the position of described adjustment step number adjustment to focus lens.
In the step 21, the focusing program is will focus lens be set in a plurality of diverse locations respectively, and calculates the pairing correlative value in each position.Calculate in the correlative value of gained at these, the pairing position of the maximum is primary importance.
Step 22 and 23 is to carry out calibration (calibration) program, to determine the optimum position (be the second place) of calibration back to focus lens.Take in this optimum position, can obtain best whole resolution, avoid unbalance.Described calibration procedure is to carry out according to the principle of " resolution of image is directly proportional with the size of its corresponding diagram file ".The File Format of figure shelves can be any industry specification commonly used, as JPEG herein.Step 22 is to be that object is taken with a sample figure (pattern chart) when taking the focusing picture.This sample figure cooperates the dividing mode (described below) of focusing picture and designs, the corresponding diagram file size unanimity of zoning to guarantee, that is under identical shooting condition, zones of different is if area is identical, its corresponding diagram shelves size is also identical.After step 22 was taken the focusing picture at each diverse location, step 23 was promptly analyzed these focusing pictures.Analysis mode is as follows: at first, every focusing picture is divided into nine big or small same area, wherein comprises a central area and eight outer peripheral areas, as shown in Figure 3.Each zone can be considered a sub-pictures, has the figure shelves size of a correspondence.The maximal value of corresponding diagram shelves size according to the central area (being denoted as A) of all focusing pictures, the focusing picture that will satisfy " the corresponding diagram file size of its central area is higher than a critical value with respect to described peaked percent value " remains, and all the other are not considered.Described critical value (as 95%) is an empirical value, can adjust with actual state.
Secondly, four corner outer peripheral areas of every the focusing picture that is just kept (upper left, lower-left, upper right and bottom right are denoted as B, C, D and E in regular turn) are chosen wherein two corresponding diagram shelves sizes for minimum.In one embodiment, calculate the corresponding diagram file size sum that each keeps two outer peripheral areas that picture is selected, and with this be that the pairing position of reservation picture of maximum is the second place.In another embodiment, calculate the poor of each corresponding diagram file size that keeps two outer peripheral areas that picture is selected, and to differ from this be that the pairing position of reservation picture of minimum is the second place.In another embodiment, then calculate respectively each corresponding diagram file size that keeps two outer peripheral areas that picture is selected and with poor.Then, N opens figure shelves focusing picture size and maximum before choosing, and from then on N opens in the focusing picture again, and the difference of choosing corresponding diagram shelves size is minimum, and it keeps the pairing position of picture and is the second place.Wherein, N is an empirical value, can adjust with actual state.
It should be noted that step 23 when analyzing the focusing picture, except the dividing mode of Fig. 3, other dividing mode is also applicable.As long as the focusing picture has been divided a central area and two outer peripheral areas (the neither limit in shape, size and orientation) at least, and the sample figure that matches is arranged, just can utilize aforementioned analysis mode to decide the second place for taking the focusing picture.
In the embodiment of Fig. 2, described these diverse locations of step 22 are to comprise primary importance, and the interval step number of adjacent position is identical.For example, it is the center that described these diverse locations can be selected with the primary importance, front and back each 5 the step scopes, and the adjacent position be spaced apart 1 the step.Owing to can represent with the focusing step number of a correspondence, therefore, behind first and second position of decision, in step 23, can directly calculate the step number gap between the correspondence focusing step number of these two positions, and obtain adjusting step number each position of focus lens.
Through calibration and obtain adjust step number after, in step 24, just can adjust step number and adjust position focus lens according to this, obtain best whole resolution.For example, when follow-up the focusing, after finishing the focusing program (be positioned at position that " in theory " have maximum contrast value to focus lens this moment), will adjust step number to the position correction one of focus lens again, just camera lens can be adjusted to best overall resolution.In one embodiment, be this to be adjusted step number exist in the internal memory of image capture unit, desirablely when being beneficial to follow-up the focusing go out to use.
The size of aforementioned adjustment step number more can change along with the different acquisition parameters of image capture unit.Therefore, in another preferred embodiment of focusing method of the present invention, except step 21 to 25, further choose one or more acquisition parameters, with under the setting value of different acquisition parameters, repeated execution of steps 21 to 24 produces corresponding adjustment step number, and acquisition parameters and the corresponding relation of adjusting step number can be stored in the internal memory of image capture unit.In step 25, can take out corresponding adjustment step number from internal memory according to the setting value of each acquisition parameters of when focusing, adjust position according to this to focus lens.Choosing of acquisition parameters decided on the degree of accuracy that will reach herein.In principle, selected parameter is many more, and the whole resolution of being reached is just good more.In one embodiment, be to choose camera lens hop count and two parameters of shooting distance.
Fig. 4 is the process flow diagram of a preferred embodiment of camera lens focusing step number method of adjustment of the present invention.This method of adjustment is to be used for a digital imaging device, as digital camera or digital code camera.Described digital imaging device has a camera lens, includes a pair of focus lens, can move forward and backward when focusing, and the size of displacement is to represent with step number.Shown in figure four, this flow process comprises the following step:
Step 41: carry out a focusing program with first step number of decision to focus lens, wherein first step number is corresponding to first correlative value;
Step 42: will be set in a plurality of different step numbers respectively to focus lens, and respectively take the focusing picture of a correspondence in each step number;
Step 43: the corresponding diagram file size of a plurality of outer peripheral areas according to each focusing picture determines second step number from described these different step numbers;
Step 44: compare first and second step number, adjust step number to produce one; And
Step 45: according to the focusing step number of described adjustment step number adjustment to focus lens.
In the step 42, described these different step numbers are to comprise first step number, and the interval of adjacent step number is identical.Step 43 is to come the focusing picture of analytical procedure 42 gained in the mode that is similar to Fig. 2 step 23, with according to the corresponding diagram file size of each two outer peripheral areas being selected of focusing picture and or poor, determine second step number.In the step 44, calculate the gap between first and second step number, be the adjustment step number.In one embodiment, be this to be adjusted step number exist in the internal memory of digital imaging device, desirablely when being beneficial to follow-up the focusing go out to use.
In another preferred embodiment of camera lens focusing step number method of adjustment of the present invention, except step 41 to 45, further choose one or more acquisition parameters, with under the setting value of different acquisition parameters, repeated execution of steps 41 to 44, produce corresponding adjustment step number, and acquisition parameters and the corresponding relation of adjusting step number are stored in the internal memory of digital imaging device.In step 45, can take out corresponding adjustment step number from internal memory according to the setting value of each acquisition parameters of when focusing, adjust position according to this to focus lens.In one embodiment, be to choose the camera lens hop count and two parameters of shooting distance are implemented this method of adjustment.
The above is to utilize preferred embodiment to describe the present invention in detail, but not limits the scope of the invention.Generally know this type of skill personage and all can understand, suitably do slightly change and adjustment, will not lose main idea of the present invention place, also do not break away from the spirit and scope of the present invention.