remove_noise_region — Remove noise from a region.
remove_noise_region removes noise from a region.
Type one of the following structuring elements
will be used:
A structuring element consisting of the four 4-neighbors of a point is being used: .X. X.X .X.
A structuring element consisting of the four 8-neighbors of a point is being used: X.X ... X.X
A structuring element consisting of the four 4-neighbors and the four 8-neighbors of a point is being used: XXX X.X XXX
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 according neighbors are removed.
Regions to be modified.
Less noisy regions.
Mode of noise removal.
Default value: 'n_4'
List of values: 'n_4', 'n_48', 'n_8'
Let F be the area of the input region. Then the runtime complexity is
remove_noise_region returns 2 (H_MSG_TRUE) if all parameters are
correct. The behavior in case of empty input (no regions given) can
be set via
If necessary, an exception is raised.