introduces a new sharpness function for achieving passive auto-focusing, where the image sharpness information is used to bring it into focus. A comparison is ...
2011 IEEE International Conference on Consumer Electronics (ICCE)
A New Auto-Focus Sharpness Function for Digital and Smart-Phone Cameras S. Yousefi, M. Rahman, N. Kehtarnavaz, M. Gamadia University of Texas at Dallas
ABSTRACT Passive auto-focusing is a key feature in consumer level digital and smart-phone cameras and is used to capture focused images without any user intervention. This paper introduces a new sharpness function for achieving passive auto-focusing, where the image sharpness information is used to bring it into focus. A comparison is made between this introduced sharpness function and the commonly used sharpness functions in terms of accuracy and computation time. The results obtained indicate that the introduced sharpness function possesses a comparable accuracy while demanding less computation time.
II AUTO-FOCUS SHARPNESS FUNCTIONS Different sharpness functions were examined in [3] for the passive AF application. In this paper, the best performing sharpness functions identified in [3] are selected and compared to our introduced function. These functions include Vollath’s F4, Vollath’s F5 (introduced by Vollath [4]), Variance, Squared Gradient and Entropy. Let g (i, j ) be the gray level intensity of a pixel (i, j ) in an image of size M N . These sharpness functions are defined as follows: Vollath’s F4: M 1
N
M 1
N
i 1
j 1
i 1
j 1
FVoll 4 g (i , j ). g (i 1, j ) g (i , j ). g (i 2, j )
Index Terms — Auto Focus, Sharpness Function, Digital Cameras, Smart-Phone Cameras
(1)
Vollath’s F5: I INTRODUCTION Nowadays, most digital and smart-phone cameras possess a passive auto-focus (AF) feature that adjusts the focus motor position to attain a sharp image without any user intervention. In passive AF, a focused image is obtained by adjusting the distance between the lens and the image sensor based on the sharpness of captured images. Various passive AF techniques, e.g. [1], [2], have been discussed in the literature to replace the tedious process of manual focusing by merely using the captured image sharpness information and not using any additional distance sensor. A measure of image sharpness or a sharpness function is extracted from captured images at different lens positions and then the in-focus position is obtained by locating the peak of the sharpness function. Different sharpness functions have been introduced for the passive AF application. In [3], Santos et al. presented a qualitative and quantitative comparison between thirteen different sharpness functions. The main criteria used for comparing different sharpness functions are focusing accuracy (closeness to the true sharpness peak) and focusing time. A new sharpness measure is proposed in this paper that has a comparable accuracy to existing functions while demanding lower computation time. The rest of this paper is organized as follows. Section II provides an overview of some of the major existing AF sharpness functions along with the introduced function. Section III presents the comparison results in terms of accuracy and computation time. Finally, the conclusions are stated in Section IV.
978-1-4244-8712-7/11/$26.00©2011 IEEE
M 1
N
i 1
j 1
FVoll 5 g (i , j ). g (i 1, j )MNg 2
(2)
Variance:
F var
1 MN
M 1
N
i 1
j 1
g (i , j ) g 2
(3)
Squared Gradient: M
N
i 1
j 1
Fsq _ grad g (i , j 1) g (i , j ) 2
(4)
for g (i , j 1) g (i , j ) 2 th with th denoting a threshold value. Entropy:
Fentropy pk log2 pk
(5)
k
with k representing different intensity levels and
p k the
probability of the k th intensity level. A new sharpness function is proposed in this paper using the joint histogram of an image frame with the next image frame. While the main diagonal and its vicinity area of the joint histogram contain low frequency information of the captured scene, the off-diagonal area contains the high frequency or the sharpness information. For an out-of-focus image, the off-diagonal area contains less sharpness information and Sum of the Off-Diagonal (SOD) elements would be small. Conversely, a well focused image contains more sharpness information and its SOD would be higher as illustrated in Figure 1.
475
Figure 2 shows the above sharpness functions for a sample AF sequence. Sixty different AF sequences were examined here. Among the sharpness functions, variance and entropy showed a poor performance in terms of finding the true peak. The same observation was also reported in [3]. As a result, only Vollath’s F4, Vollath’s F5, Squared Gradient and SOD were further considered for performance comparison. SOD and Squared Gradient exhibited a high dynamic range. However, the accuracy of Squared Gradient was not as good as the other functions. The presence of high dynamic range is quite important since a high dynamic range allows focusing to be achieved in fewer number of iterations. For example, when using the rule-based search algorithm [1], having a higher dynamic range translates into fewer iterations of focusing control or a shorter total focusing time. Table I shows the comparison results averaged over 60 different AF sequences having a resolution of 640x480. Vollath’s F4 and SOD provided more or less the same accuracy. However, from a computation standpoint, SOD took the smallest amount of time.
Fig. 1- (left column) An out-of-focus and an in-focus sample image; (right column) corresponding joint histograms.
The number of off-diagonals plays an important role. If a high number of off-diagonals is considered, there will be less sensitivity to changes in focus motor positions. On the other hand, if a low number of off-diagonals is considered, sharpness values might become too small or even zero for a scene that contains few brightness variations. This issue can be addressed by adaptively selecting the number of off-diagonals. A simple approach would be to consider three levels of low, medium and high sharpness information and thus three numbers of off-diagonals.
Table I: Performance Comparison Sharpness Function Performance Accuracy (Percentage of cases matching the true focus position) Computation Time (Averaged time in ms on PC platform)
III IMPLEMENTATION RESULTS A comparison is presented in this section to compare the performance of different sharpness functions with the introduced one.
SOD
Vollath F4
Vollath F5
Sq. Grad.
55/60 (92%)
56/60 (93%)
50/60 (83%)
46/60 (77%)
15
35
16
56
IV CONCLUSION A new sharpness function for achieving passive AF in digital and smart-phone cameras has been introduced in this paper. The results obtained show that this new function is computationally more efficient than the commonly used sharpness functions with comparable accuracy. REFERENCES
Fig. 2 - Different sharpness functions for a sample scene as the focus motor position is changed.
[1] N. Kehtarnavaz and H. Oh, “Development and real-time implementation of a rule-based auto-focus algorithm,” Real Time Imaging, vol. 9, no.3, pp. 197-203, Jun. 2003. [2] V. Peddigari, M. Gamadia, and N. Kehtarnavaz, “Realtime implementation issues in passive automatic focusing for digital still cameras,” Journal of IS&T, vol. 49, no. 2, pp. 114-123, Mar/Apr. 2005. [3] A. Santos, C. Solorzano, J. Vaquero, J. Pena, N. Malpica, and F. Pozo, “Evaluation of autofocus functions in molecular cytogenetic analysis,” Journal of Microscopy, vol. 188, pp. 264-272, June 1997. [4] D. Vollath, “The influence of scene parameters and of noise on the behavior of automatic focusing algorithms,” Journal of Microscopy, vol. 151, pp. 133-146, June 1988.
476