Documente Academic
Documente Profesional
Documente Cultură
a r t i c l e i n f o a b s t r a c t
Article history: Digital images are normally taken by focusing on an object, resulting in defocused background regions.
Available online 20 September 2016 A popular approach to produce an all-in-focus image without defocused regions is to capture several
input images at varying focus settings, and then fuse them into an image using offline image processing
Keywords:
software. This paper describes an all-in-focus imaging method that can operate on digital cameras.
Multi-focus
All-in-focus
The proposed method consists of an automatic focus-bracketing algorithm that determines at which
Automatic focus bracketing focuses to capture images and an image-fusion algorithm that computes a high-quality all-in-focus image.
Image fusion While most previous methods use the focus measure calculated independently for each input image, the
Digital camera proposed method calculates the relative focus measure between a pair of input images. We note that
a well-focused region in an image shows better contrast, sharpness, and details than the corresponding
region that is defocused in another image. Based on the observation that the average filtered version of
a well-focused region in an image shows a higher correlation to the corresponding defocused region in
another image than the original well-focused version, a new focus measure is proposed. Experimental
results of various sample image sequences show the superiority of the proposed measure in terms of
both objective and subjective evaluation and the proposed method allows the user to capture all-in-focus
images directly on their digital camera without using offline image processing software.
© 2016 Elsevier Inc. All rights reserved.
1. Introduction [12], and others. Even though these transform-based methods have
shown satisfactory fusion results for high quality images, there is
Many photographers are often frustrated when they try to cap- a known issue of considering limited spatial information. There-
ture a picture of an object in the foreground. When the foreground fore, such methods often lose edge and texture information, which
object is in focus, the background is out of focus, and vice versa. leads to distortions in fused images [13–22]. Furthermore, the high
This is due to the limited depth-of-field of cameras. A common so- computing cost of these methods can be inhibitive.
lution to this problem is to capture images at various focuses and Spatial domain methods can be divided into two categories:
fuse them together into an all-in-focus (AIF) image, where all visi- region-based methods [13–18] and pixel-based methods [1,19–22].
ble objects are in focus [1–23]. In region-based methods, fusion results from two-pass process-
A variety of multi-focus image fusion methods have been de- ing. These methods typically employ their own focus measure to
veloped. So far, these methods are mainly classified into two types, segment the source images into three regions: focused regions,
one of which is used in transform domain and the other in spatial defocused regions, and transition regions between focused and de-
domain [1–3]. Transform domain methods transform the original focused regions. Subsequently, different fusion rules are applied for
source images into transform coefficients, apply a unique fusion each region. Pixel-based methods, however, use one-pass process-
rule, and reconstruct the fused image by performing the inverse ing. Therefore, these methods are usually faster than region-based.
transform. Most commonly used transforms are multi-scale based In pixel-based methods, the focus measure is designed to esti-
transforms. They include gradient pyramid transform [4], Lapla- mate the focus of each pixel in an image. A focus weighting map
cian pyramid transform [5], discrete wavelet transform [6], dual is generated for each source image to determine the pixel of the
tree complex wavelet transform [7], contourlet transform [8,9], log- fused image by calculating the weighted average of pixels from
Garbor transform [10], shearlet transform [11], curvelet transform source images or by selecting the pixel demonstrating optimal fo-
cus among source images.
Various focus measures have been proposed in the literature on
the subject, which include standard deviation or variance [13,23],
* Corresponding author.
E-mail addresses: ojkwon@sejong.ac.kr (O.-J. Kwon), choisc@sju.ac.kr (S. Choi), average gradient [13], energy of Laplacian [23], spatial frequency
jangdh777@sju.ac.kr (D. Jang), hspang@sejong.ac.kr (H.-S. Pang). [14,19], energy of gradient [23], Tenenbaum gradient [24], sum-
http://dx.doi.org/10.1016/j.dsp.2016.09.005
1051-2004/© 2016 Elsevier Inc. All rights reserved.
O.-J. Kwon et al. / Digital Signal Processing 60 (2017) 200–210 201
Fig. 2. Correlation map and AFRFM map between two differently focused images: (a) sample image X (1) , (b) sample image X (2) , (c) C M X (1) X (2) (m, n) and C M (1) (2) (m, n)
X X
map, and (d) f 1:2 (m, n) and f 2:1 (m, n) map.
Fig. 3. AFRFM measurements for a sequence of multi-focused images: (a) AFRFM measurements and (b) images corresponding to peaks.
rection to reach peak positions. In current digital camera hardware ria used for classifying the area are described in Kehtarnavaza and
platforms, most step-motors for adjusting focus steps have gear Oh’s paper [34].
backlash, which requires compensation procedures that increase Once all local peaks are found, a limited number of peaks are
the focus lag time considerably. Reducing focusing lag time while selected for fast fusion. The maximum number of selected peaks is
maintaining high accuracy and low power consumption is critical chosen based on the user’s allowable fusion time on the dedicated
for real-time operation, so the frequent direction changes limit the hardware platform. The rule for selecting the limited number of
utility of BS. peaks is based on the height of the peak and the distance from the
RS [34], which is adopted in the proposed method, lowers the nearest pre-selected peak. The global peak is chosen as the first
focus lag time by scanning the focus range in a sequential man- selected peak. The next ranked peak is selected by the following
score:
ner in one direction and limiting the number of direction changes.
RS changes step size increments according to the rate of change Height( p ) Step D ( p )
Score( p ) = + , (5)
of the focus measurement. In RS, the focusing ranges are classified GHieght FRange
into four types: initial, fine, mid, and coarse. A fine area has the where Score( p ), Height( p ), GHeight, StepD( p ), and FRange are the
highest probability of containing a peak; in this area, every focus score of the pth peak, the height of the pth peak, the height of
step is examined. A mid area has a lower probability of contain- the global peak, the focus step distance from the pth peak to the
ing a peak; every four focus steps are examined. A coarse area has nearest pre-selected peak, and the total focus range, respectively.
the lowest probability of containing a peak; every ten focus steps This selecting procedure continues until all the peaks are selected,
are examined. The initial area is the position moved to just before or until the pre-defined maximum number of allowable selected
a new search routine begins after finding a local peak. The crite- peaks is reached.
204 O.-J. Kwon et al. / Digital Signal Processing 60 (2017) 200–210
2.3. Multi-focus image-fusion algorithm less than 1 second. In the platform used, this corresponded to a
search range of 350 steps. Reducing the focus search range further
Due to camera motion and focal-length change, the images improves imaging speed. Due to the optical relationship between
selected by the focus-bracketing procedure typically show small in-focus positions and zoom depths, it is not necessary to search
geometric distortions such as locally nonlinear magnification and through every step-motor position. Peddigari et al. [32] performed
displacement [25]. Therefore, an image alignment procedure is an experiment to determine the search range boundaries for vari-
demanded for the better fusion result. In our algorithm, image able zoom depths by noting the absolute in-focus step-motor posi-
alignment by enhanced correlation coefficient (ECC) maximization tion for an object at infinity and for an object closer to the camera.
[35] is performed following the focus-bracketing procedure. The Their experiment shows that the effective focus range for search-
ECC algorithm is chosen because it provides a nonlinear warp- ing can be reduced to be less than 50 percent of the total focus
ing transformation-based alignment suitable for the case of multi- range when the zoom depth is fixed. Based on this experiment,
focused images and it is also fast, well-known, and widely used we employed the reduced search range suggested by Peddigari et
in a wide range of applications, such as image registration, object al. [32] for each zoom depth.
tracking, super-resolution, and visual surveillance by moving cam- The window size of the averaging filter and the size of block
eras. B m,n were set to 7 × 7 and 5 × 5, respectively. Larger sizes may give
Fusion of multi-focused images for both FIP and high-resolution a better result, but at the expense of increased complexity. Exper-
fused images are performed on a pixel by pixel basis. Two types of iments on various test image sequences showed that larger filter
fusion rules were considered in developing the fusion algorithm: sizes negligibly improved image quality. The pre-defined maximum
the first rule selects the pixel with the best focus and the sec- number of allowable selected peaks in the focus-bracketing algo-
ond rule calculates the weighted sum for each pixel based on the rithm was chosen to be 4 to satisfy the requirement that the fusion
focus measure. The first rule is highly sensitive to noise and re- time for FHD images be within 1 second. The threshold value λ for
sults in discontinuities between focused and defocused regions. the fusion rule was experimentally chosen to be 1.4.
The second rule loses details in homogeneous regions. The pro-
posed fusion rule combines these two rules to create the fused
3.2. Fusion results
image X (1&2) = {x(1&2) (m, n)} of X (1) and X (2) as follows:
Fig. 4. Images fused by the proposed method for each sample image sequence with ROIs. (For interpretation of the references to color in this figure, the reader is referred to
the web version of this article.)
not require the ground truth reference image for computation. where F is the fused image; I ( F , X (k) ) is the mutual information
M FX Y was chosen because it is the only metric known to the au- between F and X (k) ; H ( F ) and H ( X (k) ) are the entropy of F and
thors that can compare fusion results between more than two X (k) , respectively; and K is the number of source images. The val-
(K )
source images and is the most widely used fusion performance ues of M FX for the fused results are listed in Table 1. A larger
comparison test in recently published papers. The quality met- value corresponds to better performance. By this metric, the pro-
ric for a fused image of two source images X and Y , M FX Y , was posed method is superior.
extended for the case of more than two source images, X (k) , For subjective tests, images fused by compared methods are
k = 1, 2, · · · , K , as follows: shown in Fig. 6. Since performance differences are most clear in
textured regions and between adjacent in-focus regions, a portion
of each fused image including both types of regions was selected
(K )
K
2I ( F , X (k) )
M FX = , (6) as indicated as ROIs in Fig. 4, enlarged, and presented in Fig. 6.
H ( F ) + H ( X (k) ) Comparisons may be summarized as follows:
k =1
206 O.-J. Kwon et al. / Digital Signal Processing 60 (2017) 200–210
1) For both object and background, the result of the SML-based 2) “Z”, “H”, and “C” tend to lose background details in the adja-
method is smoother than that of other methods, as observed cent areas with sharp edge, as indicated by the red arrows in
in all images in Fig. 6. Fig. 6(a), (b), (c), (d), (e), and (g).
O.-J. Kwon et al. / Digital Signal Processing 60 (2017) 200–210 207
Fig. 6. Subjective comparison with other methods for the ROIs in Fig. 4. (For interpretation of the references to color in this figure, the reader is referred to the web version
of this article.)
3) “Z”, “H”, and “C” show zigzag distortions on diagonal edges 6) Compared to other methods, noticeable distortion is not found
between object and background, as indicated by the yellow in the images fused by the proposed method.
arrows in Fig. 6(a) and (c).
4) “Z”, “H”, and “C” lose thin structures such as hairs, as indicated It is interesting that the SML-based method obtained almost
(K )
by the red arrow in Fig. 6(f). compatible M FX scores with “Z” and “H” but resulted in subjec-
5) “Z” and “H” tend to lose weak shadows, as indicated by the tively poorer quality images. This suggests that further research is
yellow arrow in Fig. 6(f). needed to improve the state-of-the-art objective metrics for evalu-
208 O.-J. Kwon et al. / Digital Signal Processing 60 (2017) 200–210
Fig. 6. (continued)
Table 1 fusing, so most of the fusion was performed by the selection rule
(K )
M FX Comparison with other methods. which required no computation. Table 2 shows the execution times
Image sequence “Z” “H” “C” SML Proposed for all sample image sequences and fusing methods. As shown in
P1 1.0361 0.9684 0.7930 0.9767 1.2369 the table, the proposed and SML-based methods are significantly
P2 1.1154 1.1527 0.8512 1.0804 1.1923 less complex than “Z”, “H”. and “C”. For sequences of less than
P3 1.4579 1.4246 1.3419 1.5564 1.5969 four input images, the complexity of the proposed method is com-
P4 0.9246 0.9117 0.8381 0.9793 1.1597
parable to that of the SML-based method. For sequences of four
P5 0.8883 0.9041 0.6240 0.7691 0.9975
P6 0.8706 0.8654 0.6731 0.8365 0.8739 input images, the complexity of the proposed method is slightly
P7 0.9234 0.9423 0.8935 1.1258 1.1318 higher than that of the SML-based method. When fusing four FHD-
sized source images, the proposed method performed the fusion in
Average 1.0309 1.0242 0.8593 1.0463 1.1699
about 1 second on the experimental platform.
Table 2 [10] R. Redondo, F. Šroubek, S. Fischer, G. Cristóbal, Multifocus image fusion using
Comparison of fusing method execution times (in seconds). the log-Gabor transform and a multisize windows technique, Inf. Fusion 10 (2)
(2009) 163–171.
Image size Image sequence “Z” “H” “C” SML Proposed
[11] Q. Miao, C. Shi, P. Xu, M. Yang, Y. Shi, Multi-focus image fusion algorithm based
VGA P1 1.423 0.531 1.102 0.070 0.069 on shearlets, Chin. Opt. Lett. 9 (4) (2011) 041001.
P2 2.023 0.703 1.169 0.089 0.115 [12] S. Zhenfeng, L. Jun, C. Qimin, Fusion of infrared and visible images based on
P3 2.314 0.669 1.103 0.087 0.110 focus measure operators in the curvelet domain, Appl. Opt. 51 (12) (2012)
P4 1.286 0.600 1.067 0.067 0.067 1910–1921.
P5 1.183 0.634 1.026 0.069 0.070 [13] X. Zhang, X. Li, Z. Liu, Y. Feng, Multi-focus image fusion using image-partition-
P6 1.485 0.517 1.025 0.070 0.069 based focus detection, Signal Process. 102 (2014) 64–76.
P7 2.606 0.771 1.099 0.106 0.163 [14] S. Li, B. Yang, Multifocus image fusion using region segmentation and spatial
Average 1.760 0.632 1.084 0.079 0.095 frequency, Image Vis. Comput. 26 (7) (2008) 971–979.
[15] Z. Zhou, S. Li, B. Wang, Multi-scale weighted gradient-based fusion for multi-
FHD P1 5.451 3.309 5.012 0.360 0.355
focus images, Inf. Fusion 20 (2014) 60–72.
P2 7.406 3.617 5.748 0.526 0.669
[16] J. Duan, G. Meng, S. Xiang, C. Pan, Multifocus image fusion via focus segmen-
P3 7.766 3.446 5.336 0.507 0.682
tation and region reconstruction, Neurocomputing 140 (2014) 193–209.
P4 5.023 3.103 5.672 0.357 0.341
[17] S. Li, X. Kang, J. Hu, B. Yang, Image matting for fusion of multi-focus images in
P5 5.503 3.394 5.10 0.358 0.348
dynamic scenes, Inf. Fusion 14 (2) (2013) 147–162.
P6 4.406 3.102 5.4 0.357 0.346
[18] L. Chen, J. Li, C.P. Chen, Regional multifocus image fusion using sparse repre-
P7 10.069 3.977 5.928 0.653 1.044
sentation, Opt. Express 21 (4) (2013) 5182–5197.
Average 6.518 3.421 5.457 0.445 0.541
[19] S. Li, J.T. Kwok, Y. Wang, Combination of images with diverse focuses using the
spatial frequency, Inf. Fusion 2 (3) (2001) 169–176.
[20] J. Tian, L. Chen, L. Ma, W. Yu, Multi-focus image fusion using a bilateral
ter contrast, sharpness, and details than the corresponding region gradient-based sharpness criterion, Opt. Commun. 284 (1) (2011) 80–87.
that is defocused in another image and the average filtered ver- [21] H. Li, Y. Chai, H. Yin, G. Liu, Multifocus image fusion and denoising scheme
sion of a well-focused region shows a higher correlation to the based on homogeneity similarity, Opt. Commun. 285 (2) (2012) 91–100.
corresponding defocused region in another image than the original [22] V. Naidu, Multi focus image fusion using the measure of focus, J. Opt. 41 (2)
(2012) 117–125.
well-focused version, the AFRFM was proposed. The AFRFM has [23] W. Huang, Z. Jing, Evaluation of focus measures in multi-focus image fusion,
shown that it allows for a simple calculation of the focus differ- Pattern Recognit. Lett. 28 (4) (2007) 493–500.
ence between two images and provides a recursive rule for fusing [24] T.T.E. Yeo, S. Ong Jayasooriah, R. Sinniah, Autofocusing for tissue microscopy,
more than two images. Image Vis. Comput. 11 (10) (1993) 629–639.
[25] S.K. Nayar, Y. Nakagawa, Shape from focus, IEEE Trans. Pattern Anal. Mach. In-
A focus bracketing algorithm using AFRFM was implemented
tell. 16 (8) (1994) 824–831.
for bracketing multi-focus image sequences and AIF imaging on a [26] K.-S. Choi, J.-S. Lee, S.-J. Ko, New autofocusing technique using the frequency
digital camera platform. The proposed method outperformed pre- selective weighted median filter for video cameras, IEEE Trans. Consum. Elec-
viously published methods in constructing high-resolution AIF im- tron. 45 (3) (1999) 820–827.
ages from several critical image sequences in both subjective and [27] V. Aslantas, R. Kurban, A comparison of criterion functions for fusion of multi-
focus noisy images, Opt. Commun. 282 (16) (2009) 3231–3242.
objective tests of quality and efficiency. [28] H. Zhao, Z. Shang, Y.Y. Tang, B. Fang, Multi-focus image fusion based on the
The proposed method works for still images. Future research neighbor distance, Pattern Recognit. 46 (3) (2013) 1002–1011.
will focus on extending this method for videos. [29] K. Panetta, C. Gao, S. Agaian, No reference color image contrast and quality
measures, IEEE Trans. Consum. Electron. 59 (3) (2013) 643–651.
[30] H. Yeganeh, Z. Wang, Objective quality assessment of tone-mapped images,
Acknowledgments IEEE Trans. Image Process. 22 (2) (2013) 657–667.
[31] M. Narwaria, M.P. Da Silva, P. Le Callet, R. Pepion, Tone mapping based HDR
This work was supported by the ICT Standardization program of compression: does it affect visual experience?, Signal Process. Image Commun.
29 (2) (2014) 257–273.
MSIP (The Ministry of Science, ICT & Future Planning).
[32] V. Peddigari, M. Gamadia, N. Kehtarnavaz, Real-time implementation issues in
passive automatic focusing for digital still cameras, J. Imaging Sci. Technol.
Appendix A. Supplementary material 49 (2) (2005) 114–123.
[33] J. Jeon, I. Yoon, D. Kim, J. Lee, J. Paik, Fully digital auto-focusing system with
automatic focusing region selection and point spread function estimation, IEEE
Supplementary material related to this article can be found on- Trans. Consum. Electron. 56 (3) (2010) 1204–1210.
line at http://dx.doi.org/10.1016/j.dsp.2016.09.005. [34] N. Kehtarnavaz, H.-J. Oh, Development and real-time implementation of a rule-
based auto-focus algorithm, Real-Time Imaging 9 (3) (2003) 197–203.
[35] G.D. Evangelidis, E.Z. Psarakis, Parametric image alignment using enhanced cor-
References
relation coefficient maximization, IEEE Trans. Pattern Anal. Mach. Intell. 30 (10)
(2008) 1858–1865.
[1] S. Pertuz, D. Puig, M.A. Garcia, A. Fusiello, Generation of all-in-focus images [36] ZereneStacker, http://www.zerenesystems.com.
by noise-robust selective fusion of limited depth-of-field images, IEEE Trans. [37] HeliconFocus, http://www.heliconsoft.com.
Image Process. 22 (3) (2013) 1242–1251. [38] CombineZP, http://www.hadleyweb.pwp.blueyonder.co.uk.
[2] A. Saha, G. Bhatnagar, Q.J. Wu, Mutual spectral residual approach for multifocus [39] M. Hossny, S. Nahavandi, D. Creighton, Comments on ‘information measure for
image fusion, Digit. Signal Process. 23 (4) (2013) 1121–1135. performance of image fusion’, Electron. Lett. 44 (18) (2008) 1066–1067.
[3] K.-L. Hua, H.-C. Wang, A.H. Rusdi, S.-Y. Jiang, A novel multi-focus image fusion
algorithm based on random walks, J. Vis. Commun. Image Represent. 25 (5)
(2014) 951–962. Oh-Jin Kwon received his M.S. degree from the University of Southern
[4] V.S. Petrović, C.S. Xydeas, Gradient-based multiresolution image fusion, IEEE California, Los Angeles in 1991, and his Ph.D. degree from the University of
Trans. Image Process. 13 (2) (2004) 228–237. Maryland, College Park in 1994; both were in electrical engineering. From
[5] W. Wang, F. Chang, A multi-focus image fusion method based on Laplacian 1984 to 1989, he was a researcher at the Agency for Defense Development
pyramid, J. Comput. 6 (12) (2011) 2559–2566. of Korea, and from 1995 to 1999, he was the head of Media Lab in Sam-
[6] G. Pajares, J.M. De La Cruz, A wavelet-based image fusion tutorial, Pattern
sung SDS Co., Ltd., Seoul, Korea. Since 1999, he has been a faculty member
Recognit. 37 (9) (2004) 1855–1872.
at Sejong University, Seoul, Korea, where he is currently an Associate Pro-
[7] J.J. Lewis, R.J. O’Callaghan, S.G. Nikolov, D.R. Bull, N. Canagarajah, Pixel- and
region-based image fusion with complex wavelets, Inf. Fusion 8 (2) (2007)
fessor. His research interests are image and video coding, watermarking,
119–130. analyzing, fusion, and processing.
[8] Q. Zhang, B.-l. Guo, Multifocus image fusion using the nonsubsampled con-
tourlet transform, Signal Process. 89 (7) (2009) 1334–1346. Seungcheol Choi received B.S. and M.S. degrees in computer science
[9] S. Yang, M. Wang, L. Jiao, R. Wu, Z. Wang, Image fusion based on a new con- from Sejong University, Seoul, Korea in 1998 and 2001, respectively. He is
tourlet packet, Inf. Fusion 11 (2) (2010) 78–84. currently pursuing his Ph.D. in electronics engineering at the same univer-
210 O.-J. Kwon et al. / Digital Signal Processing 60 (2017) 200–210
sity. From 2001 to 2013, he was a researcher at Galaxia Communications. Hee-Suk Pang received the B.S., M.S., and Ph.D. degrees in electronics
His research interests are image and video coding, high dynamic range engineering from Seoul National University in 1994, 1996, and 2001, re-
imaging, image processing, image fusion, and JPEG. spectively. From 2001 to 2008, he was with DVC Gr., DM Research Lab., LG
Electronics as a chief research engineer. Since 2008, he has been a faculty
Dukhyun Jang is currently an M.S. student in electronics engineering member with Sejong University, Seoul, Korea, where he is currently an
at Sejong University, Seoul, Korea. His research interests are image pro- Associate Professor. His research interests are signal processing and audio
cessing and fusion. coding systems.