hough_lines_dirT_hough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dir (Operator)

Name

hough_lines_dirT_hough_lines_dirHoughLinesDirHoughLinesDirhough_lines_dir — Finden von Linien in Kantenbildern mit Hilfe der Hough-Transformation unter Berücksichtigung der lokalen Gradientenrichtung und Ausgabe in Hessescher Normalform.

Signatur

hough_lines_dir(ImageDir : HoughImage, Lines : DirectionUncertainty, AngleResolution, Smoothing, FilterSize, Threshold, AngleGap, DistGap, GenLines : Angle, Dist)

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)

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)

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   (Nur Windows)

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)

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)

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]]

Beschreibung

Mit Hilfe von hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDirHoughLinesDirhough_lines_dir können in einer Region linienhafte Strukturen selektiert werden. Dabei müssen die einzelnen Punkte einer Linie nicht zusammenhängen. Das Verfahren basiert auf der Hough-Transformation. Die Region muss als Definitionsbereich in ImageDirImageDirImageDirImageDirimageDirimage_dir übergeben werden.

Im Unterschied zu hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines wird hier jedoch zusätzlich die in ImageDirImageDirImageDirImageDirimageDirimage_dir übergebene Kantenrichtung berücksichtigt, die z.B. mit Hilfe von sobel_dirsobel_dirSobelDirSobelDirSobelDirsobel_dir oder edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image bestimmt werden kann. Dies führt zu einer effizienteren Berechnung und zu einer Reduktion des Rauschens im Hough-Raum.

Der Parameter DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty beschreibt hierbei, wie stark die Kantenrichtung der einzelnen Punkte innerhalb einer Linie variieren darf. Ist z.B. DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty = 10, werden einer waagrechten Linie (d.h. Kantenrichtung = 0 Grad) nur Punkte mit einer Kantenrichtung zwischen -10 und +10 Grad zugeordnet. Je größer DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty gewählt wird desto langsamer ist die Berechnung; für DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty = 180 entspricht das Verhalten von hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDirHoughLinesDirhough_lines_dir dem von hough_lineshough_linesHoughLinesHoughLinesHoughLineshough_lines, d.h. die Kantenrichtung wird ignoriert. DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty sollte mindestens so groß gewählt werden wie die Winkelschrittweite, in der die Kantenrichtungen in ImageDirImageDirImageDirImageDirimageDirimage_dir gespeichert werden; die minimale Schrittweite beträgt 2 Grad (vorgegeben vom Bildtyp 'direction').

Mit AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution wird die Genauigkeit bei der Bestimmung der Winkel definiert. Sie beträgt 1 / AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution Grad. Eine Glättung des Hough-Raumes nach der Transformation erhöht die Stabilität des Verfahrens. Die Art der Glättung kann mit SmoothingSmoothingSmoothingSmoothingsmoothingsmoothing festgelegt werden. Der Glättungsgrad kann mit FilterSizeFilterSizeFilterSizeFilterSizefilterSizefilter_size analog zu gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter oder mean_imagemean_imageMeanImageMeanImageMeanImagemean_image angegeben werden. Der Parameter ThresholdThresholdThresholdThresholdthresholdthreshold bestimmt, durch wie viel Punkte der Ausgangsregion eine Linienhypothese wenigstens gestützt werden muss, um in die Ausgabe zu gelangen. AngleGapAngleGapAngleGapAngleGapangleGapangle_gap und DistGapDistGapDistGapDistGapdistGapdist_gap definieren eine Umgebung um die Punkte im Hough-Bild für die Bestimmung der lokalen Maxima: AngleGapAngleGapAngleGapAngleGapangleGapangle_gap beschreibt den minimalen Abstand zweier Maxima im Hough-Bild in Richtung des Winkels und DistGapDistGapDistGapDistGapdistGapdist_gap entsprechend in Richtung der Distanz. Dadurch werden Maxima, die zwar die vorgegebene Schwelle ThresholdThresholdThresholdThresholdthresholdthreshold überschreiten, jedoch sehr nahe an einem noch höheren Maximum liegen, eliminiert. Falls mehrere Maxima in dieser Umgebung gleich hoch sind, werden alle zurückgegeben. Dieses Eliminationsverfahren kann vor allem bei der gleichzeitigen Suche nach langen und kurzen Linien hilfreich sein. Neben dem ungeglätteten Hough-Bild HoughImageHoughImageHoughImageHoughImagehoughImagehough_image werden die Linien in Hessescher Normalform zurückgeliefert, d.h. durch Richtung AngleAngleAngleAngleangleangle und Länge DistDistDistDistdistdist ihres Normalenvektors repräsentiert.

Mit Hilfe des Parameters GenLinesGenLinesGenLinesGenLinesgenLinesgen_lines kann darüber hinaus festgelegt werden, ob zusätzlich diejenigen Regionen in ImageDirImageDirImageDirImageDirimageDirimage_dir zurückgeliefert werden sollen, die zur Bildung der lokalen Maxima beigetragen haben. Für GenLinesGenLinesGenLinesGenLinesgenLinesgen_lines = 'true'"true""true""true""true""true" werden diese dann in LinesLinesLinesLineslineslines gespeichert.

