Opencv-Python(3)-图片-resize 、cropping
import cv2
import numpy as np
'''
基本功能
resize and cropping
'''
img = cv2.imread("Resources/1.png")
print(img.shape)
imgResize=cv2.resize(img,(1000,500))
print(imgResize.shape)
imgCropped=img[0:200,200:500]
cv2.imshow("Image",img)
cv2.imshow("Image Resize",imgResize)
cv2.imshow("Image Cropped",imgCropped)
cv2.waitKey(0)

浙公网安备 33010602011771号