import cv2
#img is your image as array
#size of the new image
height = 500
width = 500
img_resized = cv2.resize(img, (width, height))
import cv2
import numpy as np
img = cv2.imread('your_image.jpg')
res = cv2.resize(img, dsize=(54, 140), interpolation=cv2.INTER_CUBIC)
# welcome to softhunt.net
# importing the python module numpy
import numpy as np
# Making a random array
softhunt = np.array([0, 1, 3, 5, 7, 9, 11, 13, 15])
# Reshape the array permanently
softhunt.resize(3, 3)
print(softhunt)