Skip to content

hough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dirT_hough_lines_dir🔗

説明🔗

hough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dirT_hough_lines_dir — 局所勾配方向を用いてハフ変換によってエッジ画像内の直線を検出し、 正規形でそれらを返す。

書式🔗

hough_lines_dir( image ImageDir, out image HoughImage, out region Lines, angle.deg DirectionUncertainty, integer AngleResolution, string Smoothing, integer FilterSize, integer Threshold, integer AngleGap, integer DistGap, string GenLines, out hesseline.angle.rad Angle, out hesseline.distance Dist )void HoughLinesDir( const HObject& ImageDir, HObject* HoughImage, HObject* Lines, const HTuple& DirectionUncertainty, const HTuple& AngleResolution, const HTuple& Smoothing, const HTuple& FilterSize, const HTuple& Threshold, const HTuple& AngleGap, const HTuple& DistGap, const HTuple& GenLines, HTuple* Angle, HTuple* Dist )static void HOperatorSet.HoughLinesDir( HObject imageDir, out HObject houghImage, out HObject lines, HTuple directionUncertainty, HTuple angleResolution, HTuple smoothing, HTuple filterSize, HTuple threshold, HTuple angleGap, HTuple distGap, HTuple genLines, out HTuple angle, out HTuple dist )def hough_lines_dir( image_dir: HObject, direction_uncertainty: int, angle_resolution: int, smoothing: str, filter_size: int, threshold: int, angle_gap: int, dist_gap: int, gen_lines: str ) -> Tuple[HObject, HObject, Sequence[float], Sequence[float]]

Herror T_hough_lines_dir( const Hobject ImageDir, Hobject* HoughImage, Hobject* Lines, const Htuple DirectionUncertainty, const Htuple AngleResolution, const Htuple Smoothing, const Htuple FilterSize, const Htuple Threshold, const Htuple AngleGap, const Htuple DistGap, const Htuple GenLines, Htuple* Angle, Htuple* Dist )

HImage HImage::HoughLinesDir( HRegion* Lines, Hlong DirectionUncertainty, Hlong AngleResolution, const HString& Smoothing, Hlong FilterSize, Hlong Threshold, Hlong AngleGap, Hlong DistGap, const HString& GenLines, HTuple* Angle, HTuple* Dist ) const

HImage HImage::HoughLinesDir( HRegion* Lines, Hlong DirectionUncertainty, Hlong AngleResolution, const char* Smoothing, Hlong FilterSize, Hlong Threshold, Hlong AngleGap, Hlong DistGap, const char* GenLines, HTuple* Angle, HTuple* Dist ) const

HImage HImage::HoughLinesDir( HRegion* Lines, Hlong DirectionUncertainty, Hlong AngleResolution, const wchar_t* Smoothing, Hlong FilterSize, Hlong Threshold, Hlong AngleGap, Hlong DistGap, const wchar_t* GenLines, HTuple* Angle, HTuple* Dist ) const (Windows only)

HImage HImage.HoughLinesDir( out HRegion lines, int directionUncertainty, int angleResolution, string smoothing, int filterSize, int threshold, int angleGap, int distGap, string genLines, out HTuple angle, out HTuple dist )

説明🔗

hough_lines_dirHoughLinesDir オペレーターは、ハフ変換に基づき領域内の直線構造 を選択します。そのために直線の個々の点が連結されている必要性はありません。 領域は ImageDirimageDirimage_dir のドメインで与えられます。

hough_linesHoughLines とは異なり、付加的に ImageDirimageDirimage_dir (たとえば sobel_dirSobelDir や edges_imageEdgesImage で返される) の エッジ方向が使用されます。これにより、より効果的な計算や、ハフ空間内のノイズを 削減するといった効果が得られます。

パラメーター DirectionUncertaintydirectionUncertaintydirection_uncertainty は 直線内の個々の点における エッジ方向の変換の許容範囲を指定します。 たとえば、DirectionUncertaintydirectionUncertaintydirection_uncertainty = 1010 とすると、 水平直線 (エッジ方向 = 0 度) は -10度から10度の範囲のエッジ方向をもった点を 持つことになります。DirectionUncertaintydirectionUncertaintydirection_uncertainty の値が大きい程 、より計算時間が長くなります。 DirectionUncertaintydirectionUncertaintydirection_uncertainty = 180180 では、 hough_line_trans_dirHoughLineTransDir は hough_line_transHoughLineTrans と同じような 振る舞いを示します。つまり、エッジ方向が無視されます。 DirectionUncertaintydirectionUncertaintydirection_uncertainty は 少なくとも ImageDirimageDirimage_dir 内 に 蓄えられるエッジ方向のステップ幅と同じ高さを選択します。 最小のステップ幅は 2 度です。 (画像形式の ‘direction’ によって定義されます。)

