What are the alternatives to store trained images from OpenCv/JavaCv?

259 views Asked by At

I'm developing a web face recognizer application with Java and JavaCv. After took some pictures, a file .yml/.xml will be generated with something like this:

    for (File image : imageFiles) {
        Mat img = imread(image.getAbsolutePath(), CV_LOAD_IMAGE_GRAYSCALE);

        int label = Integer.parseInt(image.getName().split("\\-")[0]);
        String name = image.getName().substring(image.getName().indexOf("-") + 1, 
                                                image.getName().indexOf("_"));
        images.put(counter, img);
        labelsBuf.put(counter, label);
        map.put(label, name);

        counter++;
    }

    faceRecognizer.train(images, labels);
    faceRecognizer.save("C:/trainingDir/FaceDB.yml");

OpenCv pages and almost articles show that simple way to store the trained data. The problem is the more pictures you train, biggest and impratical it gets. It's impossible to load a 200mb file into the application to do the recognition.

I'm using javacv 1.2 from org.bytedeco. Basically, I take around 30 pictures from the person and generate the .yml file, create an instance of createEigenFaceRecognizer(), load the file faceRecognizer.load("C:/trainingDir/FaceDB.yml") and then do recognition faceRecognizer.predict(testImage).

I searched through a lot of OpenCv articles but couldn't find any viable solution.

How and where can I store the trained data? Is it possible to store in a relational database like MySql? Or there are any other option?

0

There are 0 answers