elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldelliptic_axis_xld (Operator)

Name

elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldelliptic_axis_xld — Parameter der äquivalenten Ellipse von Konturen oder Polygonen.

Signatur

elliptic_axis_xld(XLD : : : Ra, Rb, Phi)

Herror elliptic_axis_xld(const Hobject XLD, double* Ra, double* Rb, double* Phi)

Herror T_elliptic_axis_xld(const Hobject XLD, Htuple* Ra, Htuple* Rb, Htuple* Phi)

void EllipticAxisXld(const HObject& XLD, HTuple* Ra, HTuple* Rb, HTuple* Phi)

HTuple HXLD::EllipticAxisXld(HTuple* Rb, HTuple* Phi) const

double HXLD::EllipticAxisXld(double* Rb, double* Phi) const

static void HOperatorSet.EllipticAxisXld(HObject XLD, out HTuple ra, out HTuple rb, out HTuple phi)

HTuple HXLD.EllipticAxisXld(out HTuple rb, out HTuple phi)

double HXLD.EllipticAxisXld(out double rb, out double phi)

def elliptic_axis_xld(xld: HObject) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]

def elliptic_axis_xld_s(xld: HObject) -> Tuple[float, float, float]

Beschreibung

elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldEllipticAxisXldelliptic_axis_xld berechnet die Radien und die Orientierungen der Ellipsen, die die gleiche Orientierung und das gleiche Seitenverhältnis wie die jeweiligen Eingabekonturen bzw. Eingabepolygone haben. Es wird die Länge der Hauptachse RaRaRaRarara und der Nebenachse RbRbRbRbrbrb sowie die Orientierung der Hauptachse bezüglich der Horizontalen (PhiPhiPhiPhiphiphi) bestimmt. Der Winkel wird dabei im Bogenmaß angegeben. Es wird vorausgesetzt, dass die Konturen bzw. die Polygone geschlossen sind. Ist das nicht der Fall, werden sie künstlich geschlossen.

Berechnung: Seien die Momente , und normiert auf die Fläche gegeben (siehe moments_xldmoments_xldMomentsXldMomentsXldMomentsXldmoments_xld), dann berechnen sich die Radien RaRaRaRarara und RbRbRbRbrbrb zu: Die Orientierung PhiPhiPhiPhiphiphi ist definiert durch:

Es ist zu beachten, dass elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldEllipticAxisXldelliptic_axis_xld nur dann sinnvolle Ergebnisse liefert, falls die Kontur oder das Polygon eine Fläche in der Ebene einschließt. Insbesondere darf sich die Kontur oder das Polygon nicht selbst schneiden. Dies ist insbesondere dann zu beachten, wenn offene Konturen und Polygone übergeben werden, da diese automatisch geschlossen werden, was dazu führen kann, dass sich die Kontur oder das Polygon selbst schneidet. Ob sich die Konturen oder Polygone selbst schneiden, kann leicht mit test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXldTestSelfIntersectionXldtest_self_intersection_xld überprüft werden. Falls sich die Kontur oder das Polygon selbst schneidet, können sinnvolle Werte für die Ellipsenparameter mit elliptic_axis_points_xldelliptic_axis_points_xldEllipticAxisPointsXldEllipticAxisPointsXldEllipticAxisPointsXldelliptic_axis_points_xld berechnet werden.

Wird mehr als eine Kontur oder ein Polygon übergeben, dann werden die Ergebnisse in Tupeln in der Reihenfolge ihrer entsprechenden Konturen bzw. Polygone in XLDXLDXLDXLDXLDxld abgespeichert.

Ausführungsinformationen

Parameter

XLDXLDXLDXLDXLDxld (input_object)  xld(-array) objectHXLDHObjectHXLDHobject

Zu untersuchende Konturen oder Polygone.

RaRaRaRarara (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Hauptradius.

Zusicherung: Ra >= 0.0

RbRbRbRbrbrb (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Nebenradius.

Zusicherung: Rb >= 0.0 && Rb <= Ra

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

Winkel zwischen Hauptachse und x-Achse (Bogenmaß).

Zusicherung: - pi / 2 < Phi && Phi <= pi / 2

Komplexität

Sei N die Anzahl der Punkte in der Kontur bzw. im Polygon, dann beträgt die Laufzeitkomplexität O(N).

Ergebnis

elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldEllipticAxisXldelliptic_axis_xld liefert den Wert TRUE, falls die Eingabe nicht leer ist. Das Verhalten bei leerer Eingabe 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

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix, gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldGenContourPolygonXldgen_contour_polygon_xld, test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXldTestSelfIntersectionXldtest_self_intersection_xld

Nachfolger

area_center_xldarea_center_xldAreaCenterXldAreaCenterXldAreaCenterXldarea_center_xld, gen_ellipse_contour_xldgen_ellipse_contour_xldGenEllipseContourXldGenEllipseContourXldGenEllipseContourXldgen_ellipse_contour_xld

Alternativen

elliptic_axis_points_xldelliptic_axis_points_xldEllipticAxisPointsXldEllipticAxisPointsXldEllipticAxisPointsXldelliptic_axis_points_xld, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2

Siehe auch

moments_xldmoments_xldMomentsXldMomentsXldMomentsXldmoments_xld, smallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXldSmallestCircleXldsmallest_circle_xld, smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld, smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld, shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldShapeTransXldshape_trans_xld

Literatur

R. Haralick, L. Shapiro „Computer and Robot Vision“ Addison-Wesley, 1992, pp. 73-75

Modul

Foundation