convexityconvexityConvexityConvexityconvexity (算子名称)

名称

convexityconvexityConvexityConvexityconvexity — Shape factor for the convexity of a region.

参数签名

convexity(区域 : : : Convexity)

Herror convexity(const Hobject 区域, double* Convexity)

Herror T_convexity(const Hobject 区域, Htuple* Convexity)

void Convexity(const HObject& 区域, HTuple* Convexity)

HTuple HRegion::Convexity() const

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

HTuple HRegion.Convexity()

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

def convexity_s(区域: HObject) -> float

描述

该算子 convexityconvexityConvexityConvexityConvexityconvexity calculates the convexity of each input region of 区域区域区域区域区域区域.

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 该算子 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.

运行信息

参数表

区域区域区域区域区域区域 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Region(s) to be examined.

ConvexityConvexityConvexityConvexityconvexityconvexity (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Convexity of the input region(s).

Assertion: Convexity <= 1

结果

该算子 convexityconvexityConvexityConvexityConvexityconvexity 返回值 2 ( H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input regions available) is set via 该算子 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>). The behavior in case of empty region (the region is the empty set) is set via 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>). If necessary an exception is raised.

可能的前置算子

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

参考其它

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, shape_transshape_transShapeTransShapeTransShapeTransshape_trans

模块

Foundation