Skip to content

select_shape_stdSelectShapeStdSelectShapeStdselect_shape_stdselect_shape_std🔗

Short description🔗

select_shape_stdSelectShapeStdSelectShapeStdselect_shape_stdselect_shape_std — Select regions of a given shape.

Signature🔗

select_shape_std( region Regions, out region SelectedRegions, string Shape, real Percent )void SelectShapeStd( const HObject& Regions, HObject* SelectedRegions, const HTuple& Shape, const HTuple& Percent )static void HOperatorSet.SelectShapeStd( HObject regions, out HObject selectedRegions, HTuple shape, HTuple percent )def select_shape_std( regions: HObject, shape: str, percent: float ) -> HObject

Herror select_shape_std( const Hobject Regions, Hobject* SelectedRegions, const char* Shape, double Percent )

Herror T_select_shape_std( const Hobject Regions, Hobject* SelectedRegions, const Htuple Shape, const Htuple Percent )

HRegion HRegion::SelectShapeStd( const HString& Shape, double Percent ) const

HRegion HRegion::SelectShapeStd( const char* Shape, double Percent ) const

HRegion HRegion::SelectShapeStd( const wchar_t* Shape, double Percent ) const (Windows only)

HRegion HRegion.SelectShapeStd( string shape, double percent )

Description🔗

The operator select_shape_stdSelectShapeStd compares the shape of the given regions with default shapes. If the region has a similar shape it is adopted into the output. Possible values for Shapeshapeshape are:

  • 'max_area'"max_area" The largest region is selected.

  • 'rectangle1'"rectangle1" The surrounding rectangle parallel to the coordinate axes is determined via the operator smallest_rectangle1SmallestRectangle1. If the area difference in percent is larger than Percentpercentpercent the region is adopted.

  • 'rectangle2'"rectangle2" The smallest surrounding rectangle with any orientation is determined via the operator smallest_rectangle2SmallestRectangle2. If the area difference in percent is larger than Percentpercentpercent the region is adopted. Note that as a more robust alternative the operator select_shapeSelectShape with Featurefeaturefeature set to 'rectangularity'"rectangularity" can be used instead.

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🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Input regions to be selected.

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

Regions with desired shape.

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

Shape features to be checked.

Default: 'max_area'"max_area"
List of values: 'max_area', 'rectangle1', 'rectangle2'"max_area", "rectangle1", "rectangle2"

Percentpercentpercent (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Similarity measure.

Default: 70.070.0
Suggested values: 10.0, 30.0, 50.0, 60.0, 70.0, 80.0, 90.0, 95.0, 100.010.0, 30.0, 50.0, 60.0, 70.0, 80.0, 90.0, 95.0, 100.0
Value range: 0.0 ≤ Percent ≤ 100.0 (lin)
Minimum increment: 0.1
Recommended increment: 10.0

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection, smallest_rectangle1SmallestRectangle1, smallest_rectangle2SmallestRectangle2

Alternatives

intersectionIntersection, complementComplement, area_centerAreaCenter, select_shapeSelectShape

See also

smallest_rectangle1SmallestRectangle1, smallest_rectangle2SmallestRectangle2, rectangularityRectangularity

Module🔗

Foundation