lundi 23 février 2015

Adding folder names to rows of table, indicating from which folder the row/image came from before mixing all the images in the folders for processing

I am sorry if the title if complicated but I had a hard time expressing what I want to do.


Here my problem:


I have several thousand images that I want to process. They are split in ~120 folders where the folder name indicates their taxa. Each image in the folder has a name which is a number.


Instead of processing all 120 folders separately I would like to mix all the pictures from the 120 folders in order to process them all in one batch.


When I process the images I extract some parameters leading to a .csv file where each row is one of the images. One of the columns is the image name, so the number is there to identify which row comes from which image.


If I process all images together I would have to find a way to label the rows again after processing based on which folder they came from. Again, the image name is in the .csv file for identification.


So I guess one could write a command that stores the original structure of which images were in which folders. Something like linking the image name to the folder name indicating the taxon and adding that back to each row in the .csv file based on the column with the image name.


Or maybe there is something totally different and easier?


My setup is:


I am on Mac Yosemite, with the .csv tables etc in Office for Mac x64. Maybe R would be helpful to have a solution? I am not a God in R, but okay.


The files are as follow: A folder name could be just like species x for example and the image name: 100.bmp


After mixing all images, processing them and exporting them I get the .csv file with 30k+ rows including the column with the image name 100. So, how can I attach the folder name back based on the image name?


Thanks very much for your input. To find a way around this will safe me lot's of point and click with buggy software.


Best, Moritz


Aucun commentaire:

Enregistrer un commentaire