DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
_fromstring_ = np.fromstring(img, np.uint8)
在做图像base64与numpy array(cv2传统格式)之间的转换测试的时候出现了以上提示,将原np.fromstring函数更新为np.frombuffer即可,如下
#_fromstring_ = np.fromstring(img, np.uint8)
_fromstring_ = np.frombuffer(img, np.uint8)
colorImage = cv2.imdecode(_fromstring_, cv2.IMREAD_COLOR)
print("minDist: ", minDist)
cv2.namedWindow('show image', cv2.WINDOW_NORMAL)
cv2.imshow('show image', colorImage)
cv2.waitKey(30)