Skip to content

rectangularity_xldRectangularityXldRectangularityXldrectangularity_xldrectangularity_xld🔗

説明🔗

rectangularity_xldRectangularityXldRectangularityXldrectangularity_xldrectangularity_xld — XLD オブジェクトまたはポリゴンの長方形度合いに対する形状係数を計算 する。

書式🔗

rectangularity_xld( xld XLD, out real Rectangularity )void RectangularityXld( const HObject& XLD, HTuple* Rectangularity )static void HOperatorSet.RectangularityXld( HObject XLD, out HTuple rectangularity )def rectangularity_xld( xld: HObject ) -> Sequence[float]

def rectangularity_xld_s( xld: HObject ) -> floatHerror rectangularity_xld( const Hobject XLD, double* Rectangularity )

Herror T_rectangularity_xld( const Hobject XLD, Htuple* Rectangularity )

HTuple HXLD::RectangularityXld( ) const

HTuple HXLD.RectangularityXld( )

説明🔗

オペレータrectangularity_xldRectangularityXldはそれぞれ入力されたXLDXLDxldのオブジェクト、 またはポリゴンの長方形度合いを計算します。 入力 XLD オブジェクトまたはポリゴンはそれ自身と交わってはいけません。 そうでなければ、結果のパラメーターは意味がなくなります(入力 XLD オブジェクト またはポリゴンがそれ自身と交わっているかどうかは、test_self_intersection_xldTestSelfIntersectionXld で判定することができます)。入力 XLD オブジェクトまたはポリゴンが閉じていなけ れば、自動的に閉じられます。

長方形度合いを決定するため、はじめに、入力 XLD オブジェクトまたはポリゴンと同じ 1次モーメントおよび2次モーメントを有する矩形が計算されます。 長方形度合いの計算は最終的に計算された矩形と、矩形の面積について正規化された 入力 XLD オブジェクトまたはポリゴンとの間の差の面積に基づいて行われます。

長方形の場合rectangularity_xldRectangularityXldは1を返します。 入力 XLD オブジェクトまたはポリゴンが完全な長方形から離れるほど Rectangularityrectangularityrectangularityの戻り値は低い値になります。 複数のXLD オブジェクトまたはポリゴンが渡された場合には、 結果はXLDXLDxldと同じ順序でtupleに格納されます。

注意🔗

二次モーメントを使用して方向を計算できない入力XLD オブジェクトまたはポリゴン (例えば正方形の場合)では、入力XLD オブジェクトまたはポリゴンの方向に応じて、 返されたRectangularityrectangularityrectangularityが最大10%過小評価されます。

実行情報🔗

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

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

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

パラメーター🔗

XLDXLDxld (input_object) xld(-array) → objectHObjectHXLDHObjectHobject

調査されるXLD オブジェクトまたはポリゴン

Rectangularityrectangularityrectangularity (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

入力XLD オブジェクトまたはポリゴンの長方形度合い

制限: 0 <= Rectangularity && Rectangularity <= 1.0

結果🔗

入力が空でない場合、オペレーター rectangularity_xldRectangularityXld は、値 2 (H_MSG_TRUE) を返します。入力が空の場合(入力XLD オブジェクトまたはポリゴンがない場合) の動作は、オペレーター set_system('no_object_result',<Result>) で設定されます。必要に応じて、例外が発生します。

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

組み合わせ

前処理の候補

gen_contours_skeleton_xldGenContoursSkeletonXld, edges_sub_pixEdgesSubPix, threshold_sub_pixThresholdSubPix, gen_contour_polygon_xldGenContourPolygonXld, test_self_intersection_xldTestSelfIntersectionXld

他の選択候補

circularity_xldCircularityXld, convexity_xldConvexityXld, compactness_xldCompactnessXld, eccentricity_xldEccentricityXld

関連項目

area_center_xldAreaCenterXld, select_shape_xldSelectShapeXld

参考文献🔗

P. L. Rosin: “Measuring rectangularity”; Machine Vision and Applications; vol. 11; pp. 191-196; Springer-Verlag, 1999.

モジュール🔗

Foundation