|
Digital Camera Patent Abstract
An auto focus method of a digital camera for moving a lens of the
digital camera to the maximum focus value position is provided.
According to certain criteria, the lens movement states are categorized
into four states, i.e. an initial state, a coarse state, a mid state
and a fine state. The numbers of search steps for the lens in different
states are different.
Digital Camera Patent Claims
1. An auto focus method of a digital camera for moving a lens of
said digital camera to the maximum focus value position, comprising
steps of: (a) calculating a focus value average FV.sub.avg of the
focus values from the first step position to the Nth step position
of said lens; (b) determining a lens movement state including a
coarse state, a mid state and a fine state, wherein said lens moves
A steps in said coarse state, B steps in said mid state and one
step in said fine state, where B is less than A; (c) moving said
lens and recording the focus value of said lens in said lens movement
state according to said focus value average FV.sub.avg, a focus
value difference FV.sub.dif, a previous maximum focus value FV.sub.max,
a coarse state threshold T.sub.c, a mid state threshold T.sub.m,
a focus value difference threshold T.sub.dif, a mid state count
value MidCount and a downhill count value DownCount; (d) repeating
steps (b) and (c) until the searching over a search range is finished;
and (e) moving said lens to a right position corresponding to the
maximum focus value.
2. The auto focus method of a digital camera according to claim
1 wherein N is equal to 5.
3. The auto focus method of a digital camera according to claim
1 wherein A is an integer from 8 to 12, and B is an integer from
3 to 5.
4. The auto focus method of a digital camera according to claim
1 wherein said coarse state threshold T.sub.c is between 1.05 and
1.15, said mid state threshold T.sub.m is between 1.1 and 1.2, and
said focus value difference threshold T.sub.dif is between 0.015
and 0.025.
5. The auto focus method of a digital camera according to claim
1 wherein said lens movement state is set to said coarse state if
FV.sub.cur<T.sub.c.times.FV.sub.avg or FV.sub.cur<0.7.times.FV.sub.max,
where FV.sub.cur is a current focus value.
6. The auto focus method of a digital camera according to claim
5 wherein said lens movement state is set to said mid state and
said downhill count value DownCount is set to zero if T.sub.c.times.FV.sub.avg<FV.sub.cur<T.sub.m.times.FV.sub.avg
and FV.sub.cur>FV.sub.max.
7. The auto focus method of a digital camera according to claim
6 wherein said lens movement state is set to said coarse state and
said downhill count value DownCount and said mid state count value
MidCount are set to zero if FV.sub.cur<FV.sub.max, MidCount>3,
DownCount is not equal to 3, and the current state is not the fine
state.
8. The auto focus method of a digital camera according to claim
6 further comprising a step of discriminating if said focus value
difference FV.sub.dif is greater than or equal to zero.
9. The auto focus method of a digital camera according to claim
8 wherein said lens movement state is set to said fine state and
said downhill count value DownCount is set to zero if FV.sub.dif>=0,
FV.sub.dif>T.sub.dif.times.FV.sub.pre and FV.sub.cur>FV.sub.max.
10. The auto focus method of a digital camera according to claim
9 wherein said lens movement state is set to said mid state and
said downhill count value DownCount is set to zero if FV.sub.dif<T.sub.dif.times.FV.sub.pre
and said lens movement state is in the fine state.
11. The auto focus method of a digital camera according to claim
10 wherein said lens movement state is set to said mid state and
said downhill count value DownCount is set to zero if FV.sub.cur<0.9.times.FV.sub.max,
or otherwise said lens movement state remains its current state.
12. The auto focus method of a digital camera according to claim
10 wherein said mid state count value MidCount adds one if FV.sub.cur>FV.sub.max.
13. The auto focus method of a digital camera according to claim
8 wherein said lens movement state is set to said fine state and
said downhill count value DownCount adds one if FV.sub.dif<zero.
14. The auto focus method of a digital camera according to claim
13 wherein said lens movement state is set to said mid state and
said downhill count value DownCount is set to zero if DownCount=3
or FV.sub.cur<0.9.times.FV.sub.max.
Digital Camera Patent Description
FIELD OF THE INVENTION
[0001] The present invention relates to an auto focus method for
use with a digital camera, and more particularly to an auto focus
method for use with a digital camera by finding the right position
with the maximum focus value.
BACKGROUND OF THE INVENTION
[0002] Currently, digital cameras are widely used to take photographs.
As known, the definition of the object taken by a digital camera
is largely effected by the focusing operation of the digital camera.
In order to achieve high image quality of the object, the focal
length should be properly adjusted to focus on the object. In other
words, the quality of the digital camera is dependent on the auto
focus method applied to the digital camera.
[0003] Generally, auto focus methods are classified into two types,
i.e. an active auto focus method and a passive auto focus method.
[0004] For implementing the active auto focus method, light patterns
are projected onto the object to be photographed by using an infrared
emitter or a laser emitter, and then the distance between the object
and the camera is calculated by triangulation or according to the
time difference from the beam projection to reception. Afterwards,
the lens of the digital camera is adjusted to a proper position
according to the distance. However, this active auto focus method
has several drawbacks. For example, the cost of the digital camera
is increased because extra detector and beam projector are needed.
[0005] The steps for implementing the passive auto focus method
are illustrated with reference of the flowchart of FIG. 1. Unlike
the active auto method, the passive auto focus method determines
the distance between the object and the camera without projecting
any light pattern onto the object. Afterwards, the lens of the digital
camera is moved to multiple possible positions and the image qualities
at different positions are analyzed in order to determine an accurate
lens position. Firstly, the lens of the camera is moved to a first
position and the image data at this position is captured (Step 100).
Then, the focus value of the image is calculated (Step 200). If
this focus value is the maximum focus value (Step 300), the auto
focus (AF) process is finished. Otherwise, the lens is moved to
the next position (Step 400), and the steps 200, 300 and 400 are
repeated until the maximum focus value is searched.
[0006] From the flowchart of FIG. 1, the passive auto focus method
includes two parts, i.e. the focus value measurement and the lens
position search algorithm.
[0007] Conventionally, there are several means for implementing
focus value measurements such as gradient magnitude measurement,
Robert edge detector, Sobel edge detector, Laplacian filter, infinite
impulse response (IIR) filter, etc. These focus value measurements
are well known to those skilled in the art, and are not intended
to describe redundantly herein.
[0008] The conventional lens position search algorithms include
for example global search algorithm, hill-climbing search algorithm,
binary search algorithm and ruled-based search algorithm.
[0009] Typically, search time, number of the lens movement steps
and search accuracy are all very important for the lens position
search algorithm. Generally, longer search time means lower auto
focus efficiency, and more lens movement steps consume more power
of the camera because each movement step needs power. Whereas, too
short search time or insufficient movement steps are detrimental
to the searching accuracy. These lens position search algorithms
have respective advantages or drawbacks. Consequently, the designer
may select one of these lens position search algorithms according
to the practical requirement.
[0010] For example, since the global search algorithm captures
image in every lens movement step and determines the position with
the maximum focus value, the search result of the global search
algorithm is the most correct among these lens position search algorithms.
However, the global search algorithm needs too long search time
and too many lens movement steps. In addition, the binary search
algorithm is faster than global search algorithm but is more prone
to be affected by noise. Moreover, the lens needs to move back and
forth to obtain the peak position, which might suffer from mechanical
backlash problem.
[0011] The ruled-based search algorithm determines the search steps
for each lens movement step according to certain rules and then
records the focus value of the lens at each position. Since the
rules allow the assembler to capture acceptable image data of the
lens without measuring the focus value for each lens movement step,
the search time for implementing the ruled-based search algorithm
is shortened. The search rules are shown as follows. TABLE-US-00001
IF C.sub.Iteration .ltoreq. 5 THEN A.sub.Control = Initial ELSE
IF F.sub.Current .ltoreq. 0.25'F.sub.Max, THEN A.sub.Control = Coarse;
C.sub.Down = 0; ELSE D.sub.F = F.sub.Current - F.sub.Previous IF
D.sub.F > 0.25'F.sub.Previous, THEN A.sub.Control = Fine; C.sub.Down
= 0; ELSE IF A.sub.Control = Fine AND D.sub.F > 0, THEN C.sub.Down
= 0; ELSE IF D.sub.F < 0 IF A.sub.Control = Fine, THEN C.sub.Down
+ +; IF C.sub.Down = 3, THEN A.sub.Control = Mid; C.sub.Down = 0;
ELSE A.sub.Control = Mid; C.sub.Down = 0; END IF END IF END IF UPDATE
F.sub.Max; F.sub.Previous = F.sub.Current;
[0012] In the above rules, F.sub.Current is sharpness value from
current image data, F.sub.Previous is sharpness value from previous
image data, F.sub.Max is maximum sharpness value, C.sub.Iteration
is iteration counter, A.sub.Contro: is control area, and C.sub.Down
is downhill counter.
[0013] In views of the above-described disadvantages resulted from
the prior art, the applicant keeps on carving unflaggingly to develop
an auto focus method for use with a digital camera according to
the present invention through wholehearted experience and research.
SUMMARY OF THE INVENTION
[0014] It is an object of the present invention to provide an auto
focus method for searching the right position of the lens corresponding
to the maximum focus value according to several criteria, thereby
reducing the search time and achieving good image quality.
[0015] It is another object of the present invention to provide
an auto focus method of a digital camera in order to achieve quick
and correct focusing results.
[0016] In accordance with a first aspect of the present invention,
there is provided an auto focus method of a digital camera for moving
a lens of the digital camera to the maximum focus value position,
comprising steps of: (a) calculating a focus value average FV.sub.avg
of the focus values from the first step position to the Nth step
position of the lens; (b) determining a lens movement state including
a coarse state, a mid state and a fine state, wherein the lens moves
A steps in the coarse state, B steps in the mid state and one step
in the fine state, where B is less than A; (c) moving the lens and
recording the focus value of the lens in the lens movement state
according to the focus value average FV.sub.avg, a focus value difference
FV.sub.dif, a previous maximum focus value FV.sub.max, a coarse
state threshold T.sub.c, a mid state threshold T.sub.m, a focus
value difference threshold T.sub.dif, a mid state count value MidCount
and a downhill count value DownCount; (d) repeating steps (b) and
(c) until the searching over a search range is finished; and (e)
moving the lens to a right position corresponding to the maximum
focus value.
[0017] The above objects and advantages of the present invention
will become more readily apparent to those ordinarily skilled in
the art after reviewing the following detailed description and accompanying
drawings, in which:
BRIEF DESCRIPTION OF THE DRAWINGS
[0018] FIG. 1 is a flowchart illustrating the steps of a passive
auto focus method;
[0019] FIG. 2 is a typical curve plot illustrating the relation
between lens search steps versus focus values;
[0020] FIGS. 3(a) and 3(b) are flowcharts illustrating the steps
of an auto focus method according to a preferred embodiment of the
present invention;
[0021] FIG. 4 is a curve plot illustrating the relation between
focus value versus lens search steps according to the present invention;
[0022] FIG. 5 illustrates the image and the FV curve of a first
image by using the auto focus method of the present invention and
the conventional global search algorithm;
[0023] FIG. 6 illustrates the image and the FV curve of a second
image by using the auto focus method of the present invention and
the conventional global search algorithm;
[0024] FIG. 7 illustrates the image and the FV curve of a third
image by using the auto focus method of the present invention and
the conventional global search algorithm; and
[0025] FIG. 8 illustrates the image and the FV curve of a fourth
image by using the auto focus method of the present invention and
the conventional global search algorithm.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
[0026] FIG. 2 is a typical curve plot illustrating the relation
between lens search steps versus focus values. The principal object
of the present invention is to find out the lens position having
the maximum focus value, i.e. the peak value. Nevertheless, the
focus values within the in-focus range, i.e. zone A, are acceptable.
[0027] For a purpose of reducing the search time, the lens movement
states are categorized into four states according to certain criteria
and the numbers of search steps in different states are different.
[0028] According to the present invention, the lens movement state
includes an initial state, a coarse state, a mid state and a fine
state.
[0029] In the initial state, the average of the focus values from
the first step position to the fifth step position is used as a
criterion for determining next state and initializes all variables.
[0030] In the coarse state, the focus values are stable and the
FV curve is flat. As shown in FIG. 2, the existence of global peak
is almost impossible in this state. Therefore, each focal value
measurement is done when the lens moves 8.about.12 steps in the
coarse state.
[0031] In the mid state, the focus values change more and the FV
curve might have the local peak. The local peak might be the global
peak. In order to save search time and not lose the information
in this state, each focal value measurement is done when the lens
moves 3.about.5 steps in the mid state.
[0032] In the fine state, the FV curve goes up or down sharply
and the possibility of containing global peak is very high. For
achieving the maximum focus value, each focus value measurement
is done when the lens moves 1 step in the fine state.
[0033] The criteria for discriminating the lens movement states
according to the auto focus method of the present invention are
illustrated with reference of the flowchart of FIG. 3.
[0034] After the auto focus starts, the first criterion (Criterion
1) is used to judge whether the search position is the first five
steps. If the first criterion is satisfied, the lens movement state
enters the initial state. In the initial state, the average FV.sub.avg
of the focus values from the first step position to the fifth step
position is calculated.
[0035] Afterwards, a focus value difference FV.sub.dif, which is
the difference between the current focus value FV.sub.cur and the
previous focus value FV.sub.pre, is calculated (Criterion 1.1).
[0036] The previous maximum focus value FV.sub.max is also recorded
and updated and thus the previous maximum focus value FV.sub.max
is varied.
[0037] Moreover, a coarse state threshold T.sub.c, a mid state
threshold T.sub.m, a focus value difference threshold T.sub.dif,
a mid state count value MidCount and a downhill count value DownCount
are used to determine the states of the lens movement state.
[0038] When the focus value difference FV.sub.dif is smaller than
zero in the fine state, the downhill count value DownCount should
add one. If the lens is not in the fine state, the downhill count
value DownCount should be set to zero. When the current focus value
FV.sub.cur is smaller than previous maximum focus value FV.sub.max
in the mid state, mid state count value MidCount should add one.
[0039] In a preferred embodiment, the coarse state threshold T.sub.c
is ranged between 1.05 and 1.15, the mid state threshold T.sub.m
is ranged between 1.1 and 1.2, and the focus value difference threshold
T.sub.dif is ranged between 0.015 and 0.025.
[0040] The second criterion (Criterion 2) discriminates if FV.sub.cur<T.sub.c.times.FV.sub.avg
or FV.sub.cur<0.7.times.FV.sub.max. If the second criterion is
satisfied, the focus value is small enough to be in the coarse state,
and the downhill count value DownCount is set to zero. Otherwise,
the next criterion is taken into consideration.
[0041] The third criterion (Criterion 3) discriminates if T.sub.c.times.FV.sub.avg<FV.sub.cur<T.sub.m.times.FV.sub.avg
and FV.sub.cur>FV.sub.max. If the third criterion is satisfied,
the lens movement state is in the mid state, and the downhill count
value DownCount is set to zero. Otherwise, the next criterion is
taken into consideration.
[0042] The fourth criterion (Criterion 4) discriminates if FV.sub.cur<FV.sub.max,
MidCount>3, DownCount is not equal to 3, and the current state
is not the fine state. If the fourth criterion is satisfied, the
lens movement state is in the coarse state, and the downhill count
value DownCount and the mid state count value MidCount are set to
zero. Otherwise, the next criterion is taken into consideration.
[0043] If DownCount is equal to 3 or more, it is deemed that the
actual peak is found. Under this circumstance, the lens movement
state is set to the mid state. If MidCount is larger than 3, the
possibility of containing a peak gets smaller and the lens movement
state is set to the coarse state.
[0044] The fifth criterion (Criterion 5) discriminates if the focus
value difference FV.sub.dif is greater than or equal to zero.
[0045] If the fifth criterion is satisfied, the sixth criterion
(Criterion 6) is further used to discriminate if FV.sub.dif>T.sub.dif.times.FV.sub.pre
and FV.sub.cur>FV.sub.max. If the sixth criterion is satisfied,
the lens movement state is in the fine state, and the downhill count
value DownCount is set to zero. Otherwise, the next criterion is
taken into consideration. Normally, the sixth criterion takes effect
during the peak in FV curve.
[0046] The seventh criterion (Criterion 7) discriminates if FV.sub.dif<T.sub.dif.times.FV.sub.pre
and the lens movement state is in the fine state. If the seventh
criterion is satisfied, the lens movement state is set to the mid
state, and the downhill count value DownCount is set to zero. Otherwise,
the next criterion is taken into consideration.
[0047] The eighth criterion (Criterion 8) discriminates if FV.sub.cur<0.9.times.FV.sub.max.
If the eighth criterion is satisfied, the lens movement state is
set to the mid state, and the downhill count value DownCount is
set to zero. Otherwise, the lens movement state remains its current
state.
[0048] The ninth criterion (Criterion 9) discriminates if FV.sub.cur>FV.sub.max.
If the ninth criterion is satisfied, the mid state count value MidCount
should add one.
[0049] If the fifth criterion is not satisfied, i.e. FV.sub.dif
is less than zero, the tenth criterion (Criterion 10) is used to
discriminate if the current state is the fine state. If the tenth
criterion is satisfied, the lens movement state remains the fine
state and the downhill count value DownCount should add one. Otherwise,
the next criterion is taken into consideration.
[0050] The eleventh criterion (Criterion 11) discriminates if DownCount=3
or FV.sub.cur<0.9.times.FV.sub.max. If the eleventh criterion
is satisfied, the downhill count value DownCount is set to zero
and the lens movement state is set to the mid state.
[0051] After the state is decided according to the above criteria,
the lens moves in the state, and FV.sub.pre and FV.sub.max are updated.
If the search range is finished, the maximum focus value FV.sub.max
and its corresponding step position are found. After the lens moves
to the right position with the maximum focus value FV.sub.max, the
auto focus process is finished.
[0052] FIG. 4 is a curve plot illustrating the relation between
focus value versus lens search steps. The horizontal coordinate
and the vertical coordinate denote the lens search steps and the
focal length, respectively.
[0053] Hereinafter, with respect to a first image, the performance
of using the auto focus method of the present invention and the
conventional global search algorithm will be illustrated with reference
to FIG. 5. The items for determining the performance include actual
image, FV curve, total search iterations, total steps and search
time. FIG. 5A1 illustrates the image focused by the present auto
focus method. FIG. 5A2 indicates the FV curve of the present auto
focus method. Whereas, FIGS. 5B1 and 5B2 illustrate the image focused
by the global search algorithm and FV curve of the global search
algorithm, respectively.
[0054] As shown in FIGS. 5A1 and 5B1, the subject at the center
of the image contains lots of high frequency components. In addition,
the image shown in FIG. 5A1 is very similar to that shown in FIG.
5B1.
[0055] When the present auto focus method is implemented, the number
of total search iterations is 37, the actual focus time is 1.5 second
and the number of total move steps is 69. Whereas, by using the
global search algorithm, the number of total search iterations is
140, the actual focus time is 4.9 second and the number of total
move steps is 172.
[0056] With respect to a second image, the performance of using
the auto focus method of the present invention and the conventional
global search algorithm will be illustrated with reference to FIG.
6. FIG. 6A1 illustrates the image focused by the present auto focus
method. FIG. 6A2 indicates the FV curve of the present auto focus
method. Whereas, FIGS. 6B1 and 6B2 illustrate the image focused
by the global search algorithm and FV curve of the global search
algorithm, respectively.
[0057] The images shown in FIGS. 6A1 and 6B1 are very clear. As
shown in FIG. 6A2, the first to the fifth steps are in the initial
state, and then the coarse state is entered. Once the FV curve is
going uphill, the state becomes the mid state. When the peak is
approached, the fine state is set. Once the peak is found and starts
downhill, the mid state is set, and the search process is finished
in the coarse state.
[0058] When the present auto focus method is implemented, the number
of total search iterations is 52, the actual focus time is 2.1 second
and the number of total move steps is 84. Whereas, by using the
global search algorithm, the number of total search iterations is
140, the actual focus time is 4.9 second and the number of total
move steps is 172.
[0059] With respect to a third image, the performance of using
the auto focus method of the present invention and the conventional
global search algorithm will be illustrated with reference to FIG.
7. FIG. 7A1 illustrates the image focused by the present auto focus
method. FIG. 7A2 indicates the FV curve of the present auto focus
method. Whereas, FIGS. 7B1 and 7B2 illustrate the image focused
by the global search algorithm and FV curve of the global search
algorithm, respectively.
[0060] The image shown in FIG. 7A1 or FIG. 7B1 has two main peaks.
The smaller peak appears earlier than the larger one. As shown in
FIG. 7A2, successively, the previous peak is firstly found, the
FV curve goes downhill, and the mid state is entered and then switched
to the fine state so as to further find another peak. From this
image, it is demonstrated that the real peak can be found by using
the auto focus method of the present invention even when there exists
a local peak.
[0061] When the present auto focus method is implemented, the number
of total search iterations is 58, the actual focus time is 2.4 second
and the number of total move steps is 90. Whereas, by using the
global search algorithm, the number of total search iterations is
140, the actual focus time is 4.9 second and the number of total
move steps is 172.
[0062] With respect to a fourth image, the performance of using
the auto focus method of the present invention and the conventional
global search algorithm will be illustrated with reference to FIG.
8. FIG. 8A1 illustrates the image focused by the present auto focus
method. FIG. 8A2 indicates the FV curve of the present auto focus
method. Whereas, FIGS. 8B1 and 8B2 illustrate the image focused
by the global search algorithm and FV curve of the global search
algorithm, respectively.
[0063] The image shown in FIG. 8A1 or FIG. 8B1 has two main peaks.
However, the larger peak appears earlier than the smaller one. As
shown in FIG. 8A2, since the global peak is found earlier than the
local peak, the local peak is searched simply in the coarse state
rather than the fine state.
[0064] When the present auto focus method is implemented, the number
of total search iterations is 54, the actual focus time is 2.3 second
and the number of total move steps is 86. Whereas, by using the
global search algorithm, the number of total search iterations is
140, the actual focus time is 4.9 second and the number of total
move steps is 172.
[0065] While the invention has been described in terms of what
is presently considered to be the most practical and preferred embodiments,
it is to be understood that the invention needs not be limited to
the disclosed embodiment. On the contrary, it is intended to cover
various modifications and similar arrangements included within the
spirit and scope of the appended claims which are to be accorded
with the broadest interpretation so as to encompass all such modifications
and similar structures. |