i'm trying to get an image from a string message sended by a socket, so the message before sending it, it has been decoded in base64. Now in my python server i am using this instruction to convert the string image to a real image in order to give it like an argument in cv2.imwrite() and cv2.imshow()
image = np.fromstring(string_image, np.uint8)
cv2.imwrite("image.png", image)
cv2.imshow("image", image)
the code like that gives me an image but not the same as it supposed to be, i mean by that is like i got a gray image with orizontal edges only and nothing else. and if i add the follow instruction between the np.fromstring and cv2.imwrite :
image = cv2.imdecode(image, cv2.IMREAD_COLOR)
i got the empty image error. What should i add or change in my code to get the real image ?