The present application is a U.S. National Phase of International Patent Application No. PCT/CN2014/082836, entitled “IMAGE AUTO-FOCUSING METHOD AND CAMERA USING SAME,” filed on Jul. 23, 2014, which claims priority to Chinese Patent Application No. 201310318378.1, entitled “IMAGE AUTO-FOCUSING METHOD AND CAMERA USING SAME,” filed on Jul. 24, 2013, the entire contents of which are hereby incorporated by reference for all purposes.
The present disclosure relates to a camera such as surveillance camera, particularly relates to a method for calculating auto-focusing evaluation value with respect to a camera in a scene having a dynamic light source.
Auto-focusing is important for a camera to capture clear image. The performance of auto-focusing depends on accuracy and effectiveness of focusing evaluation function. A good focusing evaluation function is crucial to achieve auto-focusing in an integrated camera and may have characteristics such as good unbiasedness, single peak and anti-noise. Image blurring is usually due to loss of high frequency component, and thus a focusing evaluation function may be designed in such a way that a focused image contains more information and details than an out-of-focus image.
A focusing evaluation curve (may also be referred as “image definition evaluation curve”) under a night scene having a dynamic light source is illustrated in
In order to address above mentioned problem, according to one aspect of the present disclosure, an auto-focusing method is provided to obtain an auto-focusing evaluation curve having single peak, and thus the influence from a dynamic light source on the auto-focusing evaluation function may be decreased as much as possible.
At block 31, an image region may be divided into a plurality of sub-regions.
At block 32, a first sub-region may be selected from the plurality of sub-regions. Wherein, the first sub-region is a sub-region affected by a dynamic light source.
At block 33, the focusing evaluation value of the first sub-region may be corrected based on the focusing evaluation value of each of sub-region(s) adjacent to the first sub-region.
At block 34, the focusing evaluation value of the whole image region may be calculated according to the focusing evaluation values of each of the sub-regions.
At block 41, an image region may be divided into a plurality of sub-regions.
At block 42, a focusing evaluation value FVcur of each of the sub-regions in current frame image (may also be referred to as “current focusing evaluation value FVcur of a sub-region”) may be calculated according to a focusing evaluation function, and a focusing evaluation value changing rate δ of each of the sub-regions may also be calculated based on the current focusing evaluation value FVcur of each of the sub-regions and a focusing evaluation value FVpre of each of the sub-regions in previous frame image (may also be referred to as “previous focusing evaluation value FVpre of a sub-region”).
Wherein, the focusing evaluation function may be selected from some existing functions, such as Laplace function, Brenner function, Tenengrad function, Robert function and gradient square function. The focusing evaluation value changing rate δ of a sub-region may be calculated with the following equation:
Wherein, δ represents the focusing evaluation value changing rate of a sub-region;
FVcur represents the current focusing evaluation value of the sub-region, i.e., the focusing evaluation value of the sub-region in current frame image; and
FVpre represents the previous focusing evaluation value of the sub-region, i.e., the focusing evaluation value of the sub-region in a previous frame image.
It can be seen from above that, the focusing evaluation value changing rate δ of a sub-region may indicate changing rate of the current focusing evaluation value FVcur of the sub-region with respect to the previous focusing evaluation value FVpre of the sub-region and can be used to determine whether the sub-region is affected by a dynamic light source or not.
At block 43, according to the focusing evaluation value changing rate δ of each of the sub-regions, it may determine whether there is a sub-region affected by a dynamic light source or not. If the determination result is Yes, the process may proceed to block 44; and otherwise, the process may proceed to block 45.
For determining whether a sub-region is affected by a dynamic light source or not, it may use any one of the following methods introduced by way of example but not limit.
Method 1: if the absolute value of the focusing evaluation value changing rate δ of a sub-region is larger than a preset first threshold, it may determine that the sub-region is affected by a dynamic light source, for example, there is a dynamic light source in the sub-region.
Method 2: if the absolute value of the focusing evaluation value changing rate δ of a sub-region is larger than a preset second threshold and the focusing evaluation value changing trend in the sub-region is adverse to that of sub-region(s) adjacent to the sub-region, it may determine that the sub-region is affected by a dynamic light source.
Wherein, the first threshold and the second threshold may be set by user according to her/his experience. For example, the first threshold may usually be set as larger than the second threshold.
If it determines that there is a sub-region affected by a dynamic light source, it may be necessary to correct the current focusing evaluation value FVcur of the sub-region calculated in block 42; otherwise, the current focusing evaluation value FVcur of the sub-region calculated in block 42 would remain as it is.
At block 44, the current focusing evaluation value FVcur of a sub-region affected by a dynamic light source may be corrected according to the focusing evaluation value changing rate δ of the sub-region.
For example, the current focusing evaluation value FVcur of a sub-region affected by a dynamic light source may be corrected with the following equation:
FVcur′=FVpre(1+δ′)
Wherein, FVcur′ represents a corrected current focusing evaluation value of the sub-region;
FVpre represents the previous focusing evaluation value of the sub-region; and
δ′ represents a correction factor of the sub-region, and it may be calculated as an average value of the focusing evaluation value changing rates of the sub-region and its adjacent sub-region(s).
By correcting the current focusing evaluation value of a sub-region affected by a dynamic light source based on the focusing evaluation value changing rates of the sub-region and its adjacent sub-region(s), the influence from a dynamic light source on the calculation of focusing evaluation value may be decreased as much as possible, and thus the influence from the dynamic light source on the focusing evaluation function may be eliminated as much as possible.
Further, if there are two or more adjacent sub-regions affected by a dynamic light source, corrections to respective focusing evaluation values of these sub-regions may affect each other. In this case, corrections to respective focusing evaluation values of these sub-regions may be performed in a descending order of the absolute value of the focusing evaluation value changing rates of these sub-regions, so as to avoid or prevent a sub-region whose focusing evaluation value changing rate is relatively low from being affected by a sub-region whose focusing evaluation value changing rate is relatively high. For example, two or more sub-regions having dynamic light source may be sorted by the focusing evaluation value changing rates of these sub-regions; and then, the sub-region with the highest focusing evaluation value changing rate may be corrected at first, the sub-region with the second-high focusing evaluation value changing rate may be corrected subsequently, and the sub-region with the lowest focusing evaluation value changing rate may be corrected at last.
At block 45, the focusing evaluation value of the whole image region may be calculated according to the current focusing evaluation values of each of the sub-regions.
At block 46, it may determine whether the focusing process ends. And if it determines that the focusing process ends, the process may end; otherwise, the process may return to block 42.
If the current focusing evaluation value of a sub-region is corrected, the corrected current focusing evaluation value may be used as the current focusing evaluation value of the sub-region to calculate the focusing evaluation value of the whole image region. As to how to calculate the focusing evaluation value of the whole image region according to the focusing evaluation value of each of the sub-regions and how to determine whether the focusing process ends, any one of existing methods in the related art may be used and thus the detailed description thereof is omitted here.
An example of the present disclosure will be described with reference to
First, as shown in
The current focusing evaluation value of sub-region (i, j) may be calculated according to a focusing evaluation function, and then the focusing evaluation value changing rate of the sub-region may be calculated as described above. Taking sub-region (3, 5) as an example, if its current focusing evaluation value FV(3,5)cur is calculated according to the focusing evaluation function as 60, its previous focusing evaluation value FV(3,5)pre is 10, its focusing evaluation value changing rate δ35 may be calculated as 5 (=(60−10)/10). In this way, with respect to the image region divided into 40 sub-regions as shown in
After obtaining the focusing evaluation value changing rate of each of the sub-regions, it may determine whether there is a sub-region affected by a dynamic light source according to a predetermined rule. For example, it may determine whether the absolute value of the focusing evaluation value changing rate of a sub-region is larger than 3, and if the determination result is Yes, it may indicate that the sub-region is affected by a dynamic light source. In this way, according to the focusing evaluation value changing rate δ35 of 5, it may determine that sub-region (3, 5) is affected by a dynamic light source. For any one of other sub-regions, it may determine whether it is affected by a dynamic light source or not with the same way.
Further, for the image region divided into a plurality of sub-regions as shown in
According to an example of the present disclosure, the current focusing evaluation value of sub-region (3, 5) may be corrected as follows:
Firstly, a correction factor δ35′ of sub-region (3, 5) may be calculated. For example, if the adjacent sub-regions of sub-region (3, 5) include sub-regions (3, 4), (3, 6), (2, 5) and (4, 5), and the focusing evaluation value changing rates δ35, δ34, δ36, δ25 and δ45 of sub-regions (3, 5), (3, 4), (3, 6), (2, 5) and (4, 5) are 5, 1, 1, 1, and 2 respectively, the correction factor of δ35′ of sub-region (3, 5) may be calculated as 2 (=(5+1+1+1+2)/5).
Then, the current focusing evaluation value of sub-region (3, 5) may be corrected according to the correction factor of δ35′ of sub-region (3, 5). For example, the current focusing evaluation value of sub-region (3, 5) may be calculated as 30 (=10*(1+2)).
And thus, the current focusing evaluation value of sub-region (3, 5) may be corrected from original 60 to 30.
In another example, if it determines that there are two sub-regions (3, 5) and (5, 2) affected by a dynamic light source, the current focusing evaluation value of sub-region (3, 5) may be corrected as described above, and the current focusing evaluation value of sub-region (5, 2) may also be corrected in a similar way. Wherein, the adjacent sub-regions of sub-region (5, 2) may include sub-regions (5, 1), (5, 3) and (4, 2).
In still another example, if it determines that there are two adjacent sub-regions (3, 5) and (3, 6) affected by a dynamic light source, the current focusing evaluation values of these two adjacent sub-regions may be sequentially corrected in a descending order of the absolute value of focusing evaluation value changing rates. This is because, as described above, different order of corrections to sub-region (3, 5) and (3, 6) may cause different results. For example, if the current focusing evaluation value of sub-region (3, 5) is 60 and the current focusing evaluation value of sub-region (3, 6) is 100, it may be reasonable that, after the corrections to sub-region (3, 5) and (3, 6) are completed, the corrected current focusing evaluation value of sub-region (3, 6) is still larger than corrected current focusing evaluation value of sub-region (3, 5). So, if the focusing evaluation value changing rate δ35 of sub-region (3, 5) is lower than the focusing evaluation value changing rate δ36 of sub-region (3, 6) (for example, δ35 is 5 and δ36 is 8), the focusing evaluation value of sub-region (3, 6) may be corrected earlier than the focusing evaluation value of sub-region (3, 5), so as to prevent sub-region (3, 5) from being affected by sub-region (3, 6).
The foregoing disclosure is merely illustrative of example embodiments of the disclosure but is not intended to limit the disclosure, and any modifications, equivalent substitutions, adaptations, thereof made without departing from the spirit and scope of the disclosure shall be encompassed in the claimed scope of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2013 1 0318378 | Jul 2013 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2014/082836 | 7/23/2014 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2015/010623 | 1/29/2015 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
8730380 | Uchida | May 2014 | B2 |
20010028402 | Sugimoto | Oct 2001 | A1 |
20080316352 | Cheng | Dec 2008 | A1 |
20120050604 | Hamada | Mar 2012 | A1 |
20120162494 | Nakamura | Jun 2012 | A1 |
20130016245 | Yuba | Jan 2013 | A1 |
20130107107 | Ohbuchi | May 2013 | A1 |
20130201386 | Ohbuchi | Aug 2013 | A1 |
20140198244 | Hamada | Jul 2014 | A1 |
Number | Date | Country |
---|---|---|
1119768 | Apr 1996 | CN |
101840055 | Sep 2010 | CN |
102478699 | May 2012 | CN |
103095983 | May 2013 | CN |
103200361 | Jul 2013 | CN |
103354599 | Oct 2013 | CN |
2010122301 | Jun 2010 | JP |
Entry |
---|
ISA Chinese Patent Office, International Search Report of PCT/CN2014/082836, Oct. 27, 2014, 4 pages. |
Number | Date | Country | |
---|---|---|---|
20160165124 A1 | Jun 2016 | US |