HALCON Reference Manual 10.0.2
Name
approx_chain_simpleT_approx_chain_simpleapprox_chain_simpleApproxChainSimpleApproxChainSimple — Approximate a contour by arcs and lines.
approx_chain_simple( : : Row, Column : ArcCenterRow, ArcCenterCol, ArcAngle, ArcBeginRow, ArcBeginCol, LineBeginRow, LineBeginCol, LineEndRow, LineEndCol, Order)
Herror T_approx_chain_simple(const Htuple Row, const Htuple Column, Htuple* ArcCenterRow, Htuple* ArcCenterCol, Htuple* ArcAngle, Htuple* ArcBeginRow, Htuple* ArcBeginCol, Htuple* LineBeginRow, Htuple* LineBeginCol, Htuple* LineEndRow, Htuple* LineEndCol, Htuple* Order)
Herror approx_chain_simple(const HTuple& Row, const HTuple& Column, HTuple* ArcCenterRow, HTuple* ArcCenterCol, HTuple* ArcAngle, HTuple* ArcBeginRow, HTuple* ArcBeginCol, HTuple* LineBeginRow, HTuple* LineBeginCol, HTuple* LineEndRow, HTuple* LineEndCol, HTuple* Order)
void HOperatorSetX.ApproxChainSimple(
[in] VARIANT Row, [in] VARIANT Column, [out] VARIANT* ArcCenterRow, [out] VARIANT* ArcCenterCol, [out] VARIANT* ArcAngle, [out] VARIANT* ArcBeginRow, [out] VARIANT* ArcBeginCol, [out] VARIANT* LineBeginRow, [out] VARIANT* LineBeginCol, [out] VARIANT* LineEndRow, [out] VARIANT* LineEndCol, [out] VARIANT* Order)
VARIANT HMiscX.ApproxChainSimple(
[in] Hlong Row, [in] Hlong Column, [out] VARIANT* ArcCenterCol, [out] VARIANT* ArcAngle, [out] VARIANT* ArcBeginRow, [out] VARIANT* ArcBeginCol, [out] VARIANT* LineBeginRow, [out] VARIANT* LineBeginCol, [out] VARIANT* LineEndRow, [out] VARIANT* LineEndCol, [out] VARIANT* Order)
static void HOperatorSet.ApproxChainSimple(HTuple row, HTuple column, out HTuple arcCenterRow, out HTuple arcCenterCol, out HTuple arcAngle, out HTuple arcBeginRow, out HTuple arcBeginCol, out HTuple lineBeginRow, out HTuple lineBeginCol, out HTuple lineEndRow, out HTuple lineEndCol, out HTuple order)
static void HMisc.ApproxChainSimple(int row, int column, out HTuple arcCenterRow, out HTuple arcCenterCol, out HTuple arcAngle, out HTuple arcBeginRow, out HTuple arcBeginCol, out HTuple lineBeginRow, out HTuple lineBeginCol, out HTuple lineEndRow, out HTuple lineEndCol, out HTuple order)
The contour of a curve is approximated by a sequence of
lines and arcs.
The result of the procedure is returned separately as arcs and
lines. If one is interested in the sequence of the segments the
individual resulting elements can be read successively from the
resulting tuples. The sequence can be taken from the return
parameter order (0: next element is next line segment, 1: next
element is next arc segment).
The operator approx_chain_simpleapprox_chain_simpleapprox_chain_simpleApproxChainSimpleApproxChainSimple behaves similarly as
approx_chainapprox_chainapprox_chainApproxChainApproxChain except that in the case of
approx_chain_simpleapprox_chain_simpleapprox_chain_simpleApproxChainSimpleApproxChainSimple the missing parameters are internally
allocated as follows: MinWidthCoord = 1.0, MaxWidthCoord = 3.0,
ThreshStart = 0.5, ThreshEnd = 0.9, ThreshStep = 0.3, MinWidthSmooth
= 1.0, MaxWidthSmooth = 3.0, MinWidthCurve = 2, MaxWidthCurve = 9,
Weight1 = 1.0, Weight2 = 1.0, Weight3 = 1.0.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
RowRowRowRowrow (input_control) point.y → HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)
Row of the contour.
Default value: 32
Column of the contour.
Default value: 32
Row of the center of an arc.
Column of the center of an arc.
Row of the starting point of an arc.
Column of the starting point of an arc.
Row of the starting point of a line segment.
Column of the starting point of a line segment.
Row of the ending point of a line segment.
Column of the ending point of a line segment.
Sequence of line (value 0) and arc segments (value 1).
/* read edge image */
read_image(&Image,"fig1_kan");
/* construct edge region */
hysteresis_threshold(Image,&RK1,64,255,40,1);
connection(RK1,&Rand);
/* fetch chain code */
T_get_region_contour(Rand,&Rows,&Columns);
firstline = get_i(Tline,0);
firstcol = get_i(Tcol,0);
/* approximation with lines and circular arcs */
T_approx_chain_simple(Rows,Columns,
&Bzl,&Bzc,&Br,&Bwl,&Bwc,&Ll0,&Lc0,&Ll1,&Lc1,&order);
nob = length_tuple(Bzl);
nol = length_tuple(Ll0);
/* draw lines and arcs */
set_i(WindowHandleTuple,WindowHandle,0) ;
set_line_width(WindowHandle,4);
if (nob>0) T_disp_arc(Bzl,Bzc,Br,Bwl,Bwc);
set_line_width(WindowHandle,1);
if (nol>0) T_disp_line(WindowHandleTuple,Ll0,Lc0,Ll1,Lc1);
The operator approx_chain_simpleapprox_chain_simpleapprox_chain_simpleApproxChainSimpleApproxChainSimple returns the value 2 (H_MSG_TRUE) if the
parameters are correct. Otherwise an exception is raised.
sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp,
edges_imageedges_imageedges_imageEdgesImageEdgesImage,
get_region_contourget_region_contourget_region_contourGetRegionContourGetRegionContour,
thresholdthresholdthresholdThresholdThreshold,
hysteresis_thresholdhysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThreshold
set_line_widthset_line_widthset_line_widthSetLineWidthSetLineWidth,
disp_arcdisp_arcdisp_arcDispArcDispArc,
disp_linedisp_linedisp_lineDispLineDispLine
get_region_polygonget_region_polygonget_region_polygonGetRegionPolygonGetRegionPolygon,
approx_chainapprox_chainapprox_chainApproxChainApproxChain
get_region_chainget_region_chainget_region_chainGetRegionChainGetRegionChain,
smallest_circlesmallest_circlesmallest_circleSmallestCircleSmallestCircle,
disp_circledisp_circledisp_circleDispCircleDispCircle,
disp_linedisp_linedisp_lineDispLineDispLine
Foundation
| HALCON Reference Manual 10.0.2 |
Copyright © 1996-2011 MVTec Software GmbH |