get_region_chainT_get_region_chainGetRegionChainGetRegionChainget_region_chain(算子)
名称
get_region_chainT_get_region_chainGetRegionChainGetRegionChainget_region_chain — 对象的轮廓作为链码。
警告
get_region_chainget_region_chainGetRegionChainGetRegionChainGetRegionChainget_region_chain 已过时,仅出于向后兼容性考虑而保留。
签名
def get_region_chain(region: HObject) -> Tuple[int, int, Sequence[int]]
描述
算子 get_region_chainget_region_chainGetRegionChainGetRegionChainGetRegionChainget_region_chain returns the contour of a region.
A contour is a series of
pixels describing the outline of the region.
The contour “lies on” the region.
It starts at the smallest line number;
in that line at the pixel with the largest column index.
The rotation occurs clockwise.
Holes of the region are ignored.
The direction code (chain code) is defined as follows:
3 2 1
4 * 0
5 6 7
The operator get_region_chainget_region_chainGetRegionChainGetRegionChainGetRegionChainget_region_chain returns the code in the form of a tuple.
In case of an empty region the parameters RowRowRowRowrowrow and
ColumnColumnColumnColumncolumncolumn are zero and ChainChainChainChainchainchain is the empty tuple.
注意
Holes of the region are ignored.
Only one region may be passed, and it must have exactly one
connection component.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RegionRegionRegionRegionregionregion (输入对象) region → objectHRegionHObjectHRegionHobject
Region to be transformed.
RowRowRowRowrowrow (输出控制) chain.begin.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Line of starting point.
ColumnColumnColumnColumncolumncolumn (输出控制) chain.begin.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Column of starting point.
ChainChainChainChainchainchain (输出控制) chain.code-array → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Direction code of the contour (from starting point).
值范围:
0
≤
Chain
Chain
Chain
Chain
chain
chain
≤
7
结果
算子 get_region_chainget_region_chainGetRegionChainGetRegionChainGetRegionChainget_region_chain normally returns the value 2 ( H_MSG_TRUE )。
If more than one connection component is passed an exception is raised.
当输入为空(无可用输入区域)时,可设置行为通过算子 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 operator 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>)。如有必要,则抛出异常。
可能的前趋
sobel_ampsobel_ampSobelAmpSobelAmpSobelAmpsobel_amp,
thresholdthresholdThresholdThresholdThresholdthreshold,
skeletonskeletonSkeletonSkeletonSkeletonskeleton,
edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image,
gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1,
gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle
可能的后继
approx_chainapprox_chainApproxChainApproxChainApproxChainapprox_chain,
approx_chain_simpleapprox_chain_simpleApproxChainSimpleApproxChainSimpleApproxChainSimpleapprox_chain_simple
另见
copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj,
get_region_contourget_region_contourGetRegionContourGetRegionContourGetRegionContourget_region_contour,
get_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygonGetRegionPolygonget_region_polygon
模块
基础