use of boofcv.alg.similar.ConfigSimilarImagesSceneRecognition in project BoofCV by lessthanoptimal.
the class ExampleMultiViewSparseReconstruction method similarImagesFromUnsorted.
/**
* Assumes that the images are complete unsorted
*/
private void similarImagesFromUnsorted() {
System.out.println("----------------------------------------------------------------------------");
System.out.println("### Creating Similar Images from unordered images");
var config = new ConfigSimilarImagesSceneRecognition();
final var similarImages = FactorySceneReconstruction.createSimilarImages(config, ImageType.SB_U8);
similarImages.setVerbose(System.out, BoofMiscOps.hashSet(BoofVerbose.RECURSIVE));
// Track features across the entire sequence and save the results
BoofMiscOps.profile(() -> {
for (int frameId = 0; frameId < imageFiles.size(); frameId++) {
String filePath = imageFiles.get(frameId);
GrayU8 frame = UtilImageIO.loadImage(filePath, GrayU8.class);
Objects.requireNonNull(frame, "Failed to load image");
String viewID = frameId + "";
similarImages.addImage(viewID, frame);
// Everything maps to the same camera
if (frameId == 0)
dbCams.addCameraCanonical(frame.width, frame.height, 60.0);
dbCams.addView(viewID, 0);
}
similarImages.fixate();
}, "Finding Similar");
this.dbSimilar = similarImages;
}
Aggregations