Skip to content

height_width_ratioHeightWidthRatioHeightWidthRatioheight_width_ratioheight_width_ratio🔗

説明🔗

height_width_ratioHeightWidthRatioHeightWidthRatioheight_width_ratioheight_width_ratio — 領域を囲む座標軸に平行な矩形の幅、高さ、アスペクト比を計算します。

書式🔗

height_width_ratio( region Regions, out extent.y Height, out extent.x Width, out real Ratio )void HeightWidthRatio( const HObject& Regions, HTuple* Height, HTuple* Width, HTuple* Ratio )static void HOperatorSet.HeightWidthRatio( HObject regions, out HTuple height, out HTuple width, out HTuple ratio )def height_width_ratio( regions: HObject ) -> Tuple[Sequence[int], Sequence[int], Sequence[float]]

def height_width_ratio_s( regions: HObject ) -> Tuple[int, int, float]Herror height_width_ratio( const Hobject Regions, Hlong* Height, Hlong* Width, double* Ratio )

Herror T_height_width_ratio( const Hobject Regions, Htuple* Height, Htuple* Width, Htuple* Ratio )

HTuple HRegion::HeightWidthRatio( HTuple* Width, HTuple* Ratio ) const

Hlong HRegion::HeightWidthRatio( Hlong* Width, double* Ratio ) const

HTuple HRegion.HeightWidthRatio( out HTuple width, out HTuple ratio )

int HRegion.HeightWidthRatio( out int width, out double ratio )

説明🔗

オペレーター height_width_ratioHeightWidthRatio は、全ての入力領域を囲む座標軸に平行な 矩形を計算します。囲んでいる矩形は角ピクセル (Row1row1row_1,Column1column1column_1,Row2row2row_2,Column2column2column_2)によって 記述されます。(オペレーター smallest_rectangle1SmallestRectangle1 を参照してください)。 これらの値に基づいて、 height_width_ratioHeightWidthRatio は次のように 領域を囲む矩形の最小の幅、高さ、および縦横比を計算します:

\[\begin{eqnarray*} \textrm{Width} & = & \textrm{Column2} - \textrm{Column1} + 1 \\ \textrm{Height} & = & \textrm{Row2} - \textrm{Row1} + 1 \\ \textrm{Ratio} & = & \textrm{Height} / \textrm{Width} \end{eqnarray*}\]

複数の領域が Regionsregionsregions に対して入力された場合、結果は Regionsregionsregions の 各領域と同じ順序でtupleに格納されます。空の領域の場合、他の動作が設定されていなければ すべてのパラメーターは 0 になります。 (オペレーター set_systemSetSystem を参照してください。

実行情報🔗

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

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

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

パラメーター🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

対称となる領域

Heightheightheight (output_control) extent.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

領域を囲む矩形の高さ

Widthwidthwidth (output_control) extent.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

領域を囲む矩形の幅

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

領域を囲む矩形のアスペクト比

複雑性🔗

\(F\) を領域の面積であるとすると、平均実行時間は \(O(sqrt(F))\) です。

結果🔗

入力が空でない場合、オペレーター height_width_ratioHeightWidthRatio は、 値 2 (H_MSG_TRUE) を返します。入力が空だった場合(入力画像が得られない場合) の動作は、オペレーター set_system('no_object_result',<Result>) で設定されます。 空の領域の場合(領域が空集合である場合)の動作は、オペレーター set_system('empty_region_result',<Result>) を通して設定さ れます。 必要に応じて、例外が発生します。

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

組み合わせ

前処理の候補

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection, runlength_featuresRunlengthFeatures

他の選択候補

smallest_rectangle1SmallestRectangle1, smallest_rectangle2SmallestRectangle2, region_featuresRegionFeatures

関連項目

select_shapeSelectShape, smallest_circleSmallestCircle, elliptic_axisEllipticAxis, area_centerAreaCenter

モジュール🔗

Foundation