I am writing a program which is performing some computer vision and image processing tasks. I have a database of about 100 images, from which I extract some data (properties of the images). Once I have extracted this data, I then perform some analysis on it.
So far, every time I run the program, it extracts the image data each time, and stores the data in an image_data structure that I have written. However, it is very time consuming to get this data every time, and seems silly to do it every time because it is the same data I am storing each time.
So, I am looking for a way to store this data this data somewhere that can be found each time I run the program, without having to extract the data again. I'm sure this sort of thing happens a lot, so I'm wondering what the possible solutions are?
One way I thought of is to print out all the data to a text file, save it on disk, and then access the file every time I run the program.
Ideally, however, I would like to have the image_data structure like before, and be able to access it from my program. Normally, the image_data structure is obviously deleted when my program terminates...but is there a way I can have some sort of class which is written to permanently, and is loaded every time the program runs?