I am having a numpy
array which is the image read by open cv
and saving it as a string. So I have converted the np
array to string and stored the same. Now I wanted to retrieve the value(which is a string) and convert to original numpy
array dimension. Could you all please help me in how to do that?
My code is as below:
img = cv2.imread('9d98.jpeg',0)
img.shape # --> (149,115)
img_str=np.array2string(img,precision=2,separator=',') # to string length 197? which I dont know how
img_numpy=np.fromstring(img_str,dtype=np.uint8) # shape (197,) since this is returning only 1D array
Please help me in resolving the same