def _feature(image):
"""
It's faster but still accurate enough with DSIZE = 14.
~0.9983 precision and recall
:param image:
:return: raw pixels as feature vector
"""
image = cv2.resize(image, None, fx=DSIZE/28, fy=DSIZE/28,
interpolation=cv2.INTER_LINEAR)
ret = image.astype(np.float32) / 255
return ret.ravel()
评论列表
文章目录