HomogeneousTransformation

class HomogeneousTransformation(matrix: ndarray[4, 4])

A HomogeneousTransformation is a 4x4 matrix-based transformation that that can encode a change of basis, translation, and projective warp.

It gets applied to vectors v = (x, y, z) by converting them to a homogeneous vector h = (x, y, z, 1), computing h' = M * h, and returning v' = h'[:-1] / h'[-1].

Parameters:

matrix – The 4x4 homogeneous matrix M of this transformation.

Methods

apply

Apply this HomogeneousTransformation to a vector.

compute

Compute all HomogeneousTransformation transformations that might embed query in target.

inverse

The inverse HomogeneousTransformation of this one.

__matmul__(other: Transformation) Transformation

Composes this transformation with another, applying the other first.

apply(vector: ndarray[3]) ndarray[3]

Apply this HomogeneousTransformation to a vector.

classmethod compute(query: Shape, target: Shape, parameters: ShapeQueryParameters = ShapeQueryParameters(direct=True, indirect=True, indet_scale=1.0, indet_angle=0.0, indet_fit_max=False, indet_fit_uniform_scale=True)) List[HomogeneousTransformation]

Compute all HomogeneousTransformation transformations that might embed query in target.

Parameters:
  • query – The shape to embed in target.

  • target – The shape to embed query in.

  • parameters – The parameters used to calculate the transformations.

Returns:

The list of all transformations t such that t @ query <= target and isinstance(t, HomogeneousTransformation).

inverse()

The inverse HomogeneousTransformation of this one.