smallest_rectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1smallest_rectangle1
説明
smallest_rectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1smallest_rectangle1 — 領域を囲む、座標軸に平行な最小矩形を求める。
書式
smallest_rectangle1( region Regions, out rectangle.origin.y Row1, out rectangle.origin.x Column1, out rectangle.corner.y Row2, out rectangle.corner.x Column2 )void SmallestRectangle1( const HObject& Regions, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2 )static void HOperatorSet.SmallestRectangle1( HObject regions, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2 )def smallest_rectangle1( regions: HObject ) -> Tuple[Sequence[int], Sequence[int], Sequence[int], Sequence[int]]
def smallest_rectangle1_s( regions: HObject ) -> Tuple[int, int, int, int]Herror smallest_rectangle1( const Hobject Regions, Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2 )
Herror T_smallest_rectangle1( const Hobject Regions, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2 )
void HRegion::SmallestRectangle1( HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2 ) const
void HRegion::SmallestRectangle1( Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2 ) const
void HRegion.SmallestRectangle1( out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2 )
void HRegion.SmallestRectangle1( out int row1, out int column1, out int row2, out int column2 )
説明
オペレーター smallest_rectangle1SmallestRectangle1 は、すべての入力領域を取
り囲む最小の矩形 (座標軸と平行) を計算します。
領域を囲む矩形は、角ピクセル (Row1row1row_1, Column1column1column_1,
Row2row2row_2, Column2column2column_2) の座標によって記述されます。
矩形の計算はピクセルの中心座標に基いて行われます。

領域を囲む矩形によって定まる最小軸。矩形の計算はピクセルの中心座標に基いて行われます。
2 つ以上の領域が Regionsregionsregions に入力されると、その結果は
Tuple に保存されます。この Tuple 内のインデックスは、入力領域のイ
ンデックスに対応します。
空の領域の場合、他の動作が設定されていなければ(
set_systemSetSystem 参照)すべてのパラメーターは 0 となります。
注意
空の領域の場合、Row1row1row_1,Column1column1column_1, Row2row2row_2 およ
び Column2column2column_2 (すべて 0 である) の結果は、予期せぬ値になる
可能性があります。
実行情報
実行情報
パラメーター
Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject
対象となる領域
Row1row1row_1 (output_control) rectangle.origin.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
左上隅の行座標
Column1column1column_1 (output_control) rectangle.origin.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
左上隅の列座標
Row2row2row_2 (output_control) rectangle.corner.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
右下隅の行座標
Column2column2column_2 (output_control) rectangle.corner.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
右下隅の列座標
複雑性
\(F\) を領域の面積であるとすると、平均実行時間は \(O(sqrt(F))\) です。
結果
入力が空でない場合、オペレーター smallest_rectangle1SmallestRectangle1 は、
値 2 (H_MSG_TRUE) を返します。入力が空だった場合(入力画像が得られない場合)
の動作は、オペレーター
set_system('no_object_result',<Result>) で設定されます。
空の領域の場合(領域が空集合である場合)の動作は、オペレーター
set_system('empty_region_result',<Result>) を通して設定さ れます。
必要に応じて、例外が発生します。
他のオペレーターとの組み合わせ
組み合わせ
前処理の候補
thresholdThreshold, regiongrowingRegiongrowing, connectionConnection, runlength_featuresRunlengthFeatures
後処理の候補
disp_rectangle1DispRectangle1, gen_rectangle1GenRectangle1
他の選択候補
height_width_ratioHeightWidthRatio, smallest_rectangle2SmallestRectangle2, area_centerAreaCenter
関連項目
select_shapeSelectShape
モジュール
Foundation