I work in an image recognition application and try to implement a method using the Ferns descriptor pattern.
I study the structure of ferns and save them using the following code:
int main(int argc, char** argv) { vector<string> trainFilenames; readTrainFilenames(modelImagesList, imagesDir, trainFilenames); Ptr<GenericDescriptorMatcher> descriptorMatcher = GenericDescriptorMatcher::create("FERN", params_filename); SurfFeatureDetector detector(500); SurfDescriptorExtractor extractor; vector<vector<KeyPoint> > allKeypoints; vector<Mat> allTrainImages;
}
However, the only thing I get in the output file is:
<?xml version="1.0"?> <opencv_storage> <nclasses>0</nclasses> <patchSize>31</patchSize> <signatureSize>2147483647</signatureSize> <nstructs>50</nstructs> <structSize>9</structSize> <nviews>1000</nviews> <compressionMethod>0</compressionMethod> </opencv_storage>
Shouldn't I save the whole structure in an XML file?
It seems I cannot find where anyone is doing this with the new C ++ interface. Do these methods really work? If so, do you guys know how to make it work?
Thanks.
source share