Forum

Author Topic: Setting GPS / INS Offset - Camera Calibration  (Read 3703 times)

agellus

  • Newbie
  • *
  • Posts: 1
    • View Profile
Setting GPS / INS Offset - Camera Calibration
« on: September 14, 2017, 09:39:45 PM »
Quick question regarding offsets...

I am able to get the Camera Calibration (xml) to load and verify the setting(s) in the Camera Calibration pane in the GUI. I am also able to access the Cameras Location and Rotational Accuracy and verify the setting(s) in the Reference Settings pane in the GUI. Perfect!

The issue I have is how to access the GPS/INS Offset settings in the Camera Calibration pane (tab), screenshot attached. I have included the sample I am using to access the above (cal and ref) settings; however, if I try to assign the Camera.Sensor.Antenna attribute the same as the Calibration setings it returns, not writeable… I did notice the antenna class has been moved around a bit through versions, likely I am using it wrong ..

How do I access these settings via python, specifically location (x,y,z)(m) and rotational (y,p,r)(deg)?

# set the rotation/location accuracy
for self.chunk in self.doc.chunks:
    self.chunk.camera_location_accuracy = PhotoScan.Vector(
        [self.offset.location, self.offset.location, self.offset.location])
    self.chunk.camera_rotation_accuracy = PhotoScan.Vector(
        [self.offset.rotation, self.offset.rotation, self.offset.rotation])

# load the camera calibration
for camera in self.doc.chunk.cameras:
    path = home + "\Queue\\" + directoy + "\\" + "calibration.xml"

    antenna = PhotoScan.Antenna
    antenna.fixed = False

    s = self.doc.chunk.addSensor()
    s.label = camera.label
    s.user_calib = PhotoScan.Calibration()
    c = PhotoScan.Calibration()
    c.load(path)
    s.user_calib = c
    #s.antenna = antenna
    s.fixed = True
    s.width = camera.photo.image().width
    s.height = camera.photo.image().height
    camera.sensor = s


Thanks in Advance!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Setting GPS / INS Offset - Camera Calibration
« Reply #1 on: September 23, 2017, 05:47:20 PM »
Hello agellus,

To access GPS/INS offset values you need to use the following code:
Code: [Select]
sensor = camera.sensor
sensor.antenna.location_ref = PhotoScan.Vector([x, y, z])
sensor.antenna.rotation_ref = PhotoScan.Vector([Y, P, R])

It is a sensor (calibration group) property, not camera.


camera.location_accuracy  and camera.rotation_accuracy are related to the Accuracy values displayed in the corresponding columns of the Reference pane and have nothing to do with the GPS/INS offset. Accuracy values should correspond to the measurement accuracy of the device that records camera location and orientation.
Best regards,
Alexey Pasumansky,
Agisoft LLC