hom_mat3d_projectT_hom_mat3d_projectHomMat3dProjectHomMat3dProject (Operator)

Name

hom_mat3d_projectT_hom_mat3d_projectHomMat3dProjectHomMat3dProject — Projiziert eine Matrix zur affinen 3D-Transformation in eine 2D projektive Transformationsmatrix.

Signatur

hom_mat3d_project( : : HomMat3D, PrincipalPointRow, PrincipalPointCol, Focus : HomMat2D)

Herror T_hom_mat3d_project(const Htuple HomMat3D, const Htuple PrincipalPointRow, const Htuple PrincipalPointCol, const Htuple Focus, Htuple* HomMat2D)

void HomMat3dProject(const HTuple& HomMat3D, const HTuple& PrincipalPointRow, const HTuple& PrincipalPointCol, const HTuple& Focus, HTuple* HomMat2D)

HHomMat2D HHomMat3D::HomMat3dProject(const HTuple& PrincipalPointRow, const HTuple& PrincipalPointCol, const HTuple& Focus) const

HHomMat2D HHomMat3D::HomMat3dProject(double PrincipalPointRow, double PrincipalPointCol, double Focus) const

static void HOperatorSet.HomMat3dProject(HTuple homMat3D, HTuple principalPointRow, HTuple principalPointCol, HTuple focus, out HTuple homMat2D)

HHomMat2D HHomMat3D.HomMat3dProject(HTuple principalPointRow, HTuple principalPointCol, HTuple focus)

HHomMat2D HHomMat3D.HomMat3dProject(double principalPointRow, double principalPointCol, double focus)

Beschreibung

hom_mat3d_projecthom_mat3d_projectHomMat3dProjectHomMat3dProjectHomMat3dProject berechnet aus der homogenen 3x4 Transformationsmatrix HomMat3DHomMat3DHomMat3DHomMat3DhomMat3D, die eine affine Transformation im 3D beschreibt, eine homogene projektive Transformationsmatrix, die dazu verwendet werden kann, eine Ebene, insbesondere eine Ebene, die ein Bild enthält, zu projizieren. Die projektive Transformationsmatrix beschreibt eine projektive Transformation zwischen zwei (zweidimensionalen) Ebenen.

Dies kann zur Erzeugung von perspektivischen Verzerrungen genutzt werden, welche durch die Projektion einer Ebene entstehen, die um eine andere Achse als die z-Achse gedreht ist. Im Normalfall werden projektive Transformationen aber aus Punktkorrespondenzen ermittelt (siehe vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2dVectorToProjHomMat2d, hom_vector_to_proj_hom_mat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2d und proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansac).

Matrizen zur Drehung, Skalierung oder Verschiebung können mit Hilfe der Operatoren hom_mat3d_identityhom_mat3d_identityHomMat3dIdentityHomMat3dIdentityHomMat3dIdentity, hom_mat3d_scalehom_mat3d_scaleHomMat3dScaleHomMat3dScaleHomMat3dScale, hom_mat3d_rotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotateHomMat3dRotate, hom_mat3d_translatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslateHomMat3dTranslate und pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dPoseToHomMat3d konstruiert werden.

Dabei ist zu beachten, dass bei den 3D-Transformationen die x-Achse der Spaltenachse und die y-Achse der Zeilenachse entspricht (siehe auch Kalibrierung), während bei projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImage in HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D die erste Zeile der Zeilenachse und die zweite Zeile der Transformation der Spaltenachse des Bildes entspricht.

Der Punkt (PrincipalPointRowPrincipalPointRowPrincipalPointRowPrincipalPointRowprincipalPointRow, PrincipalPointColPrincipalPointColPrincipalPointColPrincipalPointColprincipalPointCol) ist dabei das optische Zentrum der Projektion und der Punkt (PrincipalPointRowPrincipalPointRowPrincipalPointRowPrincipalPointRowprincipalPointRow, PrincipalPointColPrincipalPointColPrincipalPointColPrincipalPointColprincipalPointCol, 0) im Dreidimensionalen somit der virtuelle Standpunkt der Kamera. Die Blickrichtung entspricht der positiven z-Achse.

In diesem virtuellen Raum befindet sich die Ebene des Eingabebildes, ebenso wie die Bildebene der Projektion, an der Stelle z=FocusFocusFocusFocusfocus, also FocusFocusFocusFocusfocus Pixel von der Kamera entfernt. Dies führt dazu, dass die Verwendung der identischen Abbildung als Eingabematrix HomMat3DHomMat3DHomMat3DHomMat3DhomMat3D eine Matrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D ergibt, die ebenfalls die identische Abbildung im Zweidimensionalen darstellt.

Der Parameter FocusFocusFocusFocusfocus ist also die „Brennweite“ der verwendeten virtuellen Kamera und in der Einheit Pixel angegeben. Durch ihn kann der Grad der perspektivischen Verzerrungen verändert werden. Dieselbe Eingabematrix HomMat3DHomMat3DHomMat3DHomMat3DhomMat3D führt bei großer Brennweite zu schwächeren Verzerrungen als bei kleiner Brennweite.

Sei H die affine 3D-Matrix mit Elementen , (r,c)=(PrincipalPointRowPrincipalPointRowPrincipalPointRowPrincipalPointRowprincipalPointRow,PrincipalPointColPrincipalPointColPrincipalPointColPrincipalPointColprincipalPointCol) und f=FocusFocusFocusFocusfocus.

Dann wird die projektive Transformationsmatrix wie folgt berechnet: Zunächst wird eine 3x4 Projektionsmatrix berechnet als:

Da das Bild einer Ebene, in der die Punkte die Form (x, y, f, 1)^T haben, berechnet werden soll, werden die letzten zwei Spalten von Q zusammengefasst:

Zuletzt werden die Spalten und Zeilen von R so vertauscht, dass die erste Zeile von P der Transformation der Zeilenkoordinaten und die zweite Zeile von P der Transformation der Spaltenkoordinaten entspricht, so dass P direkt in projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImage verwendet werden kann:

Insgesamt ergibt sich also:

Ausführungsinformationen

Parameter

HomMat3DHomMat3DHomMat3DHomMat3DhomMat3D (input_control)  hom_mat3d HHomMat3D, HTupleHTupleHtuple (real) (double) (double) (double)

3×4 3D-Transformationsmatrix.

PrincipalPointRowPrincipalPointRowPrincipalPointRowPrincipalPointRowprincipalPointRow (input_control)  point.y HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Zeilenkoordinate des Hauptpunktes.

Defaultwert: 256

Wertevorschläge: 16, 32, 64, 128, 240, 256, 512

PrincipalPointColPrincipalPointColPrincipalPointColPrincipalPointColprincipalPointCol (input_control)  point.x HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Spaltenkoordinate des Hauptpunktes.

Defaultwert: 256

Wertevorschläge: 16, 32, 64, 128, 256, 320, 512

FocusFocusFocusFocusfocus (input_control)  number HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Brennweite in Pixeln.

Defaultwert: 256

Wertevorschläge: 1, 2, 5, 256, 32768

HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D (output_control)  hom_mat2d HHomMat2D, HTupleHTupleHtuple (real) (double) (double) (double)

Homogene projektive Transformationsmatrix.

Vorgänger

hom_mat3d_identityhom_mat3d_identityHomMat3dIdentityHomMat3dIdentityHomMat3dIdentity, hom_mat3d_rotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotateHomMat3dRotate, hom_mat3d_translatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslateHomMat3dTranslate, hom_mat3d_scalehom_mat3d_scaleHomMat3dScaleHomMat3dScaleHomMat3dScale

Nachfolger

projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImage, projective_trans_point_2dprojective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2dProjectiveTransPoint2d, projective_trans_regionprojective_trans_regionProjectiveTransRegionProjectiveTransRegionProjectiveTransRegion, projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldProjectiveTransContourXld, hom_mat2d_inverthom_mat2d_invertHomMat2dInvertHomMat2dInvertHomMat2dInvert

Modul

Foundation