Forum

Author Topic: Understanding Source Reference Preselection  (Read 5753 times)

tomash

  • Newbie
  • *
  • Posts: 3
    • View Profile
Understanding Source Reference Preselection
« on: April 18, 2023, 04:22:47 PM »
Hello,

As part of a project using multiple camera rig of non-overlapping cameras, I'm trying to understand how the "source reference preselection" for the image matching works.
The motivation behind my effort is to find a way how not to match images, which are looking in the opposite directions.

For that I have done a simple experiment, which uses 4 geo-referenced frames, last of which, the frame3.jpg has reference yaw set to -90deg, while the other frames were set to 90deg.
The experiment was done as follows;
  • Metashape project was created and images imported
  • Attached script was run, which imports reference from csv and runs the image matching

As far as I understand, the script runs according to the manual.
The expected result is, that the frame3 will not be matched with frame0, frame1 and frame2.  However as observed in the "Matches window" (screenshot attached), the frame3 is being matched with the other frames.

How can I achieve such results, or what am I missing? I'm attaching the script, as well as couple of screenshots, to illustrate the problem.

Thank you for any help,
Tomas


Code: [Select]
   
    # import reference
    chunk.importReference(ref_p, delimiter=",", columns="nxyzabc")

    for cam in chunk.cameras:
        cam.reference.rotation_enabled = True
        print(f"{str(cam)} ref: {cam.reference.rotation}")

    # capture distance (reference settings)
    chunk.meta['subject_distance'] = '20'

    # matching
    task = ms.Tasks.MatchPhotos()
    task.downscale                = 1
    task.generic_preselection     = False
    task.reference_preselection   = True
    task.reference_preselection_mode = ms.ReferencePreselectionMode.ReferencePreselectionSource
    task.apply(chunk)
    ms.app.document.save(path=prj_p) 

Paulo

  • Hero Member
  • *****
  • Posts: 1562
    • View Profile
Re: Understanding Source Reference Preselection
« Reply #1 on: April 18, 2023, 05:22:16 PM »
Hello tomash,

Actually frame 3 is not matched to frames 0,1,2 as all matches are marked as Invalid (red). So you should look at aligned cameras and see which are (blue triangle vs blue sphere)....
Best Regards,
Paul Pelletier,
Surveyor

tomash

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Understanding Source Reference Preselection
« Reply #2 on: April 18, 2023, 06:08:56 PM »
Hello tomash,

Actually frame 3 is not matched to frames 0,1,2 as all matches are marked as Invalid (red). So you should look at aligned cameras and see which are (blue triangle vs blue sphere)....

Hi Paulo,

thank you for your reply. 

However my question is, whether it is being matched - I'm trying to reduce the computation, which I believe it is. Anyway after finishing the Alignment I do get quite a lot of blue correct matches.

Tomas


Paulo

  • Hero Member
  • *****
  • Posts: 1562
    • View Profile
Re: Understanding Source Reference Preselection
« Reply #3 on: April 18, 2023, 11:02:14 PM »
I see what  you mean,

yes with reference preselection on and reference rotation enabled, pair3-2 or 3-1 or 3-0 should probably not be considered in pair wise matching...

Maybe Agisift support can explain such behavior?
Best Regards,
Paul Pelletier,
Surveyor