random 1 썸네일형 리스트형 [이미지] Numpy로 이미지를 224x224 크기로 crop 하기 [Python]-cv2 from matplotlib import pyplot as plt import numpy as np import random import cv2 org_img = cv2.imread"./cat2.png"[:,:,::-1] plt.imshoworg_img plt.titlef"original image" plt.show def croppingimg: height, width = img.shape[:2] plt.figurefigsize=(10,5) for i in range10: # 가로, 세로의 crop할 시작점 crop_s_h = random.randint0, height-224 crop_s_w = random.randint0, width-224 # 시작점부터 가로, 세로가.. 이전 1 다음