openCV图像裁剪Crop

openCV图像裁剪Crop_第1张图片

 

# 图片裁剪
import cv2
img = cv2.imread('./Figure_1.png',1)
print(img.shape)
cv2.imshow('orgin',img)

# img = cv2.resize(img,(256,256))
# cv2.imshow('resize',img)

dst = img[0:300, 0:300]   # 裁剪坐标为[y0:y1, x0:x1]
cv2.imshow('crop_post',dst)
cv2.waitKey()

你可能感兴趣的:(opencv)