#2411·openMVG

错误: [main_SfM.cpp:409] 无法加载匹配文件。

作者: djhsjz创建于 2025年4月10日更新于 2025年4月10日

你好,我在使用 Release V2.0 中的 tutorial demo.py 时遇到了以下错误。似乎没有生成 matches.f.bin 文件,我不确定原因是什么。代码: print("1. Intrinsics analysis") pIntrisics = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params, "-c", "3"]) pIntrisics.wait() print("2. Compute features") pFeatures = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeFeatures"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir, "-m", "SIFT", "-f", "1"]) pFeatures.wait() print("2. Compute matches") pMatches = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeMatches"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir+"/matches.putative.bin", "-f", "1", "-n", "AUTO"]) pMatches.wait() print("2. Filter matches") pFiltering = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_GeometricFilter"), "-i", matches_dir+"/sfm_data.json", "-m", matches_dir+"/matches.putative.bin", "-g", "f", "-o", matches_dir+"/matches.f.bin"]) pFiltering.wait() reconstruction_dir = os.path.join(output_dir, "reconstruction_sequential") print("3. Do Incremental/Sequential reconstruction") # 手动设置初始匹配以避免提示问题 pRecons = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfM"), "--sfm_engine", "INCREMENTAL", "--input_file", matches_dir+"/sfm_data.json", "--match_dir", matches_dir, "--output_dir", reconstruction_dir]) pRecons.wait() print("5. 着色结构") pRecons = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/sfm_data.bin", "-o", os.path.join(reconstruction_dir, "colorized.ply")]) pRecons.wait() print("4. 从已知姿态构建结构(稳健三角化)") pRecons = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeStructureFromKnownPoses"), "-i", reconstruction_dir+"/sfm_data.bin", "-m", matches_dir, "-o", os.path.join(reconstruction_dir, "robust.ply")]) pRecons.wait() # 全局 SfM 工作流程的重构 - 全局 SfM 工作流程使用经估计的基本矩阵过滤的匹配 - 在这里,我们重用光学匹配,仅执行基本矩阵过滤 print("2. Filter matches (for the global SfM Pipeline)") pFiltering = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_GeometricFilter"), "-i", matches_dir+"/sfm_data.json", "-m", matches_dir+"/matches.putative.bin", "-g", "e", "-o", matches_dir+"/matches.e.bin"]) pFiltering.wait() reconstruction_dir = os.path.join(output_dir, "reconstruction_global") print("3. 执行全局重构") pRecons = subprocess.Popen([os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfM"), "--sfm_engine", "GLOBAL", "--input_file", matches_dir+"/sfm_data.json", "--match_file", matches_dir+"/matches.e.bin", "--output_dir", reconstruction_dir]) pRecons.wait()

内容来源: openMVG/openMVG