Skip to content

shape_transShapeTransShapeTransshape_transshape_trans🔗

説明🔗

shape_transShapeTransShapeTransshape_transshape_trans — 領域の形状変換をする。

書式🔗

shape_trans( region Region, out region RegionTrans, string Type )void ShapeTrans( const HObject& Region, HObject* RegionTrans, const HTuple& Type )static void HOperatorSet.ShapeTrans( HObject region, out HObject regionTrans, HTuple type )def shape_trans( region: HObject, type: str ) -> HObject

Herror shape_trans( const Hobject Region, Hobject* RegionTrans, const char* Type )

Herror T_shape_trans( const Hobject Region, Hobject* RegionTrans, const Htuple Type )

HRegion HRegion::ShapeTrans( const HString& Type ) const

HRegion HRegion::ShapeTrans( const char* Type ) const

HRegion HRegion::ShapeTrans( const wchar_t* Type ) const (Windows only)

HRegion HRegion.ShapeTrans( string type )

説明🔗

shape_transShapeTrans はパラメーター Typetypetype に従って入力領域 の形状を変換します。

  • 'convex'"convex" 凸包。

  • 'ellipse'"ellipse" 入力領域と同じモーメントと領域を持つ楕円。

  • 'outer_circle'"outer_circle" 最小外接円。

  • 'inner_circle'"inner_circle" 領域に適合する最大内接円。

  • 'rectangle1'"rectangle1" 座標軸に平行な最小外接矩形。

  • 'rectangle2'"rectangle2" 最小外接矩形(傾きあり)。

  • 'inner_rectangle1'"inner_rectangle1" 領域に適合する xy 軸に平行な最大内接矩形。

  • 'inner_center'"inner_center" 入力領域の重心に最も近い入力領域のスケルトン上の点。

注意🔗

Typetypetype = 'outer_circle'"outer_circle" を選択した場合、結果の円領 域は入力領域を完全に覆わないこともあります。これは、オペレーター smallest_circleSmallestCircle および gen_circleGenCircle が外円を 計算するために内部的に使用されるためです。smallest_circleSmallestCircle に詳細を 記述しているように、計算された半径は最大 \(1/\sqrt{2}-0.5\) ピクセルまで小さくすることもできます。さらに、 gen_circleGenCircle によって生成された円は両方向で 0.5 ピクセル、す なわち最大 \(1/\sqrt{2}\) まで変形されます。この結 果、上記 2 つの処理を行った場合、オリジナルの領域が最大 1 ピクセル で返された円領域からはみ出すことがあります。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • tupleレベルで自動的に並列演算処理を実施

パラメーター🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

変換される入力領域

RegionTransregionTransregion_trans (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

変換された結果の領域

Typetypetype (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

変換の型

初期値: 'convex'"convex"
値のリスト: 'convex', 'ellipse', 'inner_center', 'inner_circle', 'inner_rectangle1', 'outer_circle', 'rectangle1', 'rectangle2'"convex", "ellipse", "inner_center", "inner_circle", "inner_rectangle1", "outer_circle", "rectangle1", "rectangle2"

複雑性🔗

入力領域の面積を \(F\) とします。その場合、実行時間は \(O(F)\) です。

結果🔗

shape_transShapeTrans は、すべてのパラメーターが正しい場合に 2 (H_MSG_TRUE) を 返します。 空の入力(与えられた領域がない)の場合は、 set_system('no_object_result',<Result>) を通して動作を設定 できます。 必要に応じて、例外が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

connectionConnection, regiongrowingRegiongrowing

後処理の候補

disp_regionDispRegion, regiongrowing_meanRegiongrowingMean, area_centerAreaCenter

関連項目

convexityConvexity, elliptic_axisEllipticAxis, area_centerAreaCenter, smallest_rectangle1SmallestRectangle1, smallest_rectangle2SmallestRectangle2, inner_rectangle1InnerRectangle1, set_shapeSetShape, select_shapeSelectShape, inner_circleInnerCircle

モジュール🔗

Foundation