def crop_lowres(self, cv_image):
self.ltob.d_img_raw_npy = np.asarray(cv_image)
if self.instance_type == 'main':
img = cv2.resize(cv_image, (0, 0), fx=1 / 16., fy=1 / 16., interpolation=cv2.INTER_AREA)
startrow = 3
startcol = 27
img = imutils.rotate_bound(img, 180)
else:
img = cv2.resize(cv_image, (0, 0), fx=1 / 15., fy=1 / 15., interpolation=cv2.INTER_AREA)
startrow = 2
startcol = 27
endcol = startcol + 64
endrow = startrow + 64
# crop image:
img = img[startrow:endrow, startcol:endcol]
assert img.shape == (64,64,3)
return img
评论列表
文章目录