1

**Python and Java API / Loading camera references from file and setting appropriate values**

« **on:**February 23, 2018, 03:39:07 PM »

Hello,

we are using a stationary camera and a rotating plate in the field of view to image objects from all sides. Within the local coordinate system we know the distance from the camera to the object and we (roughly) know the rotational angle alpha between consecutive images. Hence we know the z coordinate - which never changes - and set it to 0 in the local coordinate system. The x and y coordinates are variable but can roughly be computed by sin(alpha) and cos(alpha) for the known rotation angle alpha between consecutive images. From the definition of the axes (http://www.agisoft.com/forum/index.php?topic=5381.msg26475#msg26475) we also know that the yaw (rotation around z-axis / camera view direction) and the roll (rotation around x-axis) never changes and we also set these to 0.

We would like to guide the reconstruction process by setting appropriate reference values for the x,y,z and yaw,pitch,roll parameters as well as the accuracy values. We would like to use a CSV file. According to the Python API we create a CSV file like so:

So we assume that we know z perfectly (accuracy 0[m]), and x and y can have an error of 1[m]. And for the angles we set the accuracies of yaw and roll to 0[°] and the accuracy of the pitch to alpha [°] to allow for some uncertainty in the direction of rotation.

We load this file through the Python API by:

Unfortunately, the resulting camera poses after the estimation are often way off. They should form a perfect circle around the object, with overlap between the images. So probably something is wrong with how we set the references.

Questions:

1) Are the given values for the accuracy parameters correct (X=Y=1 [m] and A=B=0 [°])?

2) Can PhotoScan handle such strange reference settings? After all the "plane" at one time appears to be flying upside down underneath the object.

3) Is this the correct way to load the reference values after all or should we follow jpvega's way (http://www.agisoft.com/forum/index.php?topic=5530.msg27060#msg27060 - with modified parameter names: Chunk.accuracy_cameras -> Chunk.camera_location_accuracy)?

4) Is it possible at all to prevent PhotoScan from optimizing two rotational angles completely?

5) Are the absolute settings for the axes / angles correct or did we mess up the coordinate system?

Thanks for your help!

we are using a stationary camera and a rotating plate in the field of view to image objects from all sides. Within the local coordinate system we know the distance from the camera to the object and we (roughly) know the rotational angle alpha between consecutive images. Hence we know the z coordinate - which never changes - and set it to 0 in the local coordinate system. The x and y coordinates are variable but can roughly be computed by sin(alpha) and cos(alpha) for the known rotation angle alpha between consecutive images. From the definition of the axes (http://www.agisoft.com/forum/index.php?topic=5381.msg26475#msg26475) we also know that the yaw (rotation around z-axis / camera view direction) and the roll (rotation around x-axis) never changes and we also set these to 0.

We would like to guide the reconstruction process by setting appropriate reference values for the x,y,z and yaw,pitch,roll parameters as well as the accuracy values. We would like to use a CSV file. According to the Python API we create a CSV file like so:

n, x, y, z,X,Y,Z,a,b, c,A,B,C

img1.png,sin(1*alpha),cos(1*alpha),0,1,1,0,0,1*alpha,0,0,0,alpha

img2.png,sin(2*alpha),cos(2*alpha),0,1,1,0,0,2*alpha,0,0,0,alpha

...

n, x, y, z,X,Y,Z,a,b, c,A,B,C

img1.png,sin(1*alpha),cos(1*alpha),0,1,1,0,0,1*alpha,0,0,0,alpha

img2.png,sin(2*alpha),cos(2*alpha),0,1,1,0,0,2*alpha,0,0,0,alpha

...

So we assume that we know z perfectly (accuracy 0[m]), and x and y can have an error of 1[m]. And for the angles we set the accuracies of yaw and roll to 0[°] and the accuracy of the pitch to alpha [°] to allow for some uncertainty in the direction of rotation.

We load this file through the Python API by:

`chunk.loadReference(file.csv, PhotoScan.ReferenceFormatCSV, 'nxyzXYZabcABC',',',True,1)`Unfortunately, the resulting camera poses after the estimation are often way off. They should form a perfect circle around the object, with overlap between the images. So probably something is wrong with how we set the references.

Questions:

1) Are the given values for the accuracy parameters correct (X=Y=1 [m] and A=B=0 [°])?

2) Can PhotoScan handle such strange reference settings? After all the "plane" at one time appears to be flying upside down underneath the object.

3) Is this the correct way to load the reference values after all or should we follow jpvega's way (http://www.agisoft.com/forum/index.php?topic=5530.msg27060#msg27060 - with modified parameter names: Chunk.accuracy_cameras -> Chunk.camera_location_accuracy)?

4) Is it possible at all to prevent PhotoScan from optimizing two rotational angles completely?

5) Are the absolute settings for the axes / angles correct or did we mess up the coordinate system?

Thanks for your help!