dimanche 1 mars 2015

How to import multiple jpeg images in R

I'm trying to import multiple black and white images from a folder into R. There is no pattern to the name of each file.


I have tried a couple different approaches:



files <- list.files(path="C:\\images", pattern=".jpeg",all.files=T, full.names=F, no.. = T)


and



x = readImage(system.file(images, *.png, package=EBImage))


with no luck.


Ultimately I would like to import these images and create a matrix with each row representing an image and each column representing a pixel number, ranging from pixel 0 to pixel 783 (these are 28x28 images so 786 total pixels).


Thanks


Aucun commentaire:

Enregistrer un commentaire