| 404 | |
| 405 | |
| 406 | void ParseData::getParsedColmapData(const std::string& dataset_path, const int fovXfovY_flag, const bool capreal_flag) |
| 407 | { |
| 408 | _basePathName = dataset_path + "/colmap/stereo"; |
| 409 | |
| 410 | _camInfos = sibr::InputCamera::loadColmap(_basePathName + "/sparse", 0.01f, 1000.0f, fovXfovY_flag); |
| 411 | |
| 412 | if (_camInfos.empty()) { |
| 413 | SIBR_ERR << "Colmap camera calibration file does not exist at /" + _basePathName + "/sparse/." << std::endl; |
| 414 | } |
| 415 | |
| 416 | _imgPath = _basePathName + "/images/"; |
| 417 | |
| 418 | std::string blackListFile = dataset_path + "/colmap/database.blacklist"; |
| 419 | |
| 420 | if (sibr::fileExists(blackListFile)) { |
| 421 | std::string line; |
| 422 | std::vector<std::string> splitS; |
| 423 | std::ifstream blackListFileF(blackListFile); |
| 424 | if (blackListFileF.is_open()) { |
| 425 | while (safeGetline(blackListFileF, line)) { |
| 426 | |
| 427 | split(splitS, line, is_any_of(" ")); |
| 428 | //std::cout << splitS.size() << std::endl; |
| 429 | if (splitS.size() > 0) { |
| 430 | for (uint cam_id = 0; cam_id < _camInfos.size(); cam_id++) { |
| 431 | if (find_any(splitS, _camInfos[cam_id]->name())) { |
| 432 | _camInfos[cam_id]->setActive(false); |
| 433 | } |
| 434 | } |
| 435 | splitS.clear(); |
| 436 | } |
| 437 | else |
| 438 | break; |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | populateFromCamInfos(); |
| 444 | |
| 445 | if (capreal_flag) { |
| 446 | _meshPath = dataset_path + "/capreal/mesh.obj"; |
| 447 | _meshPath = (sibr::fileExists(_meshPath)) ? _meshPath : dataset_path + "/capreal/mesh.ply"; |
| 448 | } |
| 449 | else { |
| 450 | _meshPath = dataset_path + "/colmap/stereo/meshed-delaunay.ply"; |
| 451 | } |
| 452 | |
| 453 | } |
| 454 | |
| 455 | void ParseData::getParsedNVMData(const std::string& dataset_path, const std::string& customPath, const std::string& nvm_path) |
| 456 | { |