HALCON Reference Manual 10.0.2
Table of Contents / Regions / Access ClassesClassesClasses | | | Operators

get_region_chainT_get_region_chainget_region_chainGetRegionChainGetRegionChain (Operator)

Name

get_region_chainT_get_region_chainget_region_chainGetRegionChainGetRegionChain — Contour of an object as chain code.

Signature

get_region_chain(Region : : : Row, Column, Chain)

Herror T_get_region_chain(const Hobject Region, Htuple* Row, Htuple* Column, Htuple* Chain)

Herror get_region_chain(Hobject Region, HTuple* Row, HTuple* Column, HTuple* Chain)

Hlong HRegion::GetRegionChain(HTuple* Column, HTuple* Chain) const

void HOperatorSetX.GetRegionChain(
[in] IHUntypedObjectX* Region, [out] VARIANT* Row, [out] VARIANT* Column, [out] VARIANT* Chain)

Hlong HRegionX.GetRegionChain(
[out] Hlong* Column, [out] VARIANT* Chain)

static void HOperatorSet.GetRegionChain(HObject region, out HTuple row, out HTuple column, out HTuple chain)

void HRegion.GetRegionChain(out int row, out int column, out HTuple chain)

Description

The operator get_region_chainget_region_chainget_region_chainGetRegionChainGetRegionChain 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_chainget_region_chainGetRegionChainGetRegionChain returns the code in the form of a tuple. In case of an empty region the parameters RowRowRowRowrow and ColumnColumnColumnColumncolumn are zero and ChainChainChainChainchain is the empty tuple.

Attention

Holes of the region are ignored. Only one region may be passed, and it must have exactly one connection component.

Parallelization

Parameters

RegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHRegionXHobject

Region to be transformed.

RowRowRowRowrow (output_control)  chain.begin.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Line of starting point.

ColumnColumnColumnColumncolumn (output_control)  chain.begin.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Column of starting point.

ChainChainChainChainchain (output_control)  chain.code-array HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Direction code of the contour (from starting point).

Typical range of values: 0 ≤ Chain Chain Chain Chain chain ≤ 7

Result

The operator get_region_chainget_region_chainget_region_chainGetRegionChainGetRegionChain normally returns the value 2 (H_MSG_TRUE). If more than one connection component is passed an exception is raised. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). The behavior in case of empty region (the region is the empty set) is set via the operator set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp, thresholdthresholdthresholdThresholdThreshold, skeletonskeletonskeletonSkeletonSkeleton, edges_imageedges_imageedges_imageEdgesImageEdgesImage, gen_rectangle1gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1, gen_circlegen_circlegen_circleGenCircleGenCircle

Possible Successors

approx_chainapprox_chainapprox_chainApproxChainApproxChain, approx_chain_simpleapprox_chain_simpleapprox_chain_simpleApproxChainSimpleApproxChainSimple

See also

copy_objcopy_objcopy_objCopyObjCopyObj, get_region_contourget_region_contourget_region_contourGetRegionContourGetRegionContour, get_region_polygonget_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygon

Module

Foundation


Table of Contents / Regions / Access ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH