Anisotropic Smoothing Filter. More...
Functions | |
AFAPI array | anisotropicDiffusion (const af::array &in, const float timestep, const float conductance, const unsigned iterations, const fluxFunction fftype=AF_FLUX_EXPONENTIAL, const diffusionEq diffusionKind=AF_DIFFUSION_GRAD) |
C++ Interface for gradient anisotropic(non-linear diffusion) smoothing. More... | |
AFAPI af_err | af_anisotropic_diffusion (af_array *out, const af_array in, const float timestep, const float conductance, const unsigned iterations, const af_flux_function fftype, const af_diffusion_eq diffusion_kind) |
C Interface for anisotropic diffusion. More... | |
Anisotropic Smoothing Filter.
Anisotropic diffusion algorithm aims at removing noise in the images while preserving important features such as edges. The algorithm essentially creates a scale space representation of the original image, where image from previous step is used to create a new version of blurred image using the diffusion process. Standard isotropic diffusion methods such as gaussian blur, doesn't take into account the local content(smaller neighborhood of current processing pixel) while removing noise. Anisotropic diffusion uses the flux equations given below to achieve that. Flux equation is the formula used by the diffusion process to determine how much a pixel in neighborhood should contribute to the blurring operation being done at the current pixel at a given iteration.
The flux function can be either exponential or quadratic.
AF_FLUX_QUADRATIC | \( \frac{1}{1 + (\frac{\| \nabla I\|}{K})^2} \) |
AF_FLUX_EXPONENTIAL | \( \exp{-(\frac{\| \nabla I\|}{K})^2} \) |
Please be cautious using the time step parameter to the function. Appropriate time steps for solving this type of p.d.e. depend on the dimensionality of the image and the order of the equation. Stable values for most 2D and 3D functions are 0.125 and 0.0625, respectively. The time step values are automatically constrained to the stable value.
Another input parameter to be cautious about is the conductance parameter, lower values strongly preserve image features and vice-versa. For human vision, this value ranges from 0.5 to 2.0.
Pietro Perona and Jitendra Malik, Scale-space and edge detection using anisotropic diffusion,
IEEE Transactions on Pattern Analysis Machine Intelligence, vol. 12, pp. 629-639, 1990.
R. Whitaker and X. Xue. Variable-Conductance, Level-Set Curvature for Image Denoising
, International Conference on Image Processing, 2001 pp. 142-145, Vol.3.
AFAPI af_err af_anisotropic_diffusion | ( | af_array * | out, |
const af_array | in, | ||
const float | timestep, | ||
const float | conductance, | ||
const unsigned | iterations, | ||
const af_flux_function | fftype, | ||
const af_diffusion_eq | diffusion_kind | ||
) |
C Interface for anisotropic diffusion.
It can do both gradient and curvature based anisotropic smoothing.
[out] | out | is an af_array containing anisotropically smoothed image pixel values |
[in] | in | is the input image, expects non-integral (float/double) typed af_array |
[in] | timestep | is the time step used in solving the diffusion equation. |
[in] | conductance | parameter controls the sensitivity of conductance in diffusion equation. |
[in] | iterations | is the number of times the diffusion step is performed. |
[in] | fftype | indicates whether quadratic or exponential flux function is used by algorithm. |
[in] | diffusion_kind | will let the user choose what kind of diffusion method to perform. It will take any value of enum af_diffusion_eq |
AFAPI array anisotropicDiffusion | ( | const af::array & | in, |
const float | timestep, | ||
const float | conductance, | ||
const unsigned | iterations, | ||
const fluxFunction | fftype = AF_FLUX_EXPONENTIAL , |
||
const diffusionEq | diffusionKind = AF_DIFFUSION_GRAD |
||
) |
C++ Interface for gradient anisotropic(non-linear diffusion) smoothing.
[in] | in | is the input image, expects non-integral (float/double) typed af::array |
[in] | timestep | is the time step used in solving the diffusion equation. |
[in] | conductance | parameter controls the sensitivity of conductance in diffusion equation. |
[in] | iterations | is the number of times the diffusion step is performed. |
[in] | fftype | indicates whether quadratic or exponential flux function is used by algorithm. |
[in] | diffusionKind | will let the user choose what kind of diffusion method to perform. It will take any value of enum diffusionEq |