Forum

Author Topic: Running matchPhotos and alignCameras twice?  (Read 2169 times)

rygo6

  • Newbie
  • *
  • Posts: 1
    • View Profile
Running matchPhotos and alignCameras twice?
« on: April 24, 2019, 01:52:19 AM »
Inside the Metashape GUI I find that sometimes just running "Match Photos" twice automatically improves things. That being without the 'reset' checkbox checked. Was curious to know how I replicate that in the python scripting, as documentation seems kind of ambiguous about this.

Would I go:

chunk.matchPhotos(accuracy=Metashape.HighestAccuracy, preselection=Metashape.GenericPreselection, filter_mask=False, keypoint_limit=0, tiepoint_limit=0)
chunk.alignCameras()
chunk.matchPhotos(accuracy=Metashape.HighestAccuracy, preselection=Metashape.GenericPreselection, filter_mask=False, keypoint_limit=0, tiepoint_limit=0)
chunk.alignCameras()

Or would I go:

chunk.matchPhotos(accuracy=Metashape.HighestAccuracy, preselection=Metashape.GenericPreselection, filter_mask=False, keypoint_limit=0, tiepoint_limit=0)
chunk.alignCameras()
chunk.alignCameras()

?

I can't tell if running the operation twice through the editor is running both matchPhotos and alignCameras twice, or if matchPhotos only runs once, then alignCameras gets run twice.

Also how good or bad is it to leave keypoint and tiepoint limit to 0? Someone told me it's best to do that in photoscan, is that still true in Metashape?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14888
    • View Profile
Re: Running matchPhotos and alignCameras twice?
« Reply #1 on: April 24, 2019, 01:27:24 PM »
Hello rygo6,

If you need to re-align the cameras that have not bee aligned initially, then you do not need to re-match the photos, just run alignCameras and the available matching points would be re-used.

Using 0 for key point and tie point limits means that all the detected key point and matching points would be used. It may be not good due to the following two reasons:
- matching time would be considerably longer,
- even the key points of low confidence would be used, therefore the project could contain big number of false matches and tie points of the large scale (poorly localized).
Best regards,
Alexey Pasumansky,
Agisoft LLC