From the Lab
Leaky Integration Part 2 - High Frequency Texture Filtering
Bernard Llanos — August 14, 2013 - 12:32pm
Continuing the discussion of outlier removal from my previous post (http://gigl.scs.carleton.ca/node/543), I am demonstrating a case where the poor noise removal characteristics of the leaky integration filter is an advantage.
Consider the following source image:
Image Credit: Rob Knight (via Flickr), http://www.flickr.com/photos/rknight/
The texture of the sand in the foreground is quite similar to a random noise pattern composed of a small number of contrasting colours, and is filtered in much the same way, as shown below:
(In the above montage, all images were produced with a gamma parameter value of zero.)
It is difficult to see in the figure above, but the plane-averaging filter removes slightly more texture from the sand than the normal cumulative range geodesic filter.
An interesting feature of the montage of images shown above is that the results from alpha values of 0, 0.51, and 0.77 are quite similar, and all are significantly different from the result obtained with an alpha value of 1. This can be explained by noting that the distance to a given pixel in the mask (refer to the equations in the previous post) is the sum of a geometric sequence (in the hypothetical case where all incremental distances are equal). If the path to a given pixel did not change with alpha, the distance to the pixel would be approximately proportional to the reciprocal of the quantity (1-alpha). Consequently, variations in alpha will have more effect when alpha is near 1.
The dependence of the filtering process on alpha is nicely illustrated by the following plot of filtering speed as a function of alpha:
The relationship between filtering speed and alpha probably arises from the effect of mask shape on filtering speed. At lower alpha values, filtering masks elongate, and the increase in perimeter results in a higher number of pixels in the heap maintained by Dijkstra's algorithm. Consequently, heap operations take longer to complete and filtering speed decreases.
Conclusions
I had originally looked at the issue of outlier preservation with the intention of modifying the filter to remove outliers more effectively. On portraits, and images where texture is unwanted, outlier removal is desirable and the plane-averaging filter, for instance, produces appealing results (see http://gigl.scs.carleton.ca/node/522). However, for other images, especially images of nature, texture preservation is preferable, and outlier pixels should be relatively unaffected by the filter if they form part of a texture pattern. For texture preservation, the leaky integration filter yields good results.
Given that the cumulative range geodesic filter was originally presented under the label of a texture-preserving filter (see http://gigl.scs.carleton.ca/node/481), perhaps it is better to focus on modifying the filter to better preserve textures. The problem of removing texture has likely been studied in much greater depth and already solved using many other filters.