Skip to content

fittingFittingFittingfittingfitting🔗

Short description🔗

fittingFittingFittingfittingfitting — Perform a closing after an opening with multiple structuring elements.

Warning🔗

fittingFitting is obsolete and is only provided for reasons of backward compatibility.

Signature🔗

fitting( region Region, region StructElements, out region RegionFitted )void Fitting( const HObject& Region, const HObject& StructElements, HObject* RegionFitted )static void HOperatorSet.Fitting( HObject region, HObject structElements, out HObject regionFitted )def fitting( region: HObject, struct_elements: HObject ) -> HObject

Herror fitting( const Hobject Region, const Hobject StructElements, Hobject* RegionFitted )

Herror T_fitting( const Hobject Region, const Hobject StructElements, Hobject* RegionFitted )

HRegion HRegion::Fitting( const HRegion& StructElements ) const

HRegion HRegion.Fitting( HRegion structElements )

Description🔗

fittingFitting performs an openingOpening and a closingClosing successively on the input regions. The eight structuring elements normally used for this operation can be generated with the operator gen_struct_elementsGenStructElements. However, other user-defined structuring elements can also be used. Let \(R\) be the input region(s) and let \(M_{i}\) denote the structuring elements. Furthermore, let \(P\) be the result of the opening and \(Q\) be the final result. Then the operator can be formalized as follows:

\[\begin{eqnarray*} P & = & \bigcup_{i=1}^{n} (R \circ M_{i}) \\ Q & = & \bigcap_{i=1}^{n} (P \bullet M_{i}) \end{eqnarray*}\]

Regions larger than the structuring elements are preserved, while small gaps are closed.

Execution information🔗

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

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

  • Processed without parallelization.

Parameters🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regions to be processed.

StructElementsstructElementsstruct_elements (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Structuring elements.

RegionFittedregionFittedregion_fitted (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Fitted regions.

Result🔗

fittingFitting returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:

  • no region: set_system('no_object_result',<RegionResult>)

  • empty region: set_system('empty_region_result',<RegionResult>)

Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

gen_struct_elementsGenStructElements, gen_region_pointsGenRegionPoints

Possible successors

reduce_domainReduceDomain, select_shapeSelectShape, area_centerAreaCenter, connectionConnection

Alternatives

openingOpening, closingClosing, connectionConnection, select_shapeSelectShape

Module🔗

Foundation