mmocr.utils.rescale_polygon¶
- mmocr.utils.rescale_polygon(polygon, scale_factor, mode='mul')[源代码]¶
Rescale a polygon according to scale_factor.
The behavior is different depending on the mode. When mode is ‘mul’, the coordinates will be multiplied by scale_factor, which is usually used in preprocessing transforms such as
Resize()
. The coordinates will be divided by scale_factor if mode is ‘div’. It can be used in postprocessors to recover the polygon in the original image size.