def make_image(self, image_path):
img = cv2.imread(image_path, 0)
if img is None:
print "Image not found at '{}'".format(image_path)
return
img = cv2.resize(img, (self.width, self.height), interpolation=cv2.INTER_CUBIC)
_, img = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY_INV)
self.img = np.clip(img, -1, 100)
评论列表
文章目录