Forum

Author Topic: Build OrthoMosaic Batch Process Projection  (Read 7465 times)

James

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Build OrthoMosaic Batch Process Projection
« on: February 01, 2016, 11:15:52 PM »
When setting a batch process to build orthomosaics for all my chunks (i have about 25 for this project), it seems to default to a top projection.

I want to be able to do left, right, front and back too.

There is a projection parameter that i can set but this only seems to include geographic projections. There is a 'custom' box but i'm not sure how to create custom projections for left, right, front and back, or if that's the right thing to do anyway.

I shall start working out the python way to do it, and check back here in case there is an easier way before i finish...

Thanks!

**edit** the python was pretty simple and went something like this:

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)
« Last Edit: February 02, 2016, 02:39:44 PM by James »

zoos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Build OrthoMosaic Batch Process Projection
« Reply #1 on: March 02, 2017, 12:03:25 AM »
Hey James

Thanks that really helped me.

But i Do not understand what the Matrix is doing ? Why does it have 4 Values. It´s not x,y,z than right ?

You would really help me out if you explain.

Zoos




James

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Build OrthoMosaic Batch Process Projection
« Reply #2 on: March 02, 2017, 01:15:34 PM »
I can't claim i entirely understand it myself, but it's a 4x4 transformation matrix which describes translation, scaling, shear and rotation.

I think I probably got the values from Alexey's post here:
http://www.agisoft.com/forum/index.php?topic=1322.msg15758#msg15758

And this page here describes the matrix:
https://www.tutorialspoint.com/computer_graphics/3d_transformation.htm

I think the matrices used for the ortho projection in this case are purely describing the various rotations required for each view.

zoos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Build OrthoMosaic Batch Process Projection
« Reply #3 on: March 02, 2017, 09:14:59 PM »
Thanks James.  Now i get it !!!

have a lovely day :)


mcmigovych

  • Newbie
  • *
  • Posts: 1
  • The Cheesy Animation Factory
    • View Profile
    • 3D Architectural Rendering UAE
Re: Build OrthoMosaic Batch Process Projection
« Reply #4 on: March 03, 2017, 09:27:50 AM »
For the structure from motion model calculation in PhotoScan, you may want to do the batch processing sometimes. am i Right ?