I am attempting to do some image recognition on pokemon images and I have downloaded a file folder with many images of pokemon. I have library EBImage fro the BiocManager package and used it to create an image into a csv using the code below. But, is there a way to automate this with a for loop maybe and call in all of the images in the folder?
install.packages("BiocManager")
BiocManager::install("EBImage")
library("EBImage")
img <- readImage("c:/Users/hlop5/Downloads/images/pikachu.png")
img <- channel(img,"grey")
display(img, method = "raster")
write.csv(t(img), "sample.csv",row.names = FALSE)
sample <- read_csv("C:/sample.csv")