Image util#

SynthTIGER Copyright (c) 2021-present NAVER Corp. MIT license

synthtiger.utils.image_util.create_image(size, color=None)#

Create an image with given size and color.

Parameters:
  • size (tuple) – The image size, as a 2-tuple (width, height)

  • color (tuple, optional) – The color of image, as a 4-tuple (RGBA)

Returns:

RGBA image

Return type:

Numpy array of float32 type

synthtiger.utils.image_util.paste_image(src, dst, quad, mode='normal')#
synthtiger.utils.image_util.erase_image(src, dst, quad)#
synthtiger.utils.image_util.blend_image(src, dst, mode='normal', mask=False)#
synthtiger.utils.image_util.resize_image(image, size)#
synthtiger.utils.image_util.fit_image(image, top=True, right=True, bottom=True, left=True)#
synthtiger.utils.image_util.crop_image(image, top=0, right=0, bottom=0, left=0)#
synthtiger.utils.image_util.pad_image(image, top=0, right=0, bottom=0, left=0, mode='constant', value=0)#
synthtiger.utils.image_util.dilate_image(image, k)#
synthtiger.utils.image_util.erode_image(image, k)#
synthtiger.utils.image_util.grayscale_image(image)#
synthtiger.utils.image_util.add_alpha_channel(image)#
synthtiger.utils.image_util.to_quad(bbox)#
synthtiger.utils.image_util.to_bbox(quad)#
synthtiger.utils.image_util.merge_quad(quads)#
synthtiger.utils.image_util.merge_bbox(bboxes)#
synthtiger.utils.image_util.to_gray(color)#
synthtiger.utils.image_util.to_rgb(gray, colorize=False)#
synthtiger.utils.image_util.color_distance(a, b)#