tf.contrib.image.transform
Stay organized with collections
Save and categorize content based on your preferences.
Applies the given transform(s) to the image(s).
tf.contrib.image.transform(
images, transforms, interpolation='NEAREST', output_shape=None, name=None
)
Args |
images
|
A tensor of shape (num_images, num_rows, num_columns, num_channels)
(NHWC), (num_rows, num_columns, num_channels) (HWC), or
(num_rows, num_columns) (HW). The rank must be statically known (the
shape is not TensorShape(None) .
|
transforms
|
Projective transform matrix/matrices. A vector of length 8 or
tensor of size N x 8. 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) ,
where k = c0 x + c1 y + 1 . The transforms are inverted compared to
the transform mapping input points to output points. Note that gradients
are not backpropagated into transformation parameters.
|
interpolation
|
Interpolation mode. Supported values: "NEAREST", "BILINEAR".
|
output_shape
|
Output dimesion after the transform, [height, width].
If None, output is the same size as input image.
|
name
|
The name of the op.
|
Returns |
Image(s) with the same type and shape as images , with the given
transform(s) applied. Transformed coordinates outside of the input image
will be filled with zeros.
|
Raises |
TypeError
|
If image is an invalid type.
|
ValueError
|
If output shape is not 1-D int32 Tensor.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.image.transform\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/image/python/ops/image_ops.py#L222-L308) |\n\nApplies the given transform(s) to the image(s). \n\n tf.contrib.image.transform(\n images, transforms, interpolation='NEAREST', output_shape=None, name=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `images` | A tensor of shape (num_images, num_rows, num_columns, num_channels) (NHWC), (num_rows, num_columns, num_channels) (HWC), or (num_rows, num_columns) (HW). The rank must be statically known (the shape is not `TensorShape(None)`. |\n| `transforms` | Projective transform matrix/matrices. A vector of length 8 or tensor of size N x 8. 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)`, where `k = c0 x + c1 y + 1`. The transforms are *inverted* compared to the transform mapping input points to output points. Note that gradients are not backpropagated into transformation parameters. |\n| `interpolation` | Interpolation mode. Supported values: \"NEAREST\", \"BILINEAR\". |\n| `output_shape` | Output dimesion after the transform, \\[height, width\\]. If None, output is the same size as input image. |\n| `name` | The name of the op. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Image(s) with the same type and shape as `images`, with the given transform(s) applied. Transformed coordinates outside of the input image will be filled with zeros. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|------------------------------------------|\n| `TypeError` | If `image` is an invalid type. |\n| `ValueError` | If output shape is not 1-D int32 Tensor. |\n\n\u003cbr /\u003e"]]