Metashape Python 独立模块中的稀疏云与具有相同设置的应用程序中的结果不匹配

问题描述 投票:0回答:1

我正在自动化摄影测量工作流程,以在转盘上构建物体模型。我有一个锅,我拍了顶部和底部的照片。我把它们分成一大块而不是两块。当我使用以下设置运行对齐照片工作流程步骤时,我得到了一个漂亮的点云,所有图片都对齐。 Align photos dialog with High accuracy, generic preselection, tiepoints=0 and other options

当我运行以下代码时(据我所知,应该做同样的事情),我得到了四张对齐的图片,但没有一个相机处于正确的位置。我已检查文件,正确的掩码已正确导入。你知道我做错了什么吗?

maskKeypoints=False
if config["mask_path"]:
    mp = os.path.join(config["mask_path"])
    ext = config["mask_ext"]
    masktemplate = f"{mp}{os.sep}{{filename}}.{ext}"
    chunk.generateMasks(masktemplate,Metashape.MaskingMode.MaskingModeFile)
    maskKeypoints=True
    doc.save()
#match photos/align photos
chunk.matchPhotos(downscale=consts.PhotogrammetryConsts.AlignDownscale["HIGH"],# =1
                   filter_stationary_points=True,
                   reset_matches=True,
                   filter_mask = maskKeypoints,
                   generic_preselection=True,
                   keypoint_limit=40000,
                   tiepoint_limit=0,
                   guided_matching=True)
chunk.alignCameras()
doc.save()
python photogrammetry
1个回答
0
投票

我意识到了关于这段代码的一些事情。首先,自适应模型过滤在 API 中的函数参数中没有明显的类似物。但是,最重要的是,在函数声明中默认 mask_tiepoints =True,但在 GUI 中默认禁用。 将 mask_tiepoints 设置为 False,将 filter_mask 设置为 True 似乎可以解决我的问题。

© www.soinside.com 2019 - 2024. All rights reserved.