Segment Graph Based Image Filtering: Fast Structure-Preserving Smoothing

Feihu Zhang, Longquan Dai, Shiming Xiang, Xiaopeng Zhang

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:

  1. 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.
  2. 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.
Figure 5: The "leak" problem in traditional Tree Filters (TF), where smoothing incorrectly crosses high-contrast boundaries (indicated by blue arrows).

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:

  1. Superpixel Decomposition: The image is first partitioned into non-overlapping superpixels using the SLIC algorithm. This provides a coarse structural framework.
  2. Local MST Construction: Within each superpixel, a local Minimum Spanning Tree is built. This ensures that internal pixel relationships are governed by intensity similarity.
  3. 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).

Figure 2: Qualitative comparison of SGF against other popular filters. Note how SGF (f) avoids the halos of GF (b) and the leaks of TF (e) while maintaining sharper edges than WLS (c) or L0-smoothing (d).

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

BibTeX
@inproceedings{zhang2015segment,
  author = {Feihu Zhang and Longquan Dai and Shiming Xiang and Xiaopeng Zhang},
  title = {{Segment Graph Based Image Filtering: Fast Structure-Preserving Smoothing}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2015},
  doi = {10.1109/iccv.2015.49},
}
Figure