1 /*this creates a yaml or xml list of files from the command line args
4 #include "opencv2/core/core.hpp"
5 #include "opencv2/imgcodecs.hpp"
6 #include "opencv2/highgui/highgui.hpp"
16 static void help(char** av)
18 cout << "\nThis creates a yaml or xml list of files from the command line args\n"
19 "usage:\n./" << av[0] << " imagelist.yaml *.png\n"
20 << "Try using different extensions.(e.g. yaml yml xml xml.gz etc...)\n"
21 << "This will serialize this list of images or whatever with opencv's FileStorage framework" << endl;
24 int main(int ac, char** av)
32 string outputname = av[1];
34 Mat m = imread(outputname); //check if the output is an image - prevent overwrites!
36 std::cerr << "fail! Please specify an output file, don't want to overwrite you images!" << endl;
41 FileStorage fs(outputname, FileStorage::WRITE);
42 fs << "images" << "[";
43 for(int i = 2; i < ac; i++){