Skip to content

remove_noise_regionremove_noise_regionRemoveNoiseRegionRemoveNoiseRegionremove_noise_regionremove_noise_region🔗

Short description🔗

remove_noise_regionremove_noise_regionRemoveNoiseRegionRemoveNoiseRegionremove_noise_regionremove_noise_region — Remove noise from a region.

Signature🔗

remove_noise_region( region InputRegion, out region OutputRegion, string Type )remove_noise_region( InputRegion : OutputRegion : Type : )void RemoveNoiseRegion( const HObject& InputRegion, HObject* OutputRegion, const HTuple& Type )static void HOperatorSet.RemoveNoiseRegion( HObject inputRegion, out HObject outputRegion, HTuple type )def remove_noise_region( input_region: HObject, type: str ) -> HObject

Herror remove_noise_region( const Hobject InputRegion, Hobject* OutputRegion, const char* Type )

Herror T_remove_noise_region( const Hobject InputRegion, Hobject* OutputRegion, const Htuple Type )

HRegion HRegion::RemoveNoiseRegion( const HString& Type ) const

HRegion HRegion::RemoveNoiseRegion( const char* Type ) const

HRegion HRegion::RemoveNoiseRegion( const wchar_t* Type ) const (Windows only)

HRegion HRegion.RemoveNoiseRegion( string type )

Description🔗

remove_noise_regionRemoveNoiseRegion removes noise from a region. Depending on Typetypetype one of the following structuring elements will be used:

  • 'n_4'"n_4" A structuring element consisting of the four 4-neighbors of a point is being used:

                .X.
                X.X
                .X.
    
  • 'n_8'"n_8" A structuring element consisting of the four 8-neighbors of a point is being used:

                X.X
                …
                X.X
    
  • 'n_48'"n_48" 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.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

InputRegioninputRegioninput_region (input_object) region(-array) → objectobjectHObjectHRegionHObjectHobject

Regions to be modified.

OutputRegionoutputRegionoutput_region (output_object) region(-array) → objectobjectHObjectHRegionHObjectHobject *

Less noisy regions.

Typetypetype (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Mode of noise removal.

Default: 'n_4'"n_4"
List of values: 'n_4', 'n_48', 'n_8'"n_4", "n_48", "n_8"

Complexity🔗

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

Result🔗

remove_noise_regionRemoveNoiseRegion returns 2 (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 is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

connectionConnection, regiongrowingRegiongrowing, pouringPouring, class_ndim_normClassNdimNorm

Possible successors

select_shapeSelectShape

See also

dilation1Dilation1, intersectionIntersection, gen_region_pointsGenRegionPoints

Module🔗

Foundation