The task was to read from an image and extract the data to get a grid of 25 x 25 pixels. I used this code to extract it and I got the data. But how am I supposed to save it in a text file to see the whole 25 x 25 array?
I just converted an image to an array like this:
>>> img=cv2.imread("1670.png",0)
>>> img=cv2.imread("1670.png",0)
>>> img
array([[14, 15, 15, ..., 92, 91, 92],
[14, 15, 15, ..., 93, 93, 91],
[15, 15, 16, ..., 94, 93, 91],
...,
[69, 71, 76, ..., 73, 70, 68],
[69, 75, 81, ..., 76, 72, 69],
[69, 76, 81, ..., 80, 75, 71]], type=uint8)
I want to save it to a text file as a 25 x 25 array. How can I do this?