Skip to content

hough_linesHoughLinesHoughLineshough_linesT_hough_lines🔗

説明🔗

hough_linesHoughLinesHoughLineshough_linesT_hough_lines — ハフ変換を使用してエッジ画像内の直線を検出し、それをHNFで返す。

書式🔗

hough_lines( region RegionIn, integer AngleResolution, integer Threshold, integer AngleGap, integer DistGap, out hesseline.angle.rad Angle, out hesseline.distance Dist )void HoughLines( const HObject& RegionIn, const HTuple& AngleResolution, const HTuple& Threshold, const HTuple& AngleGap, const HTuple& DistGap, HTuple* Angle, HTuple* Dist )static void HOperatorSet.HoughLines( HObject regionIn, HTuple angleResolution, HTuple threshold, HTuple angleGap, HTuple distGap, out HTuple angle, out HTuple dist )def hough_lines( region_in: HObject, angle_resolution: int, threshold: int, angle_gap: int, dist_gap: int ) -> Tuple[Sequence[float], Sequence[float]]

Herror T_hough_lines( const Hobject RegionIn, const Htuple AngleResolution, const Htuple Threshold, const Htuple AngleGap, const Htuple DistGap, Htuple* Angle, Htuple* Dist )

HTuple HRegion::HoughLines( Hlong AngleResolution, Hlong Threshold, Hlong AngleGap, Hlong DistGap, HTuple* Dist ) const

HTuple HRegion.HoughLines( int angleResolution, int threshold, int angleGap, int distGap, out HTuple dist )

説明🔗

オペレーター hough_linesHoughLines は、領域内でラインに類似した構造を 検出します。そのためにラインの個々の点が連結される必要性はありません。 このプロセスはハフ変換に基づいています。

パラメーター AngleResolutionangleResolutionangle_resolution は、角度に関する精度を 定義します。 精度は \(1 /\textrm{AngleResolution}\) 度で定義されます。

パラメーター Thresholdthresholdthreshold は、直線の候補が最終的な出力として選択されるに あたって、少なくとも領域内の何点から支持される必要があるかを決定します。 パラメーター AngleGapangleGapangle_gap と DistGapdistGapdist_gap は、 局所的な最大値を決定するために、ハフ画像内の点の近傍を定義します。 AngleGapangleGapangle_gap はハフ画像中の2つの極大点の角度方向の最小距離、 DistGapdistGapdist_gap は距離方向の最小距離をそれぞれ表します。 したがって、Thresholdthresholdthreshold を超えるがさらに高い最大値の近傍にある最大値は除去されます。 この近傍にある複数の最大値が等しく高い場合はそれらすべてが返されます。 この除去は、短い線と長い線を同時に検索する場合に特に有効です。 線はヘッセ標準形 (HNF) で、法線ベクトルの方向Angleangleangle と長さDistdistdist で返される。

実行情報🔗

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

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

  • 並列演算処理には未対応

パラメーター🔗

RegionInregionInregion_in (input_object) region → objectHObjectHRegionHObjectHobject

ラインを検出すべきバイナリエッジ画像

AngleResolutionangleResolutionangle_resolution (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

角度領域での分解能

初期値: 44
値のリスト: 1, 2, 4, 81, 2, 4, 8

Thresholdthresholdthreshold (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

ハフ画像のしきい値

初期値: 100100
値域: 2 ≤ Threshold

AngleGapangleGapangle_gap (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

ハフ画像 (方向:角度) 内の2つの最大に関する最小距離

初期値: 55
値域: 0 ≤ AngleGap

DistGapdistGapdist_gap (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

ハフ画像 (方向:距離) 内の2つの最大に関する最小距離

初期値: 55
値域: 0 ≤ DistGap

Angleangleangle (output_control) hesseline.angle.rad-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

検出されたラインの法線ベクトルの角度 (ラジアン単位)

値域: -1.5707963 ≤ Angle ≤ 3.1415927

Distdistdist (output_control) hesseline.distance-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

原点から検出されたラインの距離

要素数: Dist == Angle
値域: 0 ≤ Dist

結果🔗

オペレーター hough_linesHoughLines は、入力が空でなければ、 値 2 (H_MSG_TRUE) を返します。入力が空の場合の動作(入力領域が得られなかった場合)は、 オペレーター set_system('no_object_result',<Result>) によって 設定され、入力が空き領域の動作は set_system('empty_region_result',<Result>) によって設定されます。 必要であれば、例外が発生します。

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

組み合わせ

前処理の候補

thresholdThreshold, skeletonSkeleton

後処理の候補

select_matching_linesSelectMatchingLines

関連項目

hough_line_transHoughLineTrans, gen_region_hlineGenRegionHline, hough_circlesHoughCircles

モジュール🔗

Foundation