import cv2img = cv2.imread("1.jpg")
print(img.shape)
cropped = img[0:128, 0:512] # 裁剪坐标为[y0:y1, x0:x1]
cv2.imwrite("1c.jpg", cropped)
from PIL import Imageimg = Image.open("1.jpg")
print(img.size)
cropped = img.crop((0, 0, 512, 128)) # (left, upper, right, lower)
cropped.save("1c.jpg")
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态