HALCON Reference Manual 10.0.2
Table of Contents / Legacy / Filters ClassesClassesClasses | | | Operators

anisotrope_diffanisotrope_diffanisotrope_diffAnisotropeDiffAnisotropeDiff (Operator)

Name

anisotrope_diffanisotrope_diffanisotrope_diffAnisotropeDiffAnisotropeDiff — Smooth an image by edge-preserving anisotropic diffusion.

Warning

anisotrope_diffanisotrope_diffanisotrope_diffAnisotropeDiffAnisotropeDiff is obsolete and is only provided for reasons of backward compatibility. New applications should use anisotropic_diffusionanisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusion instead.

Signature

anisotrope_diff(Image : ImageAniso : Percent, Mode, Iteration, NeighborhoodType : )

Herror anisotrope_diff(const Hobject Image, Hobject* ImageAniso, const Hlong Percent, const Hlong Mode, const Hlong Iteration, const Hlong NeighborhoodType)

Herror T_anisotrope_diff(const Hobject Image, Hobject* ImageAniso, const Htuple Percent, const Htuple Mode, const Htuple Iteration, const Htuple NeighborhoodType)

Herror anisotrope_diff(Hobject Image, Hobject* ImageAniso, const HTuple& Percent, const HTuple& Mode, const HTuple& Iteration, const HTuple& NeighborhoodType)

HImage HImage::AnisotropeDiff(const HTuple& Percent, const HTuple& Mode, const HTuple& Iteration, const HTuple& NeighborhoodType) const

HImageArray HImageArray::AnisotropeDiff(const HTuple& Percent, const HTuple& Mode, const HTuple& Iteration, const HTuple& NeighborhoodType) const

void HOperatorSetX.AnisotropeDiff(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageAniso, [in] VARIANT Percent, [in] VARIANT Mode, [in] VARIANT Iteration, [in] VARIANT NeighborhoodType)

IHImageX* HImageX.AnisotropeDiff(
[in] Hlong Percent, [in] Hlong Mode, [in] Hlong Iteration, [in] Hlong NeighborhoodType)

static void HOperatorSet.AnisotropeDiff(HObject image, out HObject imageAniso, HTuple percent, HTuple mode, HTuple iteration, HTuple neighborhoodType)

HImage HImage.AnisotropeDiff(int percent, int mode, int iteration, int neighborhoodType)

Description

The operator anisotrope_diffanisotrope_diffanisotrope_diffAnisotropeDiffAnisotropeDiff 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 ModeModeModeModemode = 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 PercentPercentPercentPercentpercent increases the smoothing effect but blurs the edges a little more (values from 80 - 90 percent are typical).

The parameter IterationIterationIterationIterationiteration determines the number of iterations (typically 3--7).

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte)

Image to be smoothed.

ImageAnisoImageAnisoImageAnisoImageAnisoimageAniso (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte)

Smoothed image.

PercentPercentPercentPercentpercent (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

For histogram analysis; higher values increase the smoothing effect, typically: 80-90.

Default value: 80

Suggested values: 65, 70, 75, 80, 85, 90

Typical range of values: 50 ≤ Percent Percent Percent Percent percent ≤ 100

Minimum increment: 1

Recommended increment: 5

ModeModeModeModemode (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Selection of diffusion function.

Default value: 1

List of values: 1, 2

IterationIterationIterationIterationiteration (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of iterations, typical values: 3-7.

Default value: 5

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Typical range of values: 1 ≤ Iteration Iteration Iteration Iteration iteration ≤ 30

Minimum increment: 1

Recommended increment: 1

NeighborhoodTypeNeighborhoodTypeNeighborhoodTypeNeighborhoodTypeneighborhoodType (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Required neighborhood type.

Default value: 8

List of values: 4, 8

Example (HDevelop)

read_image(Image,'fabrik')
anisotrope_diff(Image,Aniso,80,1,5,8)
sub_image(Image,Aniso,Sub,2.0,127)
disp_image(Sub,WindowHandle)

Example (C)

read_image(&Image,"fabrik");
anisotrope_diff(Image,&Aniso,80,1,5,8);
sub_image(Image,Aniso,&Sub,2.0,127.0);
disp_image(Sub,WindowHandle);

Example (HDevelop)

read_image(Image,'fabrik')
anisotrope_diff(Image,Aniso,80,1,5,8)
sub_image(Image,Aniso,Sub,2.0,127)
disp_image(Sub,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
anisotrope_diff(Image,Aniso,80,1,5,8)
sub_image(Image,Aniso,Sub,2.0,127)
disp_image(Sub,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
anisotrope_diff(Image,Aniso,80,1,5,8)
sub_image(Image,Aniso,Sub,2.0,127)
disp_image(Sub,WindowHandle)

Complexity

For each pixel: O(Iterations * 18).

Result

If the parameter values are correct the operator anisotrope_diffanisotrope_diffanisotrope_diffAnisotropeDiffAnisotropeDiff returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no input images available) is set via the operator set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary an exception is raised.

Possible Predecessors

read_imageread_imageread_imageReadImageReadImage, grab_imagegrab_imagegrab_imageGrabImageGrabImage

Possible Successors

regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing, thresholdthresholdthresholdThresholdThreshold, sub_imagesub_imagesub_imageSubImageSubImage, dyn_thresholddyn_thresholddyn_thresholdDynThresholdDynThreshold, auto_thresholdauto_thresholdauto_thresholdAutoThresholdAutoThreshold

Alternatives

sigma_imagesigma_imagesigma_imageSigmaImageSigmaImage, rank_imagerank_imagerank_imageRankImageRankImage

See also

smooth_imagesmooth_imagesmooth_imageSmoothImageSmoothImage, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, sigma_imagesigma_imagesigma_imageSigmaImageSigmaImage, rank_imagerank_imagerank_imageRankImageRankImage, eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax

References

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.

Module

Foundation


Table of Contents / Legacy / Filters ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH