[Python] Sparse Clouds in Metashape Python Standalone Module don't match results in app with...

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I'm automating the the photogrammetry workflow for building models of objects on turntables. I have a pot, and I've taken pictures of the top and bottom. I've put these in one chunk rather than two. When I run the align photos workflow step with the following settings, I get a nice point cloud with all pictures aligned. [​IMG]

    When I run the following code, which to my knowledge, should do the same thing, I get four pictures aligned, and none of the cameras in the right positions. I've checked in the file, the correct masks have imported correctly. Do you have any idea what I'm doing wrong?

    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()

    Continue reading...

Compartilhe esta Página