Abstract
Edge-preserving smoothing is a cornerstone of computer vision, essential for tasks ranging from noise reduction to image abstraction. However, traditional filters often struggle with a trade-off between computational efficiency and the preservation of major image structures. This paper introduces the Segment Graph Filter (SGF), a novel approach that achieves state-of-the-art structure preservation with $O(N)$ linear time complexity. By representing images as a hybrid "segment graph" combining superpixels and local minimum spanning trees, SGF effectively eliminates common artifacts like "halos" and "leaks" while processing megapixel-scale images in fractions of a second.
The Challenge of Edge-Preserving Smoothing
The primary goal of edge-preserving filters is to remove fine-grained textures and noise while maintaining the sharpness of significant boundaries. Existing methods typically fall into two categories, each with distinct drawbacks:
- Local Filters (e.g., Bilateral and Guided Filters): These methods often produce "halo" artifacts. Because they rely on local windows, they struggle to distinguish between trivial textures and major structural edges, leading to blurring across important boundaries.
- Global Tree Filters (TF): These connect all pixels via a single Minimum Spanning Tree (MST). While they are structure-aware, they are prone to "leaks." If a single edge in the MST accidentally bridges a high-contrast boundary, the smoothing process will bleed across that boundary, destroying the image's structural integrity.
Furthermore, high-quality optimization-based filters, while effective, are often too computationally expensive for real-time applications, requiring several seconds to process a single image.
Methodology: The Segment Graph Filter (SGF)
The SGF addresses these issues through a unique hybrid data structure called the Segment Graph. The construction involves three key steps:
- Superpixel Decomposition: The image is first partitioned into non-overlapping superpixels using the SLIC algorithm. This provides a coarse structural framework.
- Local MST Construction: Within each superpixel, a local Minimum Spanning Tree is built. This ensures that internal pixel relationships are governed by intensity similarity.
- Graph Connection: Superpixels are treated as nodes and connected to their neighbors via the edge with the minimum weight (intensity difference), creating a global graph that respects local boundaries.
Smoothing is then performed using a Double Weighted Average Filter. This filter utilizes an Internal Weight based on "tree distance" within the segment graph to prevent crossing major edges, and an External Weight that applies a user-defined spatial smoothing radius. The entire process is mathematically optimized to run in linear time $O(N)$, independent of kernel size.
Key Results and Performance
The SGF demonstrates superior performance in both speed and quality compared to existing state-of-the-art methods. On a standard CPU, SGF processes a 1-megapixel color image in just 0.15 seconds, significantly faster than optimization-based methods like WLS (7.9s) or $L_0$-smoothing (9.7s).
Benchmarks and Applications
- Stereo & Optical Flow: In the Middlebury Stereo Benchmark, SGF ranked 27th out of over 150 approaches, a high standing for a local filter-based method. It also outperformed Guided Filters in most optical flow test views.
- Structure Preservation: SGF is particularly effective at preserving sharp corners and high-contrast edges, avoiding the "rounding" effect common in filters like the Rolling Guidance Filter (RGF).
- Robustness: The method is surprisingly robust to the quality of initial superpixels. Even with sub-optimal segmentation, the internal tree distances and external weights compensate to maintain structural integrity.
Conclusion
The Segment Graph Filter represents a significant advancement in image processing, offering a rare combination of high-speed performance and high-fidelity structure preservation. By leveraging the strengths of both superpixels and tree-based representations, it provides a robust solution for real-time computer vision tasks. Future work will focus on GPU implementations to enable real-time processing for high-resolution video and further automating parameter selection for diverse image types.
Summary updated