As part of a project I wish to convert 112 different GIMP PMG images into 45x45 Matrix .tsv files. For the purposes of the project, a number <128 will represent a black pixel, whilst number >= 128 will represent a white one. Using R, how can i easily convert them into a matrix containing 1s and 0s, reading in the 112 pgm files and writing out a square tsv file. Keep in mind all files have a unique name! Thanks
Asked
Active
Viewed 17 times
0
-
2Have you searched here? E.g. - https://stackoverflow.com/questions/71284482/importing-multiple-pgm-pictures-using-read-pnm-in-r and https://stackoverflow.com/questions/12826051/read-pnm-error-trying-to-read-pgm-image look to give some starting points. – thelatemail Mar 17 '23 at 01:04