问题描述: cv2中的 imread是个只能读取本地图片的函数 cv2.imread('1.png', 0) 有时候我们不想把图片存下来再读取, 很麻烦 如果能将请求下来的base64或字节直接读取就完美了 解决方案: target_bytes = base64.b64decode(b64str) image = np.asarray(bytearray(target_bytes), dtype="uint8") target = cv2.imdecode(image,0)