Ausführungsinformationen

Parameter

ImageDirImageDirImageDirImageDirimageDirimage_dir (input_object)  singlechannelimage objectHImageHObjectHImageHobject (direction)

Kantenrichtungsbild mit auf die Kanten eingeschränktem Definitionsbereich.

HoughImageHoughImageHoughImageHoughImagehoughImagehough_image (output_object)  image objectHImageHObjectHImageHobject * (uint2)

Hough-Transformation.

LinesLinesLinesLineslineslines (output_object)  region-array objectHRegionHObjectHRegionHobject *

Regionen des Eingabebildes, die zur Bildung der lokalen Maxima beigetragen haben.

DirectionUncertaintyDirectionUncertaintyDirectionUncertaintyDirectionUncertaintydirectionUncertaintydirection_uncertainty (input_control)  angle.deg HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Kantenungenauigkeit (in Grad).

Defaultwert: 2

Typischer Wertebereich: 2 ≤ DirectionUncertainty DirectionUncertainty DirectionUncertainty DirectionUncertainty directionUncertainty direction_uncertainty ≤ 180

Minimale Schrittweite: 2

AngleResolutionAngleResolutionAngleResolutionAngleResolutionangleResolutionangle_resolution (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Auflösung im Winkelbereich (in 1/Grad).

Defaultwert: 4

Werteliste: 1, 2, 4, 8

SmoothingSmoothingSmoothingSmoothingsmoothingsmoothing (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Glättungsfilter für Hough-Bild.

Defaultwert: 'mean' "mean" "mean" "mean" "mean" "mean"

Werteliste: 'gauss'"gauss""gauss""gauss""gauss""gauss", 'mean'"mean""mean""mean""mean""mean", 'none'"none""none""none""none""none"

FilterSizeFilterSizeFilterSizeFilterSizefilterSizefilter_size (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Gewünschte Größe des Glättungsfilters.

Defaultwert: 5

Werteliste: 3, 5, 7, 9, 11

ThresholdThresholdThresholdThresholdthresholdthreshold (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Schwellenwert im Hough-Bild.

Defaultwert: 100

Typischer Wertebereich: 1 ≤ Threshold Threshold Threshold Threshold threshold threshold

AngleGapAngleGapAngleGapAngleGapangleGapangle_gap (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimaler Abstand zwischen zwei Maxima im Hough-Bild (in Richtung des Winkels).

Defaultwert: 5

Typischer Wertebereich: 0 ≤ AngleGap AngleGap AngleGap AngleGap angleGap angle_gap

DistGapDistGapDistGapDistGapdistGapdist_gap (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimaler Abstand zwischen zwei Maxima im Hough-Bild (in Richtung der Distance).

Defaultwert: 5

Typischer Wertebereich: 0 ≤ DistGap DistGap DistGap DistGap distGap dist_gap

GenLinesGenLinesGenLinesGenLinesgenLinesgen_lines (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Generiert Geraden-Regionen, wenn 'true'"true""true""true""true""true".

Defaultwert: 'true' "true" "true" "true" "true" "true"

Werteliste: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

AngleAngleAngleAngleangleangle (output_control)  hesseline.angle.rad-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Winkel (im Bogenmaß) der Normalenvektoren der gefundenen Linien.

Typischer Wertebereich: -1.5707963 ≤ Angle Angle Angle Angle angle angle ≤ 3.1415927

DistDistDistDistdistdist (output_control)  hesseline.distance-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Abstände der gefundenen Linien vom Koordinatenursprung.

Parameteranzahl: Dist == Angle

Typischer Wertebereich: 0 ≤ Dist Dist Dist Dist dist dist

Ergebnis

hough_lines_dirhough_lines_dirHoughLinesDirHoughLinesDirHoughLinesDirhough_lines_dir liefert den Wert 2 (H_MSG_TRUE), falls die Eingabe nicht leer ist. Das Verhalten bei leerer Eingabe (keine Eingaberegionen vorhanden) lässt sich mittels set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image, sobel_dirsobel_dirSobelDirSobelDirSobelDirsobel_dir, thresholdthresholdThresholdThresholdThresholdthreshold, nonmax_suppression_dirnonmax_suppression_dirNonmaxSuppressionDirNonmaxSuppressionDirNonmaxSuppressionDirnonmax_suppression_dir, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, skeletonskeletonSkeletonSkeletonSkeletonskeleton

Nachfolger

gen_region_hlinegen_region_hlineGenRegionHlineGenRegionHlineGenRegionHlinegen_region_hline, select_matching_linesselect_matching_linesSelectMatchingLinesSelectMatchingLinesSelectMatchingLinesselect_matching_lines

Siehe auch

hough_line_trans_dirhough_line_trans_dirHoughLineTransDirHoughLineTransDirHoughLineTransDirhough_line_trans_dir, hough_line_transhough_line_transHoughLineTransHoughLineTransHoughLineTranshough_line_trans, gen_region_hlinegen_region_hlineGenRegionHlineGenRegionHlineGenRegionHlinegen_region_hline, hough_circleshough_circlesHoughCirclesHoughCirclesHoughCircleshough_circles

Modul

Foundation