パラメーター AngleResolutionangleResolutionangle_resolution は角度に関する精度を定義します。 精度は \(1 / \textrm{AngleResolution}\) 度で定義されます。 ハフ空間の平滑化は安定性を増加する効果を持ちます。 平滑化フィルターは Smoothingsmoothingsmoothing により選択でき、 パラメーター FilterSizefilterSizefilter_size により平滑化の程度を決めることができます。 (詳細は mean_imageMeanImage や gauss_imageGaussImage を見てください)。 パラメーター Thresholdthresholdthreshold は直線の候補が最終的な出力として選択されるに当たって、 領域内の何点から少なくとも支持される必要があるかを指定します。 パラメーター AngleGapangleGapangle_gap と DistGapdistGapdist_gap は 局所的な最大値を決定する ためにハフ画像内の点の近傍を定義します。つまり AngleGapangleGapangle_gap は、 角度方向におけるハフ画像中の2つの最大値の最小距離を表したものであり、 DistGapdistGapdist_gap は距離方向における最小距離を表します。 それゆえ、Thresholdthresholdthreshold の値より高いものの、より高い最大値が近くにある局所最大値は削除されます。

これは特に、同時に短い直線と長い直線を探すときに役に立ちます。 平滑化されていないハフ画像 HoughImagehoughImagehough_image に加え、 直線が HNF (Angleangleangle, Distdistdist) の形式で返されます。

この近傍にある複数の最大値が等しく高い場合は、それらすべてが返されます。 この除去は短い直線と長い直線を同時に探索する場合に特に有効です。 平滑化されていないハフ画像 HoughImagehoughImagehough_image の他に、直線は ヘッセ標準形 (HNF) 、 つまり法線ベクトルの方向 Angleangleangle と長さ Distdistdist で返されます。

もしパラメーター GenLinesgenLinesgen_lines が 'true'"true" に設定されて いるならば、付加的に ImageDirimageDirimage_dir 内のそれらの領域が返され、 Hough 空間内の局所最大値が返されます。 それらはパラメーター Lineslineslines 内に返されます。

実行情報🔗

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

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

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

パラメーター🔗

ImageDirimageDirimage_dir (input_object) singlechannelimage → object (direction)HObject (direction)HImage (direction)HObject (direction)Hobject (direction)

エッジ方向を含む画像(エッジは画像のドメインにて 記述されている必要があります)

HoughImagehoughImagehough_image (output_object) image → object (uint2)HObject (uint2)HImage (uint2)HObject (uint2)Hobject * (uint2)

Hough 変換

Lineslineslines (output_object) region-array → objectHObjectHRegionHObjectHobject *

局所最大を与える入力画像の領域

DirectionUncertaintydirectionUncertaintydirection_uncertainty (input_control) angle.deg → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

エッジ方向の不確かさ(角度による)

初期値: 22
値域: 2 ≤ DirectionUncertainty ≤ 180
最小増分: 2

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

角度領域における分解能(1 / 角度による)

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

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

hough 画像のための平滑化フィルター

初期値: 'mean'"mean"
値のリスト: 'gauss', 'mean', 'none'"gauss", "mean", "none"

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

必要とされる平滑化フィルターのサイズ

初期値: 55
値のリスト: 3, 5, 7, 9, 113, 5, 7, 9, 11

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

Hough 画像における閾値

初期値: 100100
値域: 1 ≤ 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

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

もし 'true'"true" ならば、直線領域を作成します。

初期値: 'true'"true"
値のリスト: 'false', 'true'"false", "true"

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>) を通じて 設定したものとなります。もし必要なら、例外が生じます。

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

組み合わせ

前処理の候補

edges_imageEdgesImage, sobel_dirSobelDir, thresholdThreshold, nonmax_suppression_dirNonmaxSuppressionDir, reduce_domainReduceDomain, skeletonSkeleton

後処理の候補

gen_region_hlineGenRegionHline, select_matching_linesSelectMatchingLines

関連項目

hough_line_trans_dirHoughLineTransDir, hough_line_transHoughLineTrans, gen_region_hlineGenRegionHline, hough_circlesHoughCircles

モジュール🔗

Foundation