TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfa.image.transform_ops.matrices_to_flat_transforms

View source on GitHub

Converts affine matrices to projective transforms.

tfa.image.transform_ops.matrices_to_flat_transforms(
    transform_matrices,
    name=None
)

Note that we expect matrices that map output coordinates to input coordinates. To convert forward transformation matrices, call tf.linalg.inv on the matrices and use the result here.

Args:

  • transform_matrices: One or more affine transformation matrices, for the reverse transformation in homogeneous coordinates. Shape (3, 3) or (N, 3, 3).
  • name: The name for the op.

Returns:

2D tensor of flat transforms with shape (N, 8), which may be passed into transform op.

Raises:

  • ValueError: If transform_matrices have an invalid shape.