Forum

Author Topic: The argument 'pairs' in chunk.matchPhotos is lost (version 1.6.2)  (Read 4538 times)

kot

  • Newbie
  • *
  • Posts: 3
    • View Profile
Is this a bug or Metashape detects pairs in matchPhotos arguments by himself? I am using Python API.
« Last Edit: May 26, 2020, 02:24:10 PM by kot »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15420
    • View Profile
Re: The argument 'pairs' in chunk.matchPhotos is lost (version 1.6.2)
« Reply #1 on: May 28, 2020, 01:08:20 AM »
Hello kot,

Can you please provide more information describing the situation with the pairs argument?

It is an optional argument. If you define it, Metashape will try to match only specified pairs.
Best regards,
Alexey Pasumansky,
Agisoft LLC

kot

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: The argument 'pairs' in chunk.matchPhotos is lost (version 1.6.2)
« Reply #2 on: May 28, 2020, 08:20:10 PM »
Hello kot,

Can you please provide more information describing the situation with the pairs argument?

It is an optional argument. If you define it, Metashape will try to match only specified pairs.

I am getting "ValueError: Invalid argument value: pairs" when try to add pairs to matchPhotos. But yes, I was wrong and this error associated with value. What am I doing wrong?

Example:
Code: [Select]
pairs_keys = [(chunk.cameras[i-1].key, chunk.cameras[i].key) for i in range(1, len(chunk.cameras), 2)]

chunk.matchPhotos(pairs=pairs_keys)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-25-f6141baa8b25> in <module>
----> 1 chunk.matchPhotos(pairs=pairs_keys)

ValueError: Invalid argument value: pairs
« Last Edit: May 28, 2020, 08:29:39 PM by kot »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15420
    • View Profile
Re: The argument 'pairs' in chunk.matchPhotos is lost (version 1.6.2)
« Reply #3 on: May 30, 2020, 06:29:21 PM »
Hello kot,

OK, thank you for additional information.

It seems that it really got broken, but we'll fix it in the next version update. Meanwhile you can use Tasks concept:
Code: [Select]
task = Metashape.Tasks.MatchPhotos()
task.pairs = pairs_keys
task.apply(chunk)
Best regards,
Alexey Pasumansky,
Agisoft LLC