Shear
If you have ever worked on a Computer Vision project, you might know that using augmentations to diversify the dataset is the best practice. On this page, we will:
Сover the Shear augmentation;
Check out its parameters;
See how Shear affects an image;
And check out how to work with Shear using Python through the Albumentations library.
Let’s jump in.
Shear explained
To define the term, Shear is a geometric augmentation that changes a form of an image along a specific axis to create a different perception angle.
![](https://wiki.cloudfactory.com/media/pages/docs/mp-wiki/augmentations/shear/08a332870e-1684131978/snimok-ekrana-2022-07-11-v-16.16.20.webp)
As you can see in the picture above, Shear moves a side of an image, transforming its initial form of a square into a trapezoid. Shears are applied sequentially if you want to shear your image along the x- and y-axis. Data Scientists use Shear to augment pictures in such a way that an algorithm can identify an object from multiple angles.
Parameters
- Shear in degrees - specifies the range of degrees that is used to sample x- and y-shear angle values;
- Probability of applying transform - defines the likelihood of applying Shear to an image.
Shear visualized
![](https://wiki.cloudfactory.com/media/pages/docs/mp-wiki/augmentations/shear/5137ea88a0-1684131978/snimok-ekrana-2022-07-11-v-16.18.43.webp)
![](https://wiki.cloudfactory.com/media/pages/docs/mp-wiki/augmentations/shear/6189958c8b-1684131978/snimok-ekrana-2022-07-11-v-16.19.25.webp)