convexityconvexityConvexityConvexityconvexity(算子)

名称

convexityconvexityConvexityConvexityconvexity — 区域凸度的形状系数。

签名

convexity(Regions : : : Convexity)

Herror convexity(const Hobject Regions, double* Convexity)

Herror T_convexity(const Hobject Regions, Htuple* Convexity)

void Convexity(const HObject& Regions, HTuple* Convexity)

HTuple HRegion::Convexity() const

static void HOperatorSet.Convexity(HObject regions, out HTuple convexity)

HTuple HRegion.Convexity()

def convexity(regions: HObject) -> Sequence[float]

def convexity_s(regions: HObject) -> float

描述

算子 convexityconvexityConvexityConvexityConvexityconvexity calculates the convexity of each input region of RegionsRegionsRegionsRegionsregionsregions

Calculation:

If is the area of the convex hull and the original area of the region the shape factor C is defined as:

The shape factor C is 1 if the region is convex (e.g., rectangle, circle etc.). If there are indentations or holes C is smaller than 1.

In the documentation of this chapter (Regions / Features), you can find an image illustrating regions which vary in their convexity.

In case of an empty region the operator convexityconvexityConvexityConvexityConvexityconvexity returns the value 0 (if no other behavior was set (see set_systemset_systemSetSystemSetSystemSetSystemset_system)). If more than one region is passed the numerical values of the contour length are stored in a tuple, the position of a value in the tuple corresponding to the position of the region in the input tuple.

执行信息

参数

RegionsRegionsRegionsRegionsregionsregions (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

待检查的区域。

ConvexityConvexityConvexityConvexityconvexityconvexity (输出控制)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Convexity of the input region(s).

Assertion: Convexity <= 1

结果

算子 convexityconvexityConvexityConvexityConvexityconvexity 在输入不为空时返回值 2 ( H_MSG_TRUE )。当输入为空(无可用输入区域)时,可设置行为通过算子 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。空区域(区域是空集)的情况下的可设置行为通过 set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

另见

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, shape_transshape_transShapeTransShapeTransShapeTransshape_trans

模块

基础