contrib.image.transform

tf.contrib.image.transform

tf.contrib.image.transform

transform(
    images,
    transforms,
    interpolation='NEAREST'
)

Defined in tensorflow/contrib/image/python/ops/image_ops.py.

Applies the given transform(s) to the image(s).

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).
  • 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. interpolation: Interpolation mode. Supported values: "NEAREST", "BILINEAR".

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.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/image/transform

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部