Abstract: In this work, a fast Bilateral Solver for Quality Estimation Based multi-focus Image Fusion method (BS-QEBIF) is proposed. The all-in-focus image is generated by pixel-wise summing up the multi-focus source images with their focus-levels maps as weights. Since the visual quality of an image patch is highly correlated with its focus level, the focus-level maps are preliminarily obtained based on visual quality scores, as pre-estimations. However, the pre-estimations are not ideal. Thus the fast bilateral solver is then adopted to smooth the pre-estimations, and edges in the multi-focus source images can be preserved simultaneously. The edge-preserving smoothed results are utilized as final focus-level maps. Moreover, this work provides a confidence-map solution for the unstable fusion in the focus-level-changed boundary regions. Experiments were conducted on $25$ pairs of source images. The proposed BS-QEBIF outperforms the other $13$ fusion methods objectively and subjectively. The all-in-focus image produced by the proposed method can well maintain the details in the multi-focus source images and does not suffer from any residual errors. Experimental results show that BS-QEBIF can handle the focus-level-changed boundary regions without any blocking, ringing and blurring artifacts.
Introduction
In photography, the limited depth of field inherent in optical systems often results in images where only a specific range of distances is in sharp focus. Multi-Focus Image Fusion (MFF) addresses this by combining multiple source images of the same scene, each captured with a different focal point, into a single "all-in-focus" composite.
The core challenge of MFF lies in "focus-level estimation"—accurately deciding which pixels from which source image should be utilized in the final composite. Traditional methods frequently struggle with boundary artifacts such as "ringing" or blurring at focus transitions, ghosting caused by slight camera mis-registration, and unreliable estimations in low-texture regions where focus is difficult to determine.
The BS-QEBIF Framework
The proposed BS-QEBIF (Bilateral Solver for Quality Estimation Based multi-focus Image Fusion) method introduces a robust pipeline to overcome these challenges through three primary stages.
1. Quality-Based Pre-estimation
The authors argue that visual quality is highly correlated with focus levels. They utilize a Quality Deep Neural Network (QNN), trained on standard Image Quality Assessment (IQA) datasets (such as the LIVE dataset), to scan image patches and assign a quality score to every pixel. The source image with the highest score at a given coordinate is "pre-estimated" as the in-focus source.
2. Confidence Mapping and Refinement
To handle uncertainty, the authors introduce a Confidence Map ($C$). If the quality scores of two source images are very similar (e.g., in an out-of-focus background), the estimation is marked as "unreliable," preventing the system from making jittery decisions in ambiguous regions.
The primary innovation is the application of the Fast Bilateral Solver (FBS). This optimization-based filter smooths the noisy pre-estimation map while "snapping" its edges to the actual boundaries found in the source images. This edge-preserving smoothing ensures that the final focus maps are both spatially consistent and accurately aligned with physical objects.
3. Image Fusion
Finally, the refined focus maps are normalized using a sigmoid function to push weights toward 0 or 1. The all-in-focus image is then generated by a weighted pixel-wise sum of the source images.
Experimental Evaluation
The BS-QEBIF method was evaluated using 25 source image pairs, including five classic benchmarks and 20 pairs from the Lytro multi-focus dataset.
Results
The authors compared BS-QEBIF against 13 state-of-the-art methods, including Guided Filtering and various Wavelet transforms.
- Quantitative Performance: BS-QEBIF achieved the highest scores across major metrics: $Q_G$ (edge preservation), $Q_{NMI}$ (mutual information), and NCIE (nonlinear correlation). The use of the confidence map and normalization led to a 29.6% performance gain in mutual information ($Q_{NMI}$) over the baseline.
- Qualitative Quality: Visual inspection confirmed that the method effectively eliminated blocking, ringing, and blurring artifacts at focus boundaries. Furthermore, the method demonstrated significant resilience to mis-registration (slight shifts between shots), a common failure point for transform-based fusion methods.
Discussion and Future Work
While BS-QEBIF demonstrates superior performance, current limitations include its reliance on grayscale conversion for processing and the computational overhead of pixel-wise neural network inference. Future research may explore native color-space processing and optimization for real-time applications. Additionally, while the QNN excels at detecting focus-related blur, its generalization to other degradations like motion blur remains a subject for further study.
Summary updated