ImageContainer.crop_center

ImageContainer.crop_center#

ImageContainer.crop_center(y, x, radius, **kwargs)[source]#

Extract a circular crop.

The extracted crop will have shape (radius[0] * 2 + 1, radius[1] * 2 + 1).

Parameters:
y int | float

Coordinate of the crop along the height dimension in the pixel space. If a float, it specifies the relative position and must be in [0, 1].

x int | float

Coordinate of the crop along the width dimension in the pixel space. If a float, it specifies the relative position and must be in [0, 1].

radius int | float | tuple[int | float, int | float]

Radius along the height and width dimensions, respectively.

kwargs Any

Keyword arguments for crop_corner().

Returns:

ImageContainer – The cropped image of size size * scale.