util.py 229 字节
Newer Older
C
chenjian 已提交
1 2 3 4 5 6 7 8 9 10
import base64
import cv2
import numpy as np


def base64_to_cv2(b64str):
    data = base64.b64decode(b64str.encode('utf8'))
    data = np.fromstring(data, np.uint8)
    data = cv2.imdecode(data, cv2.IMREAD_COLOR)
    return data