tf.keras.preprocessing.image.apply_affine_transform
Stay organized with collections
Save and categorize content based on your preferences.
Applies an affine transformation specified by the parameters given.
tf.keras.preprocessing.image.apply_affine_transform(
x, theta=0, tx=0, ty=0, shear=0, zx=1, zy=1, row_axis=0, col_axis=1,
channel_axis=2, fill_mode='nearest', cval=0.0, order=1
)
Arguments
x: 2D numpy array, single image.
theta: Rotation angle in degrees.
tx: Width shift.
ty: Heigh shift.
shear: Shear angle in degrees.
zx: Zoom in x direction.
zy: Zoom in y direction
row_axis: Index of axis for rows in the input image.
col_axis: Index of axis for columns in the input image.
channel_axis: Index of axis for channels in the input image.
fill_mode: Points outside the boundaries of the input
are filled according to the given mode
(one of `{'constant', 'nearest', 'reflect', 'wrap'}`).
cval: Value used for points outside the boundaries
of the input if `mode='constant'`.
order: int, order of interpolation
Returns
The transformed version of the input.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.preprocessing.image.apply_affine_transform\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/preprocessing/image/apply_affine_transform) |\n\nApplies an affine transformation specified by the parameters given.\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.keras.preprocessing.image.apply_affine_transform`](/api_docs/python/tf/keras/preprocessing/image/apply_affine_transform)\n\n\u003cbr /\u003e\n\n tf.keras.preprocessing.image.apply_affine_transform(\n x, theta=0, tx=0, ty=0, shear=0, zx=1, zy=1, row_axis=0, col_axis=1,\n channel_axis=2, fill_mode='nearest', cval=0.0, order=1\n )\n\nArguments\n=========\n\n x: 2D numpy array, single image.\n theta: Rotation angle in degrees.\n tx: Width shift.\n ty: Heigh shift.\n shear: Shear angle in degrees.\n zx: Zoom in x direction.\n zy: Zoom in y direction\n row_axis: Index of axis for rows in the input image.\n col_axis: Index of axis for columns in the input image.\n channel_axis: Index of axis for channels in the input image.\n fill_mode: Points outside the boundaries of the input\n are filled according to the given mode\n (one of `{'constant', 'nearest', 'reflect', 'wrap'}`).\n cval: Value used for points outside the boundaries\n of the input if `mode='constant'`.\n order: int, order of interpolation\n\nReturns\n=======\n\n The transformed version of the input."]]