TextRecogGeneralAug¶
- class mmocr.datasets.transforms.TextRecogGeneralAug[源代码]¶
A general geometric augmentation tool for text images in the CVPR 2020 paper “Learn to Augment: Joint Data Augmentation and Network Optimization for Text Recognition”. It applies distortion, stretching, and perspective transforms to an image.
This implementation is adapted from https://github.com/RubanSeven/Text-Image-Augmentation-python/blob/master/augment.py # noqa
TODO: Split this transform into three transforms.
Required Keys:
img
Modified Keys:
img
img_shape
- tia_distort(img, segment=4)[源代码]¶
Image distortion.
- 参数
img (np.ndarray) – The image.
segment (int) – The number of segments to divide the image along the width. Defaults to 4.
- 返回类型
- tia_perspective(img)[源代码]¶
Image perspective transformation.
- 参数
img (np.ndarray) – The image.
segment (int) – The number of segments to divide the image along the width. Defaults to 4.
- 返回类型
- tia_stretch(img, segment=4)[源代码]¶
Image stretching.
- 参数
img (np.ndarray) – The image.
segment (int) – The number of segments to divide the image along the width. Defaults to 4.
- 返回类型