Herror ::remove_noise_region (
    Hobject InputRegion,
    Hobject *OutputRegion,
    const HTuple &Type
)
HRegion HRegion::RemoveNoiseRegion (
    const HTuple &Type
) const
HRegionArray HRegionArray::RemoveNoiseRegion (
    const HTuple &Type
) const

Remove noise from a region.

::remove_noise_region removes noise from a region. In mode 'n_4', a structuring element consisting of the four neighbors of a point is generated. A dilation with this structuring element is performed, and the intersection of the result and the input region is calculated. Thus all pixels having no 4-connected neighbor are removed.


Parameters

InputRegion (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions to be modified.

OutputRegion (output_object)
region(-array) -> Hobject * : HRegion(Array)
Less noisy regions.

Type (input_control)
string -> HTuple.char *
Mode of noise removal.
Default value: 'n_4'
List of values: 'n_4', 'n_8', 'n_48'


Complexity

Let F be the area of the input region. Then the runtime complexity is O(sqrt(F)*4).


Result

::remove_noise_region returns H_MSG_TRUE if all parameters are correct. The behavior in case of empty input (no regions given) can be set via ::set_system('no_object_result',<Result>). If necessary, an exception handling is raised.


Possible Predecessors

::connection, ::regiongrowing, ::pouring, ::class_ndim_norm


Possible Successors

::select_shape


See also

::dilation1, ::intersection, ::gen_region_points


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH