Forum

Author Topic: Commands to control multiplane  (Read 2281 times)

picare

  • Newbie
  • *
  • Posts: 32
    • View Profile
Commands to control multiplane
« on: July 19, 2019, 04:11:26 PM »
There is a Python command to create a multiplane Chunk (chunk1.addPhotos(patternImg,PhotoScan.MultiplaneLayout)  ).....

But what are the Python command to control the offset between the cameras and to enable the adjustment of angles and locations?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Commands to control multiplane
« Reply #1 on: July 22, 2019, 06:28:40 PM »
Hello picare,

Please check sensor.reference.location and sensor.reference.rotation for each "sensor" from the slave sensors set.

To enable/disable adjustment of the offset parameters use Boolean flags:
sensor.fixed_location and sensor.fixed_rotation.
Best regards,
Alexey Pasumansky,
Agisoft LLC

picare

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Commands to control multiplane
« Reply #2 on: July 23, 2019, 10:13:17 AM »
Perfect!

I am able to set the values with chunk1.sensors[2].reference.location=Metashape.Vector([6,10,15])
... but unable to find the "adjusted" values:

dir(chunk1.sensors[2].reference) gives
2019-07-23 09:04:48  'accuracy',
2019-07-23 09:04:48  'enabled',
2019-07-23 09:04:48  'location',
2019-07-23 09:04:48  'location_accuracy',
2019-07-23 09:04:48  'rotation',
2019-07-23 09:04:48  'rotation_accuracy']

and dir(chunk1.sensors[2].reference.location) gives
2019-07-23 09:03:52  'copy',
2019-07-23 09:03:52  'cross',
2019-07-23 09:03:52  'norm',
2019-07-23 09:03:52  'norm2',
2019-07-23 09:03:52  'normalize',
2019-07-23 09:03:52  'normalized',
2019-07-23 09:03:52  'size',
2019-07-23 09:03:52  'w',
2019-07-23 09:03:52  'x',
2019-07-23 09:03:52  'y',
2019-07-23 09:03:52  'z',
2019-07-23 09:03:52  'zero']

And for a sensor which has been "adjusted", and has values in the window "slave offset > adjusted", chunk1.sensors[3].reference.location gives nothing (empty)

Thank you Alexey

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Commands to control multiplane
« Reply #3 on: July 23, 2019, 06:16:43 PM »
Hello picare,

The following code should print out the adjusted values for location and rotation for each slave sensor in the current chunk:
Code: [Select]
for sensor in chunk.sensors:
    if sensor == sensor.master:
        continue
    print(sensor.label)
    print("Adjusted location: X={:.5f}, Y={:.5f}, Z={:.5f}".format(*(chunk.transform.scale * sensor.location)))
    print("Adjusted rotation: Omega={:.5f}, Phi={:.5f}, Kappa={:.5f}".format(*(Metashape.utils.mat2opk(sensor.rotation))))
Best regards,
Alexey Pasumansky,
Agisoft LLC

picare

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Commands to control multiplane
« Reply #4 on: July 23, 2019, 06:39:27 PM »
Thanks, everything seems simple now!

Regards,

Pierre