imghelp.crop

Module Contents

Functions

Crop(image, width, height)

This function crops image based on the input width and height.

imghelp.crop.Crop(image, width, height)[source]
This function crops image based on the input width and height.
imagenumpy.ndarray

An image, which is represented as a 3D numpy array in python

widthint

The desired width of the output image

heightint

The desired height of the output image

numpy array : croped image as 3D array Examples ——- >>> import matplotlib.pyplot as plt >>> from img.Crop import Crop >>> image = plt.imread(‘../test_img/ubc.jpeg’) >>> plt.imshow(image) #show the image >>> img_crop = Crop(image, 300, 300) >>> plt.imshow(img_comp) #show the cropped image