approx_chain_simple🔗
説明🔗
approx_chain_simple — 円弧および直線で閉じたチェインコードを近似する。
警告🔗
approx_chain_simple は現在では使用されず、下位互換性のためだけに提供
されます。
書式🔗
approx_chain_simple( point.y Row, point.x Column, out arc.center.y ArcCenterRow, out arc.center.x ArcCenterCol, out arc.angle.rad ArcAngle, out arc.begin.y ArcBeginRow, out arc.begin.x ArcBeginCol, out line.begin.y LineBeginRow, out line.begin.x LineBeginCol, out line.end.y LineEndRow, out line.end.x LineEndCol, out integer Order )
説明🔗
閉じた曲線のチェインコードを直線と円弧の組み合わせによって近似します。
このオペレーターの結果は、円弧と直線に分離して返されます。もしセグメントの 列を得る必要があれば、個々の結果として選られる要素を結果の Tuple から順に 読み出すことができます。この列は返すパラメーター順序(0: 次の要素が次の 直線セグメント、1: 次の要素が次の円弧セグメント)で取り出すことができます。
オペレーター approx_chain_simple は approx_chain と同様の
動作をします。ただし、approx_chain_simple では指定されない
パラメーターは以下のように内部的に割り当てられます。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。
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
-
並列演算処理には未対応
パラメーター🔗
Row (input_control) point.y-array → (integer)
輪郭の行座要
初期値: 32
Column (input_control) point.x-array → (integer)
輪郭の列座標
初期値: 32
ArcCenterRow (output_control) arc.center.y-array → (integer)
円弧の中心の行座標
ArcCenterCol (output_control) arc.center.x-array → (integer)
円弧の中心の列座標
ArcAngle (output_control) arc.angle.rad-array → (real)
円弧の角度
ArcBeginRow (output_control) arc.begin.y-array → (integer)
円弧の開始点の行座標
ArcBeginCol (output_control) arc.begin.x-array → (integer)
円弧の開始点の列座標
LineBeginRow (output_control) line.begin.y-array → (integer)
直線の開始点の行座標
LineBeginCol (output_control) line.begin.x-array → (integer)
直線の開始点の列座標
LineEndRow (output_control) line.end.y-array → (integer)
直線の終了点の行座標
LineEndCol (output_control) line.end.x-array → (integer)
直線の終了点の列座標
Order (output_control) integer-array → (integer)
直線(値 0)と円弧(値 1)の配列順
例🔗
(C)
/* 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)\;
結果🔗
パラメーターが正しいならば、オペレーター approx_chain_simple は
値 2 (H_MSG_TRUE) を返します。そうでなければ、例外処理が発生します。
他のオペレーターとの組み合わせ🔗
組み合わせ
前処理の候補
sobel_amp, edges_image, get_region_contour, threshold, hysteresis_threshold
後処理の候補
set_line_width, disp_arc, disp_line
他の選択候補
get_region_polygon, approx_chain
関連項目
モジュール🔗
Foundation