scipy.spatial.transform.RigidTransform.
as_matrix#
- RigidTransform.as_matrix(self)#
Gibt eine Kopie der Matrixdarstellung der Transformation zurück.
4x4 Starrkörpertransformationsmatrizen haben die Form
[R | t] [0 | 1]
wobei
Reine 3x3 orthonormale Rotationsmatrix undtein 3x1 Translationsvektor[tx, ty, tz]ist.- Rückgabe:
- matrixnumpy.ndarray, shape (4, 4) oder (N, 4, 4)
Eine einzelne Transformationsmatrix oder ein Stapel von Transformationsmatrizen.
Beispiele
>>> from scipy.spatial.transform import RigidTransform as Tf >>> from scipy.spatial.transform import Rotation as R >>> import numpy as np
Eine Transformationsmatrix ist eine 4x4-Matrix, die aus einer 3x3-Rotationsmatrix und einem 3x1-Translationsvektor gebildet wird.
>>> t = np.array([2, 3, 4]) >>> r = R.from_matrix([[0, 0, 1], ... [1, 0, 0], ... [0, 1, 0]]) >>> tf = Tf.from_components(t, r) >>> tf.as_matrix() array([[ 0., 0., 1., 2.], [ 1., 0., 0., 3.], [ 0., 1., 0., 4.], [ 0., 0., 0., 1.]])
>>> Tf.identity(2).as_matrix() array([[[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]], [[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]])