Edge-Preserving Piecewise Linear Image Smoothing Using Piecewise Constant Filters

Wei Liu, Wei Xu, Xiaogang Chen, Xiaolin Huang, Chunhua Shen, Jie YangarXiv 2018

Abstract

Edge-preserving smoothing is a fundamental operation in image processing, yet traditional filters often introduce "gradient reversal" artifacts—such as unnatural halos—because they rely on a piecewise constant model. This paper proposes a simple yet effective framework that transforms traditional filters into piecewise linear ones by smoothing an image's gradients rather than its pixel intensities. This approach effectively eliminates artifacts while significantly accelerating certain complex filters, such as the Weighted Median Filter.

Introduction

In computer vision and computational photography, edge-preserving smoothing is the core component behind HDR tone mapping and detail enhancement. Most existing filters, including the Bilateral Filter and $L_0$ Gradient Minimization, operate on a piecewise constant model. They assume that within a local neighborhood, pixel values should be roughly uniform.

However, real-world images frequently contain smooth color or light transitions (gradients). When a piecewise constant filter encounters a slope, it attempts to "flatten" it into discrete steps. When these flattened versions are used for detail enhancement, the result is often gradient reversals: pixels that should be bright become dark (and vice versa), creating distracting halos around edges. While Guided Filters offer a solution, they require a separate guidance image. This paper introduces a framework to give any standard filter the benefits of a piecewise linear model without requiring additional input.

Methodology: The Gradient Domain Approach

The authors propose a two-step framework to achieve piecewise linear smoothing using existing piecewise constant filters ($F_{pc}$):

  1. Gradient Smoothing: Instead of filtering the image $I_0$ directly, the framework computes the horizontal and vertical gradients ($\partial_x I_0$ and $\partial_y I_0$). A standard filter (like a Bilateral or Median filter) is then applied to these gradients. Because the gradient of a linear slope is a constant value, traditional filters are perfectly suited for this task.
  2. Image Reconstruction: Once the smoothed gradients are obtained, the final image $\hat{I}$ is reconstructed by solving an optimization problem. The goal is to find an image that remains similar to the original input while its gradients closely match the newly smoothed ones.
Figure 3: Signal profile analysis. The top row shows traditional piecewise constant filters causing 'staircase' effects and gradient reversals in the detail layer (purple line). The bottom row shows the proposed piecewise linear framework maintaining smooth transitions.

To ensure computational efficiency, the resulting linear system is solved using a Preconditioned Conjugate Gradient (PCG) method, which processes a one-megapixel image in approximately 0.3 seconds.

Key Insights

  • The Gradient Loophole: The core innovation lies in the realization that while an image might be piecewise linear (complex to filter), its derivative is piecewise constant (easy to filter). By shifting the problem into the gradient domain, legacy filters gain the ability to handle smooth transitions.
  • Fixing Quantization: Some fast filters, like the Weighted Median Filter, work by "binning" pixel intensities. To achieve high quality in the intensity domain, many bins are required, which is slow. However, gradients have a much smaller dynamic range. The authors found they could use far fewer bins in the gradient domain to achieve superior quality, leading to significant speedups.
  • Universal Compatibility: This framework acts as a "wrapper" that can be applied to a wide range of filters, including the Bilateral Filter, Adaptive Manifold Filter, Domain Transform Filter, and global optimization methods like $L_0$ smoothing.

Results and Performance

The proposed method successfully eliminates gradient reversal artifacts across various applications, including HDR tone mapping and detail enhancement.

Figure 5: Visual comparison of detail enhancement on the 'parrot' image. Traditional methods (a-c) exhibit noticeable halo artifacts, while the proposed gradient-domain framework (d-e) produces clean, artifact-free results.

In terms of efficiency, the framework provides a major boost for quantization-based filters. For the Weighted Median Filter, the proposed method achieved artifact-free results in 2.56 seconds using only $2^8$ bins. In contrast, the traditional intensity-domain approach required $2^{12}$ bins and took 19.32 seconds to achieve comparable quality. Additionally, a new parameter, $\beta$, allows users to fine-tune smoothing strength during reconstruction, providing greater flexibility than the original filters alone.

Limitations and Conclusion

While highly effective, the framework introduces an extra parameter ($\beta$) that requires tuning depending on the application. Furthermore, the reconstruction step involves solving a large linear system; while fast, this adds a computational floor that may be challenging for real-time mobile applications without hardware acceleration. Future research may extend this gradient-domain approach to other restoration tasks, such as denoising or deblurring, where piecewise linear assumptions are likely to outperform traditional models.

Summary updated

BibTeX
@misc{liu2018edge,
  author = {Wei Liu and Wei Xu and Xiaogang Chen and Xiaolin Huang and Chunhua Shen and Jie Yang},
  title = {{Edge-Preserving Piecewise Linear Image Smoothing Using Piecewise Constant Filters}},
  year = {2018},
  eprint = {1801.06928},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1801.06928},
}
Figure