smurf
smurf

Reputation: 49

OpenImaj: EigenImages, input images dimension cannot be difference?

VFSGroupDataset<FImage> dataset = new VFSGroupDataset<FImage>(
                "zip:file:/Users/nhnguyen/Data/newArchive.zip",
                ImageUtilities.FIMAGE_READER);

        int nTraining = 50;
        int nTesting = 5;
        GroupedRandomSplitter<String, FImage> splits = 
            new GroupedRandomSplitter<String, FImage>(dataset, nTraining, 0, nTesting);
        GroupedDataset<String, ListDataset<FImage>, FImage> training = splits.getTrainingDataset();
        GroupedDataset<String, ListDataset<FImage>, FImage> testing = splits.getTestDataset();

        List<FImage> basisImages = DatasetAdaptors.asList(training);
        int nEigenvectors = 100;
        EigenImages eigen = new EigenImages(nEigenvectors);
        eigen.train(basisImages);

I have the above code to test the EigenImages tutorial with my own set of data. What I am stuck at is that it would throw Exception with Matrix if in my data set, images are varies of dimension, say 92x112 and 100x100 and so on... When I do a batch resize to a same size then it work, however, these distort the image a little bit which I worried will affect the accuracy. Is there away to train the eigen recognize to accept input with various dimension?

Upvotes: 0

Views: 70

Answers (1)

Jon
Jon

Reputation: 841

No, the Eigenfaces approach inherently requires that all images are the same size and are also at least approximately aligned (i.e. same orientation, eyes in about the same place).

You might however be able to automate the scaling and alignment by using one of the OpenIMAJ FaceAligner implementations.

Upvotes: 0

Related Questions