1. Field of the Invention
The present invention relates to computer-based tools for manipulating digital images. More specifically, the present invention relates to a method and an apparatus for efficiently applying a bilateral filter to an image.
2. Related Art
A major problem in displaying a real-world scene is that the dynamic range of color intensity values which are present in the real-world scene often greatly exceeds the dynamic range of a specific display medium which is used to display the real world scene. To solve this problem, many systems perform “HDR (High Dynamic Range) tone mapping” to reduce the dynamic range of such scenes so that they can be effectively displayed on media, such as hard-copy prints, CRT/LCD displays, and projectors. More specifically, systems that perform HDR tone mapping attempt to reduce the contrast of a natural scene so that it can be displayed on a specific display medium, while preserving image details which are critical to appreciate the original scene content.
One of the most popular techniques for HDR tone mapping is to apply a “bilateral filter” to an image. A bilateral filter is a filter that computes a new value of a pixel in the image based on the spatial closeness as well as the photometric similarity of other pixels in the image. For example, a bilateral filter may compute a new pixel value based on the values of neighboring pixels (spatial closeness) which have values that are similar (photometric similarity) to the original pixel.
Unfortunately, existing techniques for applying a bilateral filter to fan image can require a large amount of computation. More specifically, existing techniques typically use an approximation to a Gaussian function as the spatial component of the bilateral filter. Hence, to update a given pixel these existing techniques need to compute the individual contributions of each neighboring pixel during the bilateral computation. Because the range of interest is a two-dimensional area, these existing techniques typically require O(n2) operations for each pixel, where n is the radius (in number of pixels) of the filter. (Note that, big “O” notation, e.g., O(n2), is commonly used to describe the asymptotic complexity of software processes.) This is why existing techniques can be very slow, especially when the filter radius is large.
Hence, what is needed is a method and an apparatus for applying a bilateral filter to an image without the above-described performance issues.