tf.raw_ops.ImageProjectiveTransformV2  |  TensorFlow v2.16.1 (original) (raw)

tf.raw_ops.ImageProjectiveTransformV2

Stay organized with collections Save and categorize content based on your preferences.

Applies the given transform to each of the images.

View aliases

Compat aliases for migration

SeeMigration guide for more details.

tf.compat.v1.raw_ops.ImageProjectiveTransformV2

tf.raw_ops.ImageProjectiveTransformV2(
    images,
    transforms,
    output_shape,
    interpolation,
    fill_mode='CONSTANT',
    name=None
)

If one row of transforms is [a0, a1, a2, b0, b1, b2, c0, c1], then it maps the output point (x, y) to a transformed input point(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k), wherek = c0 x + c1 y + 1. If the transformed point lays outside of the input image, the output pixel is set to 0.

Args
images A Tensor. Must be one of the following types: uint8, int32, int64, half, bfloat16, float32, float64. 4-D with shape [batch, height, width, channels].
transforms A Tensor of type float32. 2-D Tensor, [batch, 8] or [1, 8] matrix, where each row corresponds to a 3 x 3 projective transformation matrix, with the last entry assumed to be 1. If there is one row, the same transformation will be applied to all images.
output_shape A Tensor of type int32. 1-D Tensor [new_height, new_width].
interpolation A string. Interpolation method, "NEAREST" or "BILINEAR".
fill_mode An optional string. Defaults to "CONSTANT". Fill mode, "REFLECT", "WRAP", or "CONSTANT".
name A name for the operation (optional).
Returns
A Tensor. Has the same type as images.