Forum

Author Topic: Merge identical cameras  (Read 2357 times)

tkwasnitschka

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Merge identical cameras
« on: December 03, 2019, 05:45:27 PM »
I run very large projects with bad camera calibration that I split into overlapping chunks, align them separately and then merge them back. Then, they need to be optimized to improve on my calibration and vague referencing, so I need matches shared among the components of the former chunks. This leaves me with the follwing simplified situation:

Chunk A (Cam1, Cam2, Cam3, Cam4) + Chunk B (Cam3, Cam4, Cam5, Cam6) =

Merged Chunk (Cam1, Cam2, Cam3, Cam4

                                                                   Cam3, Cam4, Cam5, Cam6)

For reasons I dont understand MS does not match (i.e., re-align after reset) the identical cameras unless I do a full alignment from scratch, which is not an option.

To link them with control points would mean many hundred points, slowing down the GUI considerably. To be fair, this is what Alexey recommended in the past: https://www.agisoft.com/forum/index.php?topic=10097.msg46129#msg46129

But as he points out this is not a perfect merging solution. I know the cameras are identical, so alignment isn't actually necessary.

I want to be able to merge those identical cameras the same way I can merge markers!

I thought this could be done in python, and yes you can transfer all projections from one camera to another with the following code:

Code: [Select]
projections = doc.chunk.point_cloud.projections
camera_3A = doc.chunks[0].cameras[2]
camera_3B = doc.chunks[1].cameras[0]
projections[camera_3B] = projections[camera_3A] # replaces projections even if target is empty

But I want to append, not replace the projections! How can this be done? Apparently there are no operands or write functions for projections or their dependencies:
Code: [Select]
projections[camera_3B] = projections[camera_3A].append(projections[camera_3B])     # Doesnt work, but wanted!
# then reduce number of tiepoints
# then delete duplicates

By the way, could someone once and for all clarify the relationship of
  • cameras
  • camera keys
  • keypoints
  • tiepoints
  • matches (deprecated??)
  • projections
  • tracks
  • track ids
  • points
  • sparse cloud
This is so central that there should be a document, preferrably with python code showing the relationship.
Thanks!

Tom
« Last Edit: December 10, 2019, 12:28:51 PM by tkwasnitschka »

tkwasnitschka

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Merge identical cameras
« Reply #1 on: December 13, 2019, 02:07:29 PM »
allow my to simplify my question:
How can I merge identical cameras of two chunks and their projections the same way I can merge markers?
Thanks!