opencv轉換base64
image = cv2.imencode('.jpg', frame)[1]
imgbase64 = str(base64.b64encode(image))[2:-1]
base64轉換opencv
img_b64decode = base64.b64decode(base64data) # base64解碼
img_array = np.frombuffer(img_b64decode, np.uint8) # 轉換np序列
img = cv2.imdecode(img_array, cv2.COLOR_BGR2RGB) # 轉換Opencv格式