tf.image.rot90
Stay organized with collections
Save and categorize content based on your preferences.
Rotate image(s) counter-clockwise by 90 degrees.
tf.image.rot90(
image, k=1, name=None
)
For example:
a=tf.constant([[[1],[2]],[[3],[4]]])
# rotating `a` counter clockwise by 90 degrees
a_rot=tf.image.rot90(a,k=1) #rotated `a`
print(a_rot) # [[[2],[4]],[[1],[3]]]
Args:
image: 4-D Tensor of shape [batch, height, width, channels]
or 3-D Tensor
of shape [height, width, channels]
.
k: A scalar integer. The number of times the image is rotated by 90 degrees.
name: A name for this operation (optional).
Returns |
A rotated tensor of the same type and shape as image .
|
Raises |
ValueError
|
if the shape of image not supported.
|
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.image.rot90\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/image/rot90) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/image_ops_impl.py#L484-L521) |\n\nRotate image(s) counter-clockwise by 90 degrees.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.image.rot90`](/api_docs/python/tf/image/rot90), \\`tf.compat.v2.image.rot90\\`\n\n\u003cbr /\u003e\n\n tf.image.rot90(\n image, k=1, name=None\n )\n\n#### For example:\n\n a=tf.constant([[[1],[2]],[[3],[4]]])\n # rotating `a` counter clockwise by 90 degrees\n a_rot=tf.image.rot90(a,k=1) #rotated `a`\n print(a_rot) # [[[2],[4]],[[1],[3]]]\n\nArgs:\nimage: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor\nof shape `[height, width, channels]`.\nk: A scalar integer. The number of times the image is rotated by 90 degrees.\nname: A name for this operation (optional).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A rotated tensor of the same type and shape as `image`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|----------------------------------------|\n| `ValueError` | if the shape of `image` not supported. |\n\n\u003cbr /\u003e"]]