Smooth an image by edge-preserving anisotropic diffusion.
The operator anisotrope_diff__ carries out an iterative, anisotropic smoothing process on the mathematical basis of physical diffusion. In analogy to the physical diffusion process describing the concentration balance between molecules dependent on the density gradient, the diffusion filter carries out a smoothing of the gray values dependent on the local gray value gradients.
For iterative calculation of the gray value of a pixel the gray value differences in relation to the four or eight neighbors, respectively, are used. These gray value differences, however, are evaluated differently, i.e., a non-linear diffusion process is carried out.
The evaluation is carried out by using a diffusion function (two different functions were implemented, namely Mode = 1 and/or 2), which --- depending on the gradient --- ensures that within homogenous regions the smoothing is stronger than over the margins of regions so that the edges remain sharp. The diffusion function is adjusted to the noise ratio of the image by a histogram analysis in the gradient image (according to Canny). A high value for Percent increases the smoothing effect but blurs the edges a little more (values from 80 - 90 percent are typical).
The parameter Iteration determines the number of iterations (typically 3--7).
Image (input_object) |
image(-array) -> object : byte |
Image to be smoothed. |
ImageAniso (output_object) |
image(-array) -> object : byte |
Smoothed image. |
Percent (input_control) |
integer -> integer |
For histogram analysis; higher values increase the smoothing effect, typically: 80-90. | |
Default value: 80 | |
Suggested values: 65, 70, 75, 80, 85, 90 | |
Range of values: 50 <= Percent <= 100 | |
Minimum increment: 1 | |
Recommended increment: 5 |
Mode (input_control) |
integer -> integer |
Auswahl der Diffusionsfunktion. | |
Default value: 1 | |
List of values: 1, 2 |
Iteration (input_control) |
integer -> integer |
Number of iterations, typical values: 3-7. | |
Default value: 5 | |
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 | |
Range of values: 1 <= Iteration <= 30 | |
Minimum increment: 1 | |
Recommended increment: 1 |
NeighbourhoodType (input_control) |
integer -> integer |
Reqired neighborhood type. | |
Default value: 8 | |
List of values: 4, 8 |
read_image(:Image:'fabrik':) > anisotrope_diff__(Image:Aniso:80,1,5,8:) > sub__(Image,Aniso:Sub:2.0,127:) > disp_image(Sub:::).
For each pixel: O(Iterations * 18).
If the parameter values are correct the operator anisotrope_diff__ returns the value TRUE. The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Resultat>:). If necessary an exception is raised.
regiongrowing__, threshold__, sub__, dyn_threshold__, auto_threshold2
smooth__, gauss__, sigma__, rank__
P. Perona, J. Malik: Scale-space and edge detection using anisotropic diffusion, IEEE transaction on pattern analysis and machine intelligence, Vol. 12, No. 7, July 1990.