I'm doing some processing on an image using OpenCV. Now I need to convert the base64 string to bytes. In Python-3.6 I could use base64.decodebytes but I can't find the alternate module in Python-2.7 . Is there any other alternative present in Python-2.7 ?
cvimg = cv2.imdecode(np_img_array, cv2.IMREAD_COLOR)
tmp_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = base64.b64encode(cv2.imencode('.jpg', tmp_img)[1])
img = base64.decodebytes(img)
NOTE: I'm using Python-2.7 as one of the module I'm using has not been converted to Python-3.6