MCPcopy Create free account
hub / github.com/alicevision/AliceVision / convertToColmapScene

Function convertToColmapScene

src/aliceVision/sfmDataIO/colmap.cpp:439–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439void convertToColmapScene(const sfmData::SfMData& sfmData, const std::string& colmapBaseDir, bool copyImages)
440{
441 // retrieve the views that are compatible with Colmap and that can be exported
442 const auto views2export = getColmapCompatibleViews(sfmData);
443 if (views2export.empty())
444 {
445 ALICEVISION_LOG_WARNING("No camera in the scene is compatible with Colmap");
446 return;
447 }
448 ALICEVISION_LOG_INFO("Found " << views2export.size() << "/" << sfmData.getValidViews().size()
449 << " views to export "
450 "that are compatible with Colmap");
451
452 ColmapConfig colmapParams{colmapBaseDir};
453
454 // Generate the folder structure for colmap
455 ALICEVISION_LOG_INFO("Creating Colmap subfolders...");
456 create_directories(colmapParams._sparseDirectory);
457 create_directories(colmapParams._denseDirectory);
458 create_directories(colmapParams._imagesDirectory);
459
460 if (copyImages)
461 {
462 ALICEVISION_LOG_INFO("Copying source images...");
463 copyImagesFromSfmData(sfmData, colmapParams._imagesDirectory, views2export);
464 }
465
466 ALICEVISION_LOG_INFO("Generating Colmap files...");
467 generateColmapSceneFiles(sfmData, views2export, colmapParams);
468}
469
470} // namespace sfmDataIO
471} // namespace aliceVision

Callers 1

aliceVision_mainFunction · 0.85

Calls 7

getColmapCompatibleViewsFunction · 0.85
create_directoriesFunction · 0.85
copyImagesFromSfmDataFunction · 0.85
generateColmapSceneFilesFunction · 0.85
getValidViewsMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected