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=1,
col_axis=2,
channel_axis=0,
fill_mode='nearest',
cval=0.0,
order=1
)
Args |
x
|
3D numpy array - a 2D image with one or more channels.
|
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 (aka Y axis) in the input
image. Direction: left to right.
|
col_axis
|
Index of axis for columns (aka X axis) in the input
image. Direction: top to bottom.
|
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.
|
Raises |
ImportError
|
if SciPy is not available.
|
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. Some content is licensed under the numpy license.
Last updated 2024-01-23 UTC.
[null,null,["Last updated 2024-01-23 UTC."],[],[],null,["# tf.keras.preprocessing.image.apply_affine_transform\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v2.15.0/keras/preprocessing/image.py#L2482-L2623) |\n\nApplies an affine transformation specified by the parameters given. \n\n tf.keras.preprocessing.image.apply_affine_transform(\n x,\n theta=0,\n tx=0,\n ty=0,\n shear=0,\n zx=1,\n zy=1,\n row_axis=1,\n col_axis=2,\n channel_axis=0,\n fill_mode='nearest',\n cval=0.0,\n order=1\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `x` | 3D numpy array - a 2D image with one or more channels. |\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 (aka Y axis) in the input image. Direction: left to right. |\n| `col_axis` | Index of axis for columns (aka X axis) in the input image. Direction: top to bottom. |\n| `channel_axis` | Index of axis for channels in the input image. |\n| `fill_mode` | Points outside the boundaries of the input are filled according to the given mode (one of `{'constant', 'nearest', 'reflect', 'wrap'}`). |\n| `cval` | Value used for points outside the boundaries of the input if `mode='constant'`. |\n| `order` | int, order of interpolation |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The transformed version of the input. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|---------------|----------------------------|\n| `ImportError` | if SciPy is not available. |\n\n\u003cbr /\u003e"]]