Shear

class CVAugmentor.assets.augmentations._shear.Shear(shear: tuple[int | float, int | float] | None = None)

Shear an image along the x-axis and/or y-axis. The shearing means that the image is slanted along the axis.

Usage

The class instance must be called.

__init__(shear: tuple[int | float, int | float] | None = None) None

Constructor of the Shear class.

Parameters:

shear (tuple, optional) – Shear values for x and y axes. The default value is None. If None, random shear values are generated.

Return type:

None.

_shear(image: Image) Image

The shearing operation.

Parameters:

image (Image.Image) – The image to be augmented.

Returns:

sheared_image – The sheared image.

Return type:

Image.Image