def __call__(self, img):
if self.padding > <NUM_LIT:0>:<EOL><INDENT>img = data.pad(img, self.padding, mode=self.padding_mode_cv)<EOL><DEDENT>if self.pad_if_needed and img.size[<NUM_LIT:0>] < self.size[<NUM_LIT:1>]:<EOL><INDENT>img = data.pad(img, (int((<NUM_LIT:1> + self.size[<NUM_LIT:1>] - img.size[<NUM_LIT:0>]) / <NUM_LIT:2>), <NUM_LIT:0>), mode=self.padding_mode_cv)<EOL><DEDENT>if self.pad_if_needed and img.size[<NUM_LIT:1>] < self.size[<NUM_LIT:0>]:<EOL><INDENT>img = data.pad(img, (<NUM_LIT:0>, int((<NUM_LIT:1> + self.size[<NUM_LIT:0>] - img.size[<NUM_LIT:1>]) / <NUM_LIT:2>)), mode=self.padding_mode_cv)<EOL><DEDENT>i, j, h, w = self.get_params(img, self.size)<EOL>return data.crop(img, j, i, w, h)<EOL>
Args:
    img (PIL Image): Image to be cropped.

Returns:
    PIL Image: Cropped image.