NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Robust Automatic Focus Algorithm for Low Contrast Images Using a New Contrast Measure

Xin Xu, Yinglin Wang, Jinshan Tang, Xiaolong Zhang, Xiaoming Liu2011

TL;DR

This paper introduces a novel passive autofocus (AF) algorithm designed to overcome the challenges of low-contrast images, particularly in noisy environments. By incorporating a modified bilateral filter for robust noise reduction and a new contrast measure (CMAN) that intelligently handles local false peaks, the algorithm significantly improves autofocus accuracy and reliability in difficult lighting conditions.

What Problem Does This Paper Address?

Achieving sharp images is crucial for digital photography, and automatic focus (AF) systems are essential for user-friendly cameras. Traditional passive AF systems, which rely solely on image information, struggle with low-contrast images. In such scenarios, the image lacks sufficient high-frequency information, making it difficult to accurately measure sharpness. Furthermore, noise, common in low-light conditions, can create numerous "false peaks" in the sharpness measurement, misleading the AF system and preventing it from finding the true focal point. This leads to blurry images, especially when shooting in dim environments. Existing methods often fail to adequately address both low contrast and noise simultaneously, or they are computationally too expensive for consumer-level devices.

Methods

The proposed algorithm builds upon the traditional passive AF framework (focusing region selection, sharpness measurement, peak search) but introduces key enhancements:

  • Noise Reduction Preprocessing: A modified bilateral filter is employed. Unlike traditional filters that assume additive noise, this modified version is designed to be robust to both additive and multiplicative noise, which are common in real-world imaging. This step is crucial for preparing the image for subsequent analysis.
  • New Contrast Measure (CMAN): The core innovation is a new contrast measure called CMAN (Contrast Measure Adaptive to Noise influence). CMAN is designed to be adaptive to the level of noise present. It starts by using a standard contrast measure (CMSL) and then, based on the number of local maxima detected, it adjusts its behavior. When noise is low, it behaves like CMSL. As noise increases, CMAN's value decreases, effectively suppressing the influence of local false peaks caused by noise. This allows for a more distinct and reliable peak to be identified, even in noisy images.
  • Modified Peak Search: A peak search algorithm, adapted from existing work, is used. It scans the entire focus range to ensure reliability, especially in low-light conditions where coarse-to-fine strategies might fail. The search is designed to be efficient and avoid exhaustive scanning, balancing speed and accuracy.

Datasets

The paper evaluates the proposed algorithm using image sequences captured by an actual digital camera. Three types of low-contrast image sequences were used, representing different noise levels:

  • Object A: Low contrast with little noise.
  • Object B: Low contrast with adequate noise.
  • Object C: Low contrast with significant noise.

These sequences were captured across 70 different lens positions, from near to far. No new benchmark datasets were introduced.

Key Insights and Ideas

  • Noise as a Double-Edged Sword: The paper highlights how noise, while detrimental, can also be leveraged. CMAN's adaptive nature uses the presence of noise to its advantage, by reducing the amplitude of false peaks and making the true focus peak more discernible.
  • Beyond Additive Noise: Recognizing the limitations of methods that only handle additive noise, the use of a modified bilateral filter for both additive and multiplicative noise is a significant step towards real-world robustness.
  • The Importance of a Well-Defined Peak: The ultimate goal is to ensure a single, clear peak in the sharpness metric. CMAN's design directly addresses this by smoothing out the "noise landscape" and emphasizing the true focus.
  • Trade-offs in AF Design: The paper implicitly discusses the inherent trade-offs in AF system design: accuracy vs. speed, robustness vs. computational cost. The proposed method aims to strike a favorable balance for low-light scenarios.

Key Results

The experimental results demonstrate the effectiveness of the proposed CMAN algorithm:

  • Low Noise Conditions: CMAN performs comparably to the standard CMSL, both identifying a clear focus peak.
  • Adequate Noise Conditions: CMAN shows a noticeable improvement. While CMSL produces a more fluctuant curve with a prominent local false peak, CMAN suppresses these false peaks, making the true focus peak distinguishable.
  • High Noise Conditions: CMAN significantly outperforms CMSL. CMSL fails to correctly identify the focus position, whereas CMAN remains robust and accurately determines the focus.

The paper states that the contrast computation in CMAN is slightly more complex than CMSL but remains acceptable for real-time AF, especially with dedicated hardware.

Limitations and Future Work

  • Computational Cost: While deemed acceptable, the CMAN contrast measure is noted as being slightly more complex than CMSL. The authors suggest that dedicated hardware (like FPGAs) can further mitigate this.
  • Parameter Tuning: The paper mentions parameters T, T1, and T2 for CMAN. The optimal values for these parameters might depend on the specific camera sensor and image characteristics, suggesting a need for careful tuning.
  • Future Work: The paper doesn't explicitly detail future work, but the success in handling low contrast and noise suggests potential applications in other challenging imaging scenarios or further refinements of the noise reduction and contrast measurement techniques. The focus on consumer-level cameras implies a continued interest in optimizing for speed and efficiency.

Summary updated

BibTeX
@misc{xu2011robust,
  author = {Xin Xu and Yinglin Wang and Jinshan Tang and Xiaolong Zhang and Xiaoming Liu},
  title = {{Robust Automatic Focus Algorithm for Low Contrast Images Using a New Contrast Measure}},
  year = {2011},
  doi = {10.3390/s110908281},
}
Figure