Name
fit_line_contour_xld fit_line_contour_xld FitLineContourXld fit_line_contour_xld FitLineContourXld FitLineContourXld — Approximieren von XLD-Konturen durch Liniensegmente.
fit_line_contour_xld (Contours : : Algorithm , MaxNumPoints , ClippingEndPoints , Iterations , ClippingFactor : RowBegin , ColBegin , RowEnd , ColEnd , Nr , Nc , Dist )
Herror fit_line_contour_xld (const Hobject Contours , const char* Algorithm , const Hlong MaxNumPoints , const Hlong ClippingEndPoints , const Hlong Iterations , double ClippingFactor , double* RowBegin , double* ColBegin , double* RowEnd , double* ColEnd , double* Nr , double* Nc , double* Dist )
Herror T_fit_line_contour_xld (const Hobject Contours , const Htuple Algorithm , const Htuple MaxNumPoints , const Htuple ClippingEndPoints , const Htuple Iterations , const Htuple ClippingFactor , Htuple* RowBegin , Htuple* ColBegin , Htuple* RowEnd , Htuple* ColEnd , Htuple* Nr , Htuple* Nc , Htuple* Dist )
Herror fit_line_contour_xld (Hobject Contours , const HTuple& Algorithm , const HTuple& MaxNumPoints , const HTuple& ClippingEndPoints , const HTuple& Iterations , const HTuple& ClippingFactor , double* RowBegin , double* ColBegin , double* RowEnd , double* ColEnd , double* Nr , double* Nc , double* Dist )
Herror fit_line_contour_xld (Hobject Contours , const HTuple& Algorithm , const HTuple& MaxNumPoints , const HTuple& ClippingEndPoints , const HTuple& Iterations , const HTuple& ClippingFactor , HTuple* RowBegin , HTuple* ColBegin , HTuple* RowEnd , HTuple* ColEnd , HTuple* Nr , HTuple* Nc , HTuple* Dist )
double HXLDCont ::FitLineContourXld (const HTuple& Algorithm , const HTuple& MaxNumPoints , const HTuple& ClippingEndPoints , const HTuple& Iterations , const HTuple& ClippingFactor , double* ColBegin , double* RowEnd , double* ColEnd , double* Nr , double* Nc , double* Dist ) const
HTuple HXLDContArray ::FitLineContourXld (const HTuple& Algorithm , const HTuple& MaxNumPoints , const HTuple& ClippingEndPoints , const HTuple& Iterations , const HTuple& ClippingFactor , HTuple* ColBegin , HTuple* RowEnd , HTuple* ColEnd , HTuple* Nr , HTuple* Nc , HTuple* Dist ) const
void FitLineContourXld (const HObject& Contours , const HTuple& Algorithm , const HTuple& MaxNumPoints , const HTuple& ClippingEndPoints , const HTuple& Iterations , const HTuple& ClippingFactor , HTuple* RowBegin , HTuple* ColBegin , HTuple* RowEnd , HTuple* ColEnd , HTuple* Nr , HTuple* Nc , HTuple* Dist )
void HXLDCont ::FitLineContourXld (const HString& Algorithm , Hlong MaxNumPoints , Hlong ClippingEndPoints , Hlong Iterations , double ClippingFactor , HTuple* RowBegin , HTuple* ColBegin , HTuple* RowEnd , HTuple* ColEnd , HTuple* Nr , HTuple* Nc , HTuple* Dist ) const
void HXLDCont ::FitLineContourXld (const HString& Algorithm , Hlong MaxNumPoints , Hlong ClippingEndPoints , Hlong Iterations , double ClippingFactor , double* RowBegin , double* ColBegin , double* RowEnd , double* ColEnd , double* Nr , double* Nc , double* Dist ) const
void HXLDCont ::FitLineContourXld (const char* Algorithm , Hlong MaxNumPoints , Hlong ClippingEndPoints , Hlong Iterations , double ClippingFactor , double* RowBegin , double* ColBegin , double* RowEnd , double* ColEnd , double* Nr , double* Nc , double* Dist ) const
void HOperatorSetX .FitLineContourXld ( [in] IHUntypedObjectX* Contours , [in] VARIANT Algorithm , [in] VARIANT MaxNumPoints , [in] VARIANT ClippingEndPoints , [in] VARIANT Iterations , [in] VARIANT ClippingFactor , [out] VARIANT* RowBegin , [out] VARIANT* ColBegin , [out] VARIANT* RowEnd , [out] VARIANT* ColEnd , [out] VARIANT* Nr , [out] VARIANT* Nc , [out] VARIANT* Dist )
VARIANT HXLDContX .FitLineContourXld ( [in] BSTR Algorithm , [in] Hlong MaxNumPoints , [in] Hlong ClippingEndPoints , [in] Hlong Iterations , [in] double ClippingFactor , [out] VARIANT* ColBegin , [out] VARIANT* RowEnd , [out] VARIANT* ColEnd , [out] VARIANT* Nr , [out] VARIANT* Nc , [out] VARIANT* Dist )
static void HOperatorSet .FitLineContourXld (HObject contours , HTuple algorithm , HTuple maxNumPoints , HTuple clippingEndPoints , HTuple iterations , HTuple clippingFactor , out HTuple rowBegin , out HTuple colBegin , out HTuple rowEnd , out HTuple colEnd , out HTuple nr , out HTuple nc , out HTuple dist )
void HXLDCont .FitLineContourXld (string algorithm , int maxNumPoints , int clippingEndPoints , int iterations , double clippingFactor , out HTuple rowBegin , out HTuple colBegin , out HTuple rowEnd , out HTuple colEnd , out HTuple nr , out HTuple nc , out HTuple dist )
void HXLDCont .FitLineContourXld (string algorithm , int maxNumPoints , int clippingEndPoints , int iterations , double clippingFactor , out double rowBegin , out double colBegin , out double rowEnd , out double colEnd , out double nr , out double nc , out double dist )
fit_line_contour_xld fit_line_contour_xld FitLineContourXld fit_line_contour_xld FitLineContourXld FitLineContourXld approximiert die XLD-Konturen
Contours Contours Contours Contours Contours contours durch Liniensegmente. Eine Segmentation der
Eingabekonturen erfolgt dabei nicht. Es muss also sichergestellt
sein, dass jede Kontur in Contours Contours Contours Contours Contours contours genau einem
Liniensegment entspricht. Zurückgegeben wird der Anfangs-
(RowBegin RowBegin RowBegin RowBegin RowBegin rowBegin , ColBegin ColBegin ColBegin ColBegin ColBegin colBegin ) bzw. Endpunkt
(RowEnd RowEnd RowEnd RowEnd RowEnd rowEnd , ColEnd ColEnd ColEnd ColEnd ColEnd colEnd ), sowie die Geradengleichung jedes
Liniensegments, codiert durch den Normalenvektor (Nr Nr Nr Nr Nr nr ,
Nc Nc Nc Nc Nc nc ) der Gerade und dem Abstand Dist Dist Dist Dist Dist dist der Gerade vom
Ursprung, d.h. die Geradengleichung ist gegeben durch
.
Das gewünschte Approximationsverfahren wird über den Parameter
Algorithm Algorithm Algorithm Algorithm Algorithm algorithm ausgewählt:
'regression' "regression" "regression" "regression" "regression" "regression" :
Standard-Least-Squares-Geradenanpassung.
'huber' "huber" "huber" "huber" "huber" "huber" :
Gewichtete Least-Squares -Geradenanpassung, bei der Ausreißer
nach dem Ansatz von Huber gedämpft werden (siehe unten).
'tukey' "tukey" "tukey" "tukey" "tukey" "tukey" :
Gewichtete Least-Squares -Geradenanpassung, bei der Ausreißer
nach dem Ansatz von Tukey ignoriert werden (siehe unten).
'drop' "drop" "drop" "drop" "drop" "drop" :
Gewichtete Least-Squares -Geradenanpassung, bei der Ausreißer
ignoriert werden, d.h. alle Konturpunkte, die
weiter von der Kontur entfernt liegen als die mittlere Entfernung von der
Regressionsgeraden multipliziert mit dem ClippingFactor ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor (s.u.).
'gauss' "gauss" "gauss" "gauss" "gauss" "gauss" :
Gewichtete Least-Squares -Geradenanpassung,
bei der Ausreißer gestützt auf Mittelwert und Standardabweichung der
Abweichungen aller Konturpunkte von der Geraden gedämpft werden.
In den Modi 'huber', 'tukey' und 'drop' wird eine robuste Fehlerstatistik
verwendet, um die Standardabweichung der Abstände der Konturpunkte (ohne
Ausreißer) von der approximierenden Geraden zu ermitteln. Der Parameter
ClippingFactor ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor (ein Skalierungsfaktor für diese Standardabweichung)
steuert in diesen Modi den Grad der Ausreißerdämpfung: Je kleiner der Wert
gewählt wird, desto mehr Punkte werden als Ausreißer behandelt. Die Ausreißerdetektion wird
iteriert. Der Parameter Iterations Iterations Iterations Iterations Iterations iterations enthält die Anzahl
durchzuführender Iterationen. Er wird im Modus 'regression' ignoriert. Bei
dem Ansatz nach Tukey ('tukey') werden Ausreißer noch vor der Kreisanpassung
eliminiert (und die übrigen Punkte werden gewichtet), während die Ausreißer
bei dem Ansatz nach Huber ('huber') noch in geringem Maße in die Optimierung
eingehen. Speziell gehen bei Letzterem die Ausreißer linear und die übrigen
Punkte quadratisch in die Optimierung ein. In der Praxis ist der
Ansatz nach Tukey zu emfehlen.
Zur Reduktion des Aufwandes lässt sich die Berechnung auf eine
Teilmenge der Konturpunkte einschränken: Wird für
MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints maxNumPoints eine Zahl ungleich -1 übergeben, werden nur
maximal MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints maxNumPoints gleichmäßig über die Kontur
verteilte Punkte verwendet.
Die Anfangs- und Endpunkte werden bestimmt, indem zu den Anfangs-
und Endpunkten der Eingabekonturen die nächstgelegenen Punkte auf
den zugrundeliegenden Regressionsgeraden ermittelt werden. Da die
Start- und Endpunkte einer Kontur je nach Vorverarbeitung nicht
exakt bekannt sein können, besteht die Möglichkeit,
ClippingEndPoints ClippingEndPoints ClippingEndPoints ClippingEndPoints ClippingEndPoints clippingEndPoints Punkte am Anfang und Ende der Kontur von
der Geradenanpassung auszuschließen. Sie werden jedoch weiterhin
für die Bestimmung der Anfangs- und Endpunkte verwendet.
Die notwendige, minimale Anzahl an Konturpunkten zur Anpassung einer Linie
ist zwei. Es wird daher vorausgesetzt, dass die Konturen mindestens
Punkte enthalten.
Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
Wird ohne Parallelisierung verarbeitet.
Algorithmus zur Geradenanpassung.
Defaultwert:
'tukey'
"tukey"
"tukey"
"tukey"
"tukey"
"tukey"
Werteliste: 'drop' "drop" "drop" "drop" "drop" "drop" , 'gauss' "gauss" "gauss" "gauss" "gauss" "gauss" , 'huber' "huber" "huber" "huber" "huber" "huber" , 'regression' "regression" "regression" "regression" "regression" "regression" , 'tukey' "tukey" "tukey" "tukey" "tukey" "tukey"
Maximale Anzahl Konturpunkte zur Geradenanpassung
(-1 für alle Punkte).
Defaultwert: -1
Restriktion: MaxNumPoints >= 2
Anzahl der Konturpunkte am Anfang und Ende der
Kontur, die für die Geradenanpassung ignoriert werden
sollen.
Defaultwert: 0
Restriktion: ClippingEndPoints >= 0
Maximale Anzahl von Iterationen (unbenutzt bei
'regression').
Defaultwert: 5
Restriktion: Iterations >= 0
Clipping Faktor für die Ausreißerdämpfung
(typisch: 1.0 bei 'huber' und 'drop' sowie
2.0 bei 'tukey').
Defaultwert: 2.0
Werteliste: 1.0, 1.5, 2.0, 2.5, 3.0
Restriktion: ClippingFactor > 0
Zeilenkoordinate der Anfangspunkte der Liniensegmente.
Spaltenkoordinate der Anfangspunkte der Liniensegmente.
Zeilenkoordinate der Endpunkte der Liniensegmente.
Spaltenkoordinate der Endpunkte der Liniensegmente.
Nr Nr Nr Nr Nr nr (output_control) number(-array) → HTuple HTuple HTuple VARIANT Htuple (real) (double ) (double ) (double ) (double ) (double )
Geradenparameter: Zeilenkoordinate von Normalenvektor
Nc Nc Nc Nc Nc nc (output_control) number(-array) → HTuple HTuple HTuple VARIANT Htuple (real) (double ) (double ) (double ) (double ) (double )
Geradenparameter: Spaltenkoordinate von Normalenvektor
Geradenparameter: Abstand der Geraden vom Ursprung
read_image (Image, 'mreut')
edges_sub_pix (Image, Edges, 'lanser2', 0.5, 20, 40)
gen_polygons_xld (Edges, Polygons, 'ramer', 2)
split_contours_xld (Polygons, Contours, 'polygon', 1, 5)
fit_line_contour_xld (Contours, 'regression', -1, 0, 5, 2, RowBegin, \
ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
read_image (Image, 'mreut')
edges_sub_pix (Image, Edges, 'lanser2', 0.5, 20, 40)
gen_polygons_xld (Edges, Polygons, 'ramer', 2)
split_contours_xld (Polygons, Contours, 'polygon', 1, 5)
fit_line_contour_xld (Contours, 'regression', -1, 0, 5, 2, RowBegin, \
ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
read_image (Image, 'mreut')
edges_sub_pix (Image, Edges, 'lanser2', 0.5, 20, 40)
gen_polygons_xld (Edges, Polygons, 'ramer', 2)
split_contours_xld (Polygons, Contours, 'polygon', 1, 5)
fit_line_contour_xld (Contours, 'regression', -1, 0, 5, 2, RowBegin, \
ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
read_image (Image, 'mreut');
edges_sub_pix (Image, Edges, 'lanser2', 0.5, 20, 40);
gen_polygons_xld (Edges, Polygons, 'ramer', 2);
split_contours_xld (Polygons, Contours, 'polygon', 1, 5);
fit_line_contour_xld (Contours, 'regression', -1, 0, 5, 2, RowBegin,
ColBegin, RowEnd, ColEnd, Nr, Nc, Dist);
read_image (Image, 'mreut')
edges_sub_pix (Image, Edges, 'lanser2', 0.5, 20, 40)
gen_polygons_xld (Edges, Polygons, 'ramer', 2)
split_contours_xld (Polygons, Contours, 'polygon', 1, 5)
fit_line_contour_xld (Contours, 'regression', -1, 0, 5, 2, RowBegin, \
ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
read_image (Image, 'mreut')
edges_sub_pix (Image, Edges, 'lanser2', 0.5, 20, 40)
gen_polygons_xld (Edges, Polygons, 'ramer', 2)
split_contours_xld (Polygons, Contours, 'polygon', 1, 5)
fit_line_contour_xld (Contours, 'regression', -1, 0, 5, 2, RowBegin, \
ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
Sind die Parameterwerte korrekt und konnte eine Geradenanpassung
durchgeführt werden, liefert fit_line_contour_xld fit_line_contour_xld FitLineContourXld fit_line_contour_xld FitLineContourXld FitLineContourXld den Wert 2 (H_MSG_TRUE).
Das Verhalten bei leerer Eingabe (keine Eingabebilder vorhanden) lässt
sich mittels set_system('no_object_result',<Result>) set_system("no_object_result",<Result>) SetSystem("no_object_result",<Result>) set_system("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) festlegen.
Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.
Wenn der Parameter ClippingFactor ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor so klein gewählt worden ist,
dass alle Punkte als Ausreißer klassifiziert werden, wird die Fehlermeldung
3264 zurückgeliefert.
gen_contours_skeleton_xld gen_contours_skeleton_xld GenContoursSkeletonXld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld ,
lines_gauss lines_gauss LinesGauss lines_gauss LinesGauss LinesGauss ,
lines_facet lines_facet LinesFacet lines_facet LinesFacet LinesFacet ,
edges_sub_pix edges_sub_pix EdgesSubPix edges_sub_pix EdgesSubPix EdgesSubPix ,
smooth_contours_xld smooth_contours_xld SmoothContoursXld smooth_contours_xld SmoothContoursXld SmoothContoursXld
disp_line disp_line DispLine disp_line DispLine DispLine ,
select_lines select_lines SelectLines select_lines SelectLines SelectLines ,
line_orientation line_orientation LineOrientation line_orientation LineOrientation LineOrientation
regress_contours_xld regress_contours_xld RegressContoursXld regress_contours_xld RegressContoursXld RegressContoursXld ,
get_regress_params_xld get_regress_params_xld GetRegressParamsXld get_regress_params_xld GetRegressParamsXld GetRegressParamsXld
Foundation