Forum

Author Topic: Batch Process Orthomosaics with planar projection  (Read 4407 times)

4DS Niklas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Batch Process Orthomosaics with planar projection
« on: April 13, 2023, 08:07:45 PM »
Hello,

i have captured a building with my drone and wanted to generate orthomosaics of all its facades. I transformed it to a local coordinate system so the building is parallel to XY.
Now i realized i do not have the options for front XY etc. when batch processing orthomosaics. Is there a solution for this?

I have found the following code in an old thread:

Code: [Select]
import PhotoScan

front = PhotoScan.Matrix([[1, 0, 0, 0],[0, 0, 1, 0],[0, -1, 0, 0],[0, 0, 0, 1]])
back = PhotoScan.Matrix([[-1, -0, -0, 0],[0, 0, 1, 0],[0, 1, 0, 0],[0, 0, 0, 1]])
left = PhotoScan.Matrix([[-0, -1, -0, 0],[0, 0, 1, 0],[-1, 0, 0, 0],[0, 0, 0, 1]])
right = PhotoScan.Matrix([[0, 1, 0, 0],[0, 0, 1, 0],[1, 0, 0, 0],[0, 0, 0, 1]])

doc = PhotoScan.app.document

for chunk in doc.chunks:

if chunk.label.endswith("East"):
proj = right
elif chunk.label.endswith("South"):
proj = front
elif chunk.label.endswith("West"):
proj = left
else:
proj = back

chunk.buildOrthomosaic(surface=PhotoScan.DataSource.ModelData,blending=PhotoScan.BlendingMode.MosaicBlending,color_correction=False,projection=proj)

Would this code still work, do i just have to replace photoscan with metashape? Would it actually do what i described above? Sadly, im not very well versed in python or how to utilize metashapes API.
Thanks in advance!
Niklas