imgviz.centerize

imgviz.centerize(src, shape, cval=None, return_mask=False, interpolation='linear', loc='center')[source]

Centerize image for specified image size

Parameters:
  • src (numpy.ndarray) – Image to centerize

  • shape (tuple of int) – Image shape (height, width) or (height, width, channel)

  • cval (int or float or numpy.ndarray) – Color to be filled in the blank.

  • return_mask (numpy.ndarray) – Mask for centerized image.

  • interpolation (str) – Interpolation method (default: ‘linear’).

  • loc (str) – Location of image (‘center’, ‘lt’, ‘rb’). (default: ‘center’)

Returns:

dst – Centerized image.

Return type:

numpy.ndarray