Forum

Author Topic: Matching and aligning new images without modifying the camera poses of existing  (Read 3708 times)

CarloP

  • Newbie
  • *
  • Posts: 3
    • View Profile
Greetings

I have a saved Photoscan document containing the camera alignments and reconstructed mesh taken from a multitude of pictures

I would like programmatically to match and align new pictures without modifying the generated mes nor the existing camera coordinates.

I fear that if I add photos to the chunk this will result into modifying the existing camera poses.

Could you please provide some support ?

Thanks and regards

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14859
    • View Profile
Hello CarloP,

If you have information regarding exterior and interior orientation of the cameras, you can import that, then use matchPhotos() function and buildPoint() function. The latter one doesn't refine calibration or position/orientation information for cameras, so it is trying to generate the tie point cloud, basing on loaded orientation information and found matching points.
Best regards,
Alexey Pasumansky,
Agisoft LLC

CarloP

  • Newbie
  • *
  • Posts: 3
    • View Profile
Thanks for your reply

This is what I plan on doing

Code: [Select]
import sys
import PhotoScan

PicturePath = sys.argv[1]
doc = PhotoScan.app.document
doc.open("reco.psz")

chunk = doc.chunk

chunk.addPhotos ([PicturePath])

list_tomatch = []
for i in range(len(chunk.cameras)-1):
     list_tomatch += [ (chunk.cameras[-1],chunk.cameras[i]) ]

chunk.matchPhotos(pairs=list_tomatch)

chunk.alignCameras( cameras=[chunk.cameras[-1] ] )

print (chunk.cameras[-1].transform)


Would this allow me to get the pose corresponding to the last picture without modifying the existing ones ?

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14859
    • View Profile
Hello CarloP,

I think I got the full picture of your request now.

In the version 1.3 it is not possible to align newly added cameras to the existing image alignment, because keypoints are not stored in the project contents for this version and are discarded after image matching stage.

In the version 1.4 it would be possible to store the key points in the project (there will be corresponding setting in the Advanced Preferences tab), so it would be possible to add new photos to the project and find the matching points between them and already aligned photos without a need to run the Align Photos operation from scratch.
Best regards,
Alexey Pasumansky,
Agisoft LLC

CarloP

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hello Alexey

Just to understand better : The above code

Code: [Select]
chunk.matchPhotos(pairs=list_tomatch)

chunk.alignCameras( cameras=[chunk.cameras[-1] ] )

in the 1.3 would create a new reference system, i.e. the coordinate of  chunk.cameras[0].transform might be different after the execution of the process ?