Skip to main content

centercrop

centercrop(img: np.ndarray) -> np.ndarray

  • Description: Performs center cropping on the input image.

  • Parameters:

    • img (np.ndarray): The input image to be center cropped.
  • Returns:

    • np.ndarray: The cropped image.
  • Example:

    import docsaidkit as D

    img = D.imread('lena.png')
    img = D.imresize(img, [128, 256])
    crop_img = D.centercrop(img)

    The green box indicates the center cropped area.

    centercrop