Vr Mapping




Importing a Agisoft Photoscan Project Into Vr Aerial Triangulation (VrAirTrig)

This document explains the work flow for importing data from Pix4D into VrAirTrig.


There are at least two reasons that users may wish to rerun a Photoscan block in VrAirTrig.

1. The VR Bundle adjustment provides detailed reports and comprehensive weighting parameters.

2. In order to compensate for the imperfect Photoscan camera model export.



1. Export Camera Exterior Orientations and Image Measurements from Photoscan

2. Open Air Trig and Create a project File.

3. Import the camera file

4. Add the images

5. Setup the control file

6. Import the Photoscan camera position solution

7. Import the measurements

8. Run the bundle adjustment

Export Camera Exterior Orientations and Image Measurements from Photoscan.

Export the camera exterior orientations, called "Cameras" in Photoscan.




Save the exterior orientations as "Bingo" format.




Export the image measurements (called "Matches" in Photoscan) as a "patb" format.






Back to Top

Open Air Trig and Create a New Project File

The 'New Project' command is located in the 'Project' window on the main title bar.  After choosing a file name and location the project edit/setup wizard will open.


Back to Top

Import the Camera File

To create a new VR camera file from the Photoscan camera click on the 'New Camera' button on the 'Cameras and Photos' tab of the project wizard.  A Camera Edit dialog will open.  Click the Import Camera Data button near the top left.  Change the file type to Agisoft (using the combo box near the bottom right).  Navigate to the file (the file name format is *.xml).  A fully functional camera definition will be imported, but a description can be added for convenience.  Note that in order to import measurements the camera must be converted to millimeters instead of native pixels.  To do this conversion you will be prompted for a pixel size in millimeters.  It is best to get this number from inside Photoscan.


To see the imported (and scaled) distortion coefficients click on the 'Edit Radial Distortions' button near the bottom right of the camera edit dialog.  You'll notice that the 'Adjustment mode' has been set to 'Polynomial'.  The actual polynomials can be seen by clicking on the 'Polynomial Parameters' button.


Upon clicking 'OK' to exit the camera edit window, you'll be prompted to choose a file name for the new camera file.


Full documentation for the camera edit dialog is located here.


Back to Top


Add the Images

To add images to project click on the name of camera the images will be assigned to in the left table of the 'Cameras and Photos' tab of the project wizard.  When a single camera is selected the 'Assign Photos to Camera' button on the bottom left becomes active.  Click this button and navigate to choose the images.


Back to Top


Setup the Control File

On the 'Orientations and Control' tab of the project wizard the 'Control File' button is used to select ground control file.  The control file can be file formatted as follows:


PtName1 X Y Z

PtName2 X Y Z

PtName3 X Y Z



The Vr Mapping software adds some default header information when it saves the file.


File Example:


# Coordinate File

# Layout  - Field Order              Min number of fields

#  0        NAME X Y Z CX CY CZ                 3

#  1        NAME Y X Z CY CX CZ                 3

#  2        X Y Z NAME CX CY CZ                 4

#  3        Y X Z NAME CY CX CZ                 4

#  4        NAME X Y Z                          3

#  5        NAME Y X Z                          3

#  6        X Y Z NAME                          4

#  7        Y X Z NAME                          4

#  8        X Y NAME                            3

#  9        Y X NAME                            3


# Format  - Coordinate format

# 0         State plane

# 1         UTM

# 2         Geographic Decimal Degrees


# SpZone  - State plane zone


# Datum   - Datum

# 0         NAD1927

# 1         NAD1983


# UtmZone - UTM Zone

# 1-60      Utm zone number


# Units   - Coordinate units

#  0        Us Foot

#  1        International Foot

#  2        Meters


Layout  4

Format  0

SpZone  901

Datum   0

UtmZone 17

Units   0


        5  1862600.861000   724626.555000   807.1600

       14  1862956.537000   726104.024000   810.4900

       27  1862097.709000   729995.080000   793.1600

       29  1865529.981000   731805.394000   808.5700

       30  1861813.412000   731226.056000   794.1000

      103  1875804.906000   722601.108000   894.5390

      104  1876434.487000   726668.853000   899.2450

      107  1868807.915000   727037.911000   797.9120

      110  1873497.612000   726632.340000   912.9600

      227  1863885.554000   727376.236000   810.9500

      528  1864669.954000   723806.413000   816.2600


Back to Top


Import the Camera Position and Orientation Solution

To import the Photoscan camera positions and orientations (EOs) click on the 'Import EOs' button on the 'Orientations and Control' tab of the project wizard.  A windows browse dialog will be opened.  Select the "Bingo" file type from the combo box on the bottom right of the window and then navigate to the EO file saved in step 1.  A message box will appear that lists how many of the images were correctly read from the input file.  The entries in the table under the heading 'Exterior' will also change to 'Yes' indicating that an image has an exterior orientation (EO).  See 'Import, Exterior Orientations' for more general EO importing information.


At this point, images have fully defined orientations and it can be determined if control points project into the images.  The number of control points that project into each images is listed in the table under the heading 'Ctl Pts'.  The entries in the table are sortable by the values in each column.  To sort them by the number of control points, click on the 'Ctl Pts' header (It may be necessary to click it twice to sort the image in descending order by the number of control point).  Double clicking on non-zero values in the 'Ctl Pts' column will allow you to view thumb nails of the control points in the images that they project into.  Viewing some of these thumbnails is a way to verify that the control, camera definition, and image orientations have been oriented successfully.


Back to Top


Import the Measurements

The Photoscan image measurements are importing by selecting 'Import Measures' from the import menu on the main command ribbon.  Chose the "patb" format and navigate to image measurement file saved in step 1.




A dialog will be displayed which allow the setting of the At Measurement Import Parameters.




Point name prefix - Optionally add a prefix to all NON-CONTROL point names.  For this reason it is essential to define the control point file before running this import.  Adding the default "AT0_" to the point names causes the software to see the imported points as automatic tie points.  Automatic tie points can be winnowed, deleted, etc. more easily than points that the software believes are manual measurements.

Point name postfix - Optional post fix to all NON-CONTROL point names.  For this reason it is essential to define the control point file before running this import.

Overwrite existing points - If checked all previous image points will be deleted.

Remove GCP_ point name prefix - Pix4D adds this prefix to control point measurements in its tie point files.  It is usually convenient to remove it so that the point names in the tie point file will match those in the control file.  If not importing from Pix4D it is best to uncheck this box.


Back to Top

Run the Bundle Adjustment

Run the bundle adjustment from the 'Adjust' menu on the main control ribbon.  It is not required to open layout, or view images, or anything else.  However, opening layout to verify the point layout, make additional measurements of control point, etc. is advisable.




There will be a prompt for user parameters and after iterating the bundle final tweaking window will open.


Back to Top