use of boofcv.abst.scene.nister2006.ConfigRecognitionNister2006 in project BoofCV by lessthanoptimal.
the class TestRecognitionIO method save_load_nister2006.
/**
* Very basic test. Mostly just checks to see if things blow up or not
*/
@Test
void save_load_nister2006() {
File dir = new File(System.getProperty("java.io.tmpdir"), "nister2006");
try {
var config = new ConfigRecognitionNister2006();
var original = new FeatureSceneRecognitionNister2006<>(config, () -> new TupleDesc_F64(10));
original.setDatabase(createDefaultNister2006());
RecognitionIO.saveNister2006(original, dir);
var found = new FeatureSceneRecognitionNister2006<>(config, () -> new TupleDesc_F64(10));
RecognitionIO.loadNister2006(dir, found);
// Check a some things to make sure it actually loaded
assertEquals(20, found.getDatabase().getImagesDB().size);
assertEquals(5, found.getTree().nodes.size());
} finally {
// clean up
if (dir.exists())
UtilIO.deleteRecursive(dir);
}
}
Aggregations