Python Image Crop Code

import cv2
from PIL import Image

img = Image.open(‘lady.jpg’)
area=(100,100,600,600)
cropped_img=img.crop(area)

 

#cv2로 읽어야 함

#h, w, c = im.shape

#print(‘width: ‘, w)

#print(‘height: ‘, h)

#print(‘channel:’, c)

img.show()
cropped_img.show()

댓글 달기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

위로 스크롤