def crop_center(img, crop_x, crop_y):
    """
    Crops image from center to new size

    Args:
        img: input image
        width: width of cropped image
        height: height of cropped image
    Returns:
        Cropped image
    """

    height, width = img.shape
    startx = width // 2 - (crop_y // 2)
    starty = height // 2 - (crop_x // 2)

    return img[starty:starty + crop_x, startx:startx + crop_y]