|
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE (_Scalar, _Dim==Dynamic ? Dynamic :(_Dim+1) *(_Dim+1)) enum |
|
EIGEN_DEVICE_FUNC | Transform () |
|
EIGEN_DEVICE_FUNC | Transform (const TranslationType &t) |
|
EIGEN_DEVICE_FUNC | Transform (const UniformScaling< Scalar > &s) |
|
template<typename Derived > |
EIGEN_DEVICE_FUNC | Transform (const RotationBase< Derived, Dim > &r) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC | Transform (const EigenBase< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | operator= (const EigenBase< OtherDerived > &other) |
|
template<int OtherOptions> |
EIGEN_DEVICE_FUNC | Transform (const Transform< Scalar, Dim, Mode, OtherOptions > &other) |
|
template<int OtherMode, int OtherOptions> |
EIGEN_DEVICE_FUNC | Transform (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC | Transform (const ReturnByValue< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | operator= (const ReturnByValue< OtherDerived > &other) |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC Scalar | operator() (Index row, Index col) const |
|
EIGEN_DEVICE_FUNC Scalar & | operator() (Index row, Index col) |
|
EIGEN_DEVICE_FUNC const MatrixType & | matrix () const |
|
EIGEN_DEVICE_FUNC MatrixType & | matrix () |
|
EIGEN_DEVICE_FUNC ConstLinearPart | linear () const |
|
EIGEN_DEVICE_FUNC LinearPart | linear () |
|
EIGEN_DEVICE_FUNC ConstAffinePart | affine () const |
|
EIGEN_DEVICE_FUNC AffinePart | affine () |
|
EIGEN_DEVICE_FUNC ConstTranslationPart | translation () const |
|
EIGEN_DEVICE_FUNC TranslationPart | translation () |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::transform_right_product_impl< Transform, OtherDerived >::ResultType | operator* (const EigenBase< OtherDerived > &other) const |
|
template<typename DiagonalDerived > |
EIGEN_DEVICE_FUNC const TransformTimeDiagonalReturnType | operator* (const DiagonalBase< DiagonalDerived > &b) const |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | operator*= (const EigenBase< OtherDerived > &other) |
|
EIGEN_DEVICE_FUNC const Transform | operator* (const Transform &other) const |
|
template<int OtherMode, int OtherOptions> |
EIGEN_DEVICE_FUNC internal::transform_transform_product_impl< Transform, Transform< Scalar, Dim, OtherMode, OtherOptions > >::ResultType | operator* (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other) const |
|
EIGEN_DEVICE_FUNC void | setIdentity () |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | scale (const MatrixBase< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | prescale (const MatrixBase< OtherDerived > &other) |
|
EIGEN_DEVICE_FUNC Transform & | scale (const Scalar &s) |
|
EIGEN_DEVICE_FUNC Transform & | prescale (const Scalar &s) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | translate (const MatrixBase< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform & | pretranslate (const MatrixBase< OtherDerived > &other) |
|
template<typename RotationType > |
EIGEN_DEVICE_FUNC Transform & | rotate (const RotationType &rotation) |
|
template<typename RotationType > |
EIGEN_DEVICE_FUNC Transform & | prerotate (const RotationType &rotation) |
|
EIGEN_DEVICE_FUNC Transform & | shear (const Scalar &sx, const Scalar &sy) |
|
EIGEN_DEVICE_FUNC Transform & | preshear (const Scalar &sx, const Scalar &sy) |
|
EIGEN_DEVICE_FUNC Transform & | operator= (const TranslationType &t) |
|
EIGEN_DEVICE_FUNC Transform & | operator*= (const TranslationType &t) |
|
EIGEN_DEVICE_FUNC Transform | operator* (const TranslationType &t) const |
|
EIGEN_DEVICE_FUNC Transform & | operator= (const UniformScaling< Scalar > &t) |
|
EIGEN_DEVICE_FUNC Transform & | operator*= (const UniformScaling< Scalar > &s) |
|
EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType | operator* (const UniformScaling< Scalar > &s) const |
|
EIGEN_DEVICE_FUNC Transform & | operator*= (const DiagonalMatrix< Scalar, Dim > &s) |
|
template<typename Derived > |
EIGEN_DEVICE_FUNC Transform & | operator= (const RotationBase< Derived, Dim > &r) |
|
template<typename Derived > |
EIGEN_DEVICE_FUNC Transform & | operator*= (const RotationBase< Derived, Dim > &r) |
|
template<typename Derived > |
EIGEN_DEVICE_FUNC Transform | operator* (const RotationBase< Derived, Dim > &r) const |
|
EIGEN_DEVICE_FUNC RotationReturnType | rotation () const |
|
template<typename RotationMatrixType , typename ScalingMatrixType > |
EIGEN_DEVICE_FUNC void | computeRotationScaling (RotationMatrixType *rotation, ScalingMatrixType *scaling) const |
|
template<typename ScalingMatrixType , typename RotationMatrixType > |
EIGEN_DEVICE_FUNC void | computeScalingRotation (ScalingMatrixType *scaling, RotationMatrixType *rotation) const |
|
template<typename PositionDerived , typename OrientationType , typename ScaleDerived > |
EIGEN_DEVICE_FUNC Transform & | fromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale) |
|
EIGEN_DEVICE_FUNC Transform | inverse (TransformTraits traits=(TransformTraits) Mode) const |
|
EIGEN_DEVICE_FUNC const Scalar * | data () const |
|
EIGEN_DEVICE_FUNC Scalar * | data () |
|
template<typename NewScalarType > |
EIGEN_DEVICE_FUNC internal::cast_return_type< Transform, Transform< NewScalarType, Dim, Mode, Options > >::type | cast () const |
|
template<typename OtherScalarType > |
EIGEN_DEVICE_FUNC | Transform (const Transform< OtherScalarType, Dim, Mode, Options > &other) |
|
EIGEN_DEVICE_FUNC bool | isApprox (const Transform &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const |
|
EIGEN_DEVICE_FUNC void | makeAffine () |
|
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > | linearExt () |
|
EIGEN_DEVICE_FUNC const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > | linearExt () const |
|
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > | translationExt () |
|
EIGEN_DEVICE_FUNC const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > | translationExt () const |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | scale (const MatrixBase< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | prescale (const MatrixBase< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | translate (const MatrixBase< OtherDerived > &other) |
|
template<typename OtherDerived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | pretranslate (const MatrixBase< OtherDerived > &other) |
|
template<typename RotationType > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | rotate (const RotationType &rotation) |
|
template<typename RotationType > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | prerotate (const RotationType &rotation) |
|
template<typename Derived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | operator= (const RotationBase< Derived, Dim > &r) |
|
template<typename Derived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > | operator* (const RotationBase< Derived, Dim > &r) const |
|
template<typename PositionDerived , typename OrientationType , typename ScaleDerived > |
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & | fromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale) |
|
template<typename _Scalar, int _Dim, int _Mode, int _Options>
class Eigen::Transform< _Scalar, _Dim, _Mode, _Options >
Represents an homogeneous transformation in a N dimensional space.
\geometry_module
- Template Parameters
-
_Scalar | the scalar type, i.e., the type of the coefficients |
_Dim | the dimension of the space |
_Mode | the type of the transformation. Can be:
- Affine: the transformation is stored as a (Dim+1)^2 matrix, where the last row is assumed to be [0 ... 0 1].
- AffineCompact: the transformation is stored as a (Dim)x(Dim+1) matrix.
- Projective: the transformation is stored as a (Dim+1)^2 matrix without any assumption.
- Isometry: same as Affine with the additional assumption that the linear part represents a rotation. This assumption is exploited to speed up some functions such as inverse() and rotation().
|
_Options | has the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor. These Options are passed directly to the underlying matrix type. |
The homography is internally represented and stored by a matrix which is available through the matrix() method. To understand the behavior of this class you have to think a Transform object as its internal matrix representation. The chosen convention is right multiply:
Therefore, an affine transformation matrix M is shaped like this:

Note that for a projective transformation the last row can be anything, and then the interpretation of different parts might be slightly different.
However, unlike a plain matrix, the Transform class provides many features simplifying both its assembly and usage. In particular, it can be composed with any other transformations (Transform,Translation,RotationBase,DiagonalMatrix) and can be directly used to transform implicit homogeneous vectors. All these operations are handled via the operator*. For the composition of transformations, its principle consists to first convert the right/left hand sides of the product to a compatible (Dim+1)^2 matrix and then perform a pure matrix product. Of course, internally, operator* tries to perform the minimal number of operations according to the nature of each terms. Likewise, when applying the transform to points, the latters are automatically promoted to homogeneous vectors before doing the matrix product. The conventions to homogeneous representations are performed as follow:
Translation t (Dim)x(1): 
Rotation R (Dim)x(Dim): 
Scaling DiagonalMatrix S (Dim)x(Dim): 
Column point v (Dim)x(1): 
Set of column points V1...Vn (Dim)x(n): 
The concatenation of a Transform object with any kind of other transformation always returns a Transform object.
A little exception to the "as pure matrix product" rule is the case of the transformation of non homogeneous vectors by an affine transformation. In that case the last matrix row can be ignored, and the product returns non homogeneous vectors.
Since, for instance, a Dim x Dim matrix is interpreted as a linear transformation, it is not possible to directly transform Dim vectors stored in a Dim x Dim matrix. The solution is either to use a Dim x Dynamic matrix or explicitly request a vector transformation by making the vector homogeneous:
m' = T * m.colwise().homogeneous();
Note that there is zero overhead.
Conversion methods from/to Qt's QMatrix and QTransform are available if the preprocessor token EIGEN_QT_SUPPORT is defined.
This class can be extended with the help of the plugin mechanism described on the page TopicCustomizing_Plugins by defining the preprocessor symbol EIGEN_TRANSFORM_PLUGIN
.
- See also
- class Matrix, class Quaternion