def load(self):
if self.path is None:
print "Current path is empty!"
print "Please set one!"
else:
try:
# Return a 3-channel color image
self.image = cv2.imread(self.path)
# cv2.imshow('f', self.image)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
except:
raise ValueError('Loading error!')
# convert RGB to HSV
self.hsv = cv2.cvtColor(self.image, cv2.COLOR_BGR2HSV)
# split image into HSV channels
self.h, self.s, self.v = cv2.split(self.hsv)
# Apply Gaussian noise and save
评论列表
文章目录