i have folder with pictures ("C:\Users\Admin\Downloads\mypicture")
here example of it
8
and2
i want convert it to pixel dataframe like this
pixel1 pixel. pixel158 pixel159 pixel160 pixel161 pixel162 pixel163 pixel164 pixel165 pixel166 pixel167 pixel168 pixel169 pixel170 pixel171 pixel172
1 0 … 0 191 250 253 93 0 0 0 0 0 0 0 0 0 0
2 0 … 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0
pixel173 pixel174 pixel175 pixel176
1 0 0 0 0
2 0 0 16 179
Every image is represented as a single row . The greyscale of each image falls in the range [0, 255]. i do so
img = mpimg.imread("C:\Users\Admin\Downloads\mypicture")
img = np.ravel(img)
df = pd.DataFrame([img])
but i get this error
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
How can i get desired data frame in csv file?