Structure From Motion (SFM) Photogrammetry Data Exploration and Processing Manual
Structure From Motion (SFM) Photogrammetry Data Exploration and Processing Manual
Structure From Motion (SFM) Photogrammetry Data Exploration and Processing Manual
Processing Manual
Written by Katherine Shervais (UNAVCO) and James Dietrich (Dartmouth)
Collecting data in the field is only the first step in the complete SfM workflow. This manual will
take you through the skills needed to complete assignments for Units 1, 2, and 3. These sections
are not linked to specific projects, so you will need to use your own judgment on what portions of
the manual you need to use for your given assignment. However, the sections on creating a
model are required for every unit. You may complete the steps to generate a model or your
instructor may complete these steps for you. In addition, you can always use the Help menu in
Agisoft Photoscan Pro.
Note: this is accurate as of March 2016 (Agisoft version 1.2). Software updates may result in
portions of this manual becoming out-of-date.
Agisoft has many panes within the main window. The left column contains the Reference pane,
which lists the cameras, markers (ground control points) and scale bars. When something in the
Reference pane is checked, it is used to georeference the model. The left column is also the
Workspace pane (which lists the different parts of the model, like the photos, sparse point clouds,
and dense point clouds) and can be toggled by selecting the tab at the bottom of the column. The
Model pane shows the model as it is; a tab can also appear here to show the Ortho view. The
Ortho view is how you view the products of your model, like the DEM or orthomosaic. The
Questions or comments please contact education AT unavco.org Page 1
Version February 17, 2016
SfM Data Exploration and Processing Manual
Photos pane displays all the photos. The Console shows what model generation operations have
run, are running, and the success of the operation (blue – successful, red – failed). Each of these
panes have their own menu with icons below the pane label. To adapt what is shown in the
interface, go to View – Panes and uncheck or check the panes to have the interface display the
desired panes.
Add photos
Go to Workflow – Add Folder to add photos. You can choose to either add photos or add a
folder; adding a folder is more efficient. Just select the folder that the photos are in and all of
them will come in together. When you add photos that have associated EXIF data (see Section
III), blue spheres will show up for each initial camera location.
*Note: Agisoft often refers to “cameras” when it means “camera positions”.
only want to do a subset of the photos, select “All cameras” and “All Frames” in the
dialogue box and then click “OK”. Sometimes Agisoft may give you a very long time
(hours-days) until completion but generally it will amend that after a few minutes to be a
much short time.
3. The column titled Quality shows values from 0 to 1. Agisoft recommends deleting photos
with a value below 0.5; other workers suggest removing photos with a value of 0.6 or
lower. You can view a given photo in the larger Agisoft pane by double clicking on it in
the “Photo” pane. To remove it, select the photo/s you want to remove, right click and
select “Remove cameras” (think of this as remove camera position).
Masking photographs
Masks can be used for one of two reasons: a) photos include areas that are not of interest (i.e. the
sky) or b) photos contain portions that are blurry, but are primarily clear. Agisoft allows the user
to create masks in the program or import masks created in another program. For more details on
this process, consult the Agisoft User Manual.
Do not crop photos. ONLY mask or delete them.
Warped
Some camera lenses, like the GoPro, have wide-angle lens that distort the scene. Use the
program “Lens” which comes with Agisoft to process all photos to correct for lens distortion.
Even if not using a GoPro, this may be a useful step to ensure accurate model production.
camera, follow the steps below. Make sure you do this step before starting the model, because
the GPS data will expedite the alignment process. If doing a You may do this in an external
program (so the data is linked to the photos forever) or in Agisoft (so the data is linked to the
photos in the program).
Download a program for geotagging
Programs like Geosetter, PhotoLinker, and GPSPhotoLinker take the EXIF data in the photos
and embeds the GPS position into the metadata for each photo. Each software package has its
own workflow; follow the instructions for the program of choice.
In Agisoft
From EXIF:
1. Click the Import EXIF button on the reference pane (shown above).
2. All EXIF data will be loaded and appear in the Model view.
3. If no blue spheres appear in the Model view, check that the Show Cameras button is on
(shown above; when the background is blue or gray, it is on [depending on Mac or
Windows version). This button is located on the Toolbar.
Changing reference
settings
If the coordinate system needs to be changed, click the Settings button on the Reference toolbar
and use the Coordinate System dropdown menu to change the selected coordinate system. This is
the place to enter the accuracy in meters of the camera locations from the geotagger. You need to
check these values based on your individual camera/geotagger. It may be a good thing to update
prior to running the photo alignment to check that the accuracy is correctly listed. There must be
a value other than zero in the marker accuracy box or the photos will fail to align if EXIF data is
used.
Check camera calibration *if using any kind of fish-eye lens, this step is essential
Agisoft uses the data from the EXIF files to extrapolate the camera calibration – these are the
parameters about the camera, like focal length, used as a part of the camera location calculations.
It is possible to adjust the camera calibration parameters to reflect the specific camera used.
1. Go to Tools – Camera Calibration.
2. A dialog box will appear like the one above. At this point, it is necessary to select the
camera calibration group, which is a group of photos Agisoft has determined has the
same set of camera calibration parameters. All of the photos taken will most likely be in
the same group. This is the far left column.
3. Set the pixel size, focal length, and/or camera type if any or all need to be adjusted.
4. If using data from multiple cameras or multiple focal lengths (like the Import CSV
window in the figure at the top of this set of steps), you need to create multiple camera
groups. You do this by right-clicking a photo in the list of images as shown above and
selecting create group. Select all images you would like to add to that group at the same
time.
IV. Alignment
The first step in the model generation process is to align the photos. This process results in a
sparse point cloud and the initial camera locations; both are found using the (Scale-Invariant
Feature Transform) SIFT algorithm.
Align photos
Go to Workflow – Align Photos. A
number of parameters can be set:
1. Accuracy: this refers to the accuracy of the camera locations and is based on the size of
image used in aligning the photos.
a. High: photos are their original size. Recommended for small datasets.
b. Medium: photos are downscaled by a factor of four. Recommended for large
datasets.
c. Low: photos are downscaled by an additional factor of four. Not recommended
for geoscience research purposes.
After the photos are aligned, a sparse point cloud will appear with blue rectangles indicating each
camera position.
If you believe photo(s) are misaligned or there are photos that are not aligned, select these
photographs in the Photos pane (generally location at the bottom of the Agisoft window). You
can then right click and choose the Reset Alignment option, then right click and choose the Align
Selected Cameras option (shown above).
Problems with alignment can generally be attributed to one or more of the following issues:
1. Lack of texture on the surface: homogeneous surfaces are difficult for Agisoft to use for
alignment, as it relies on features that are recognizable to link photos.
2. Low overlap: low photo overlap results in fewer photos with the same recognizable
feature, which makes it difficult to have enough photos to triangulate camera location.
3. Low accuracy: using GPS data helps find the location of cameras, unless the GPS
accuracy is so poor (especially if the scale of the accuracy is greater than the extent of the
model) it inhibits the process by suggesting inaccurate initial camera locations.
4. Low image resolution: Low image resolution also makes the features in photos more
difficult to recognize.
V. Georeference
This section is optional – if ground control points were used as a part of the survey design, this
section will demonstrate how to integrate these into the model for greater model accuracy.
Open the reference pane in Agisoft if it is not already open by View – Reference.
1. Click on the Import button shown above and select the text file with the GCP data.
2. A dialog box will appear called Import CSV (shown above). In this box, set the
coordinate system, delimiter, and columns to accurately import the text file. Uncheck the
Load orientations option in the Columns section; you will likely not have any orientation
data.
5. Scroll through your photographs until you find one with a GCP. Do this by double
clicking the first photo in the Photos pane, then hitting down arrow followed by enter to
bring up the next photo. Right click on the
GCP on the exact place surveyed with the
GPS and say Place Marker (shown
above). A dropdown menu will
appear with the GCP names; select the
correct name.
b. Right click on the marker in the Reference pane and choose Filter Photos by
Marker in the dropdown menu that appears (shown above).
c. Sort through these photos and place the marker accurately in each.
d. If the GCP is not in the photo or inaccurately placed, right click the flag that
appears on the photo and choose Remove Marker from the dropdown menu that
appears.
7. Find the photos pane and click the Reset Filter button shown above.
8. Start the process over from step 5 for two more markers.
9. Click the Update button in the Reference pane to roughly georeference the model based
on these points. This will expedite the process of placing the remaining GCPs.
10. Repeat steps 6b to 9 for all remaining markers.
*note: the Agisoft user manual suggests a slightly different process for integrating
GCPs; each produce the same result but this process is a bit more intuitive.
Optimize alignment
1. Click the View Errors button shown above in the Reference pane toolbar.
2. Expand the width of the pane to see the Error column, which gives the root sum of squares
error for each point. The row titled Total Error gives the root mean squared errors for the
easting, northing, and altitude columns for all points. The example above has very large
error estimates.
Occasionally, the bounding box around the model crops out portions of the sparse point cloud. If
this is the case, use the Resize Region and Rotate Region tools to resize the bounding box area.
This is also useful if you would like to crop the point cloud to include less data, which makes the
processing of the dense point cloud faster.
Dense point cloud
Go to Workflow – Build Dense Cloud. A number of parameters can be set:
The dense point cloud operation fills in all the blank or empty areas in the sparse cloud.
Editing the point cloud
After the dense cloud is created, the points may need to be edited. Some portions of the model
may be inaccurate, or just outside of the region of interest. This is an appropriate time to remove
these points.
1. Agisoft has three selection tools: Rectangle Selection, Circle Selection, and Free-form
Selection.
2. Select the areas that need to be removed.
a. To add to an existing selection, hold the control key.
b. To delete from an existing selection, hold the shift key.
Classifying points
Sometimes it is necessary to ‘classify’ the points in the point cloud into categories like ground
points, vegetation points, etc. It is possible to do this in Agisoft; one application may be to delete
all vegetation points to just show the ground. This can be done automatically or manually.
Automatic point classification:
1. Go to Tools – Dense Cloud – Classify Ground Points.
2. A dialog box will appear. Use this dialog box to select the source data.
1. Surface type:
a. Arbitrary: used for any kind of object; will model complex or oblique surfaces
well.
b. Height field: faster than arbitrary; optimized to model a surface orthogonal to the
reference system Z-axis (i.e. a roughly planar surface). Ideal for producing DEMs.
Generally recommended for geologic applications, as most features surveyed will
be primarily planar (i.e. an outcrop or topography of a landscape).
2. Source data:
a. Dense cloud: default option.
b. Sparse cloud: only use this option if you build mesh before the dense cloud has
been generated. This order of steps is only recommended for initial models, not
final products for analysis.
3. Polygon count: will decimate the model to the number of polygons listed to next option
(high, medium, low).
a. High: Recommended for most datasets; if it takes an excessive amount of time,
use medium.
b. Medium
c. Low
d. Zero: no decimation
4. Advanced:
a. Interpolation: the degree of the generated surface that will be interpolated.
i. Enabled: default. Surface areas will be interpolated a certain distance
around each point. Holes on the surface will still exist, as the surface will
not be interpolated beyond the specified distance. Recommended.
ii. Disabled: No interpolation will occur.
iii. Extrapolated: The surface will be interpolated completely; no holes will
exist.
b. Point classes: Choose all unless points were classified after the dense cloud was
created. If points were classified and you would like to make a model of just the
ground (or just the vegetation) select the appropriate point class.
Build orthomosaic
Go to Workflow – Build Orthomosaic. A
dialog box will appear. A number of parameters
may be set:
X. Exporting data
Exporting point clouds
Point clouds can be exported in a variety of formats from Agisoft: Wavefront OBJ, Stanford
PLY, XYZ text file, ASPRS LAS, LAZ, ASTM E57, U3D, potree, Agisoft OC3, Topcon CL3
and PDF.
Recommended file formats are LAS, LAZ, and XYZ as they work with the vast majority of point
cloud viewing programs and allow for color data to be associated with each point.
Go to File – Export Points. Choose the file type, type of point cloud, and coordinate system.
Exporting DEMs
Go to File – Export DEM – Export GeoTIFF/BIL/XYZ. A number of parameters may be set:
1. Coordinate system: you may choose a different coordinate system than the one GCPs were
recorded in; you may also choose to do this conversion in another program.
2. Pixel size: you may adjust pixel size to be smaller than the suggested value to increase the
effective resolution or larger to decrease the file size.
3. Maximum dimension in pixels
4. Split into blocks: useful for extremely large datasets
5. No-data value: -9999 if the file is going to ArcGIS, NaN is useful for MATLAB. Base this
value on the application you use for post-processing.
6. Region: you may set boundaries for what is included in the export
7. Write KML/Write World: georeferencing information; not needed if GeoTIFF is the file
format. Write KML only works for WGS84 because that is the coordinate system Google
Earth supports.
Exporting orthomosaic
Go to File – Export DEM – Export JPEG/TIFF/PNG.
1. Coordinate system: you may choose a different coordinate system than the one GCPs
were recorded in
2. Pixel size: keep pixel size at the recommended pixel size or greater.
3. Split into blocks: useful for extremely large datasets
4. Region: you may set boundaries for what is included in the export.
5. Compression: specify the compression needed. The exported file will be very large, so it
may be necessary to use an iterative process to adjust the compression for your post-
processing needs.
It is possible to export the files shown above in the export menu. It is also possible to export tie
points (points in the sparse cloud), 3D models, tiled models (to reduce file sizes), NDVI
(normalized difference vegetation index) data and depth maps from the
A useful export is the 3D model in Adobe PDF; this creates a 3D PDF viewable in Adobe
Acrobat. The file is low resolution, but you may rotate the model and zoom in and out within the
PDF.
Report generation
Agisoft has the option to generate a report about the project processing. This report contains
sections on:
• the orthomosaic sketch
• survey data
o number of images
o number of aligned images
o flying altitude
o tie points [points in the sparse cloud]
o ground resolution
o coverage area
o overlap statistics
• camera calibration results
• camera locations error
o X, Y, XY, and Z error
o Total error
o Input and estimated XYZ positions for all locations
• ground control points
o XY and Z error
o Error (root mean square error for XYZ)
Questions or comments please contact education AT unavco.org Page 24
Version February 17, 2016
SfM Data Exploration and Processing Manual
o Projections
o Total error
• DEM
o Resolution
o Point density
• Processing parameters
o Input parameters for each step
o Processing time
Specific parameters for each of these steps depend on the project, and should be set accordingly.
Scale from a scale bar or known distance
If the model is not georeferenced based on the geotagged photos or GCPs, you may add scale
based on a scale bar or known distance (between camera locations or between known locations).
This will be less accurate than using GCPs.
For a scale bar or known distance between two points:
1. Place two markers in the scene at the two points or at the two ends of the scale bar if
markers do not exist in these places. You can place markers following the steps for GCPs
in the georeferencing section.
2. Control-click to select both markers.
3. Click the Create Scale Bar button. A scale bar will instantly be created.
4. If there are more known distances, follow steps 1 -3 again.
5. A list of scale bars will appear in the Reference Pane (along with the list of markers and
the list of camera locations.
6. Fill in the known distance in the distance column.
7. Check all scale bars that should be used for model scaling; then hit the Update button to
apply the scale to the model.
For a known distance between two cameras, follow the same steps as above but select two
camera locations using control-click rather than two markers.
Agisoft has a set of coded targets to use for GCPs and scale. To use these markers, go to Tools –
Markers – Print Markers and specify the desired marker size. For more detail on how to use the
markers, see the SfM Field Manual. The marker type should be recorded. In Agisoft (before
alignment is recommended), go to Tools – Detect Markers. A dialog box will appear, shown
above. Input the coded target type and an initial tolerance value. If the initial tolerance value is
too high or low, adjust and run again. Agisoft will detect the markers and create a list of markers
in the reference pane. If the distance between markers is known, they can be used for scale using
the steps above. If the location of the markers is known, treat them like GCPs and link the GPS
coordinates to the specific markers.
Measuring area and volume on the mesh
If the model has a scale of any kind (geotagging, GCPs, scale bar) it is possible to measure area
and volume in Agisoft.
1. Volume and area calculations are of all material viewable in the model pane. Any
material you do not wish to measure (the field around a hill, for example) needs to be
deleted. Use the selection tools (Rectangle Selection, Circle Selection, Free-form
Selection) to select material to delete and the Delete Selection tool to delete the material.
You may also select the material you wish to keep and then use the Crop Selection tool to
delete all other material.
a. Save a copy of the complete, non-cropped project for later reference before
starting this process.
2. Agisoft will only calculate the volume and area of something that has no holes. Use the
Close Holes tool (Tools – Close Holes) to ensure the model is continuous. A dialog box
will appear. Drag the slider all the way to the right and click ok to close the model.
3. Go to Tools – Mesh – Measure Area and Volume. A dialog box will appear with the
measurements.
Measuring on a DEM: distance, area, volume, cross section, and contours
Measuring features on a DEM is slightly different than measuring on the mesh. Shapes are
drawn on top of the DEM and the area within the shape is used for the measurement.
1. Make sure the DEM is visible by double-clicking on the DEM in the Workspace pane.
2. You can Draw Point, Draw Polyline, or Draw Polygon using the different tool buttons in
the toolbar.
a. To finish a Polyline, double click.
b. To finish a Polygon, put the last point on top of the first point.
c. Finished shapes will appear in the workspace pane.
d. To edit a point, line or polygon, double click the shape in the workspace pane.
This will bring up the Vertex Context menu. From here, you can delete the vertex
or insert a vertex.
3. Measure a point coordinate: hold the cursor over the Point. The height of the point, as
well as its X-Y coordinates, will appear.
4. Measure distance: right-click a Polyline; select Measure from the dropdown menu that
appears. The value in the Perimeter box in the dialog box that appears should be the
appropriate distance
5. Measure area and volume: right-click a Polygon; select Measure from the dropdown
menu that appears. The value on the Planar tab is the area and the value on the volume
tab is the volume.
6. Calculate a cross section:
a. Create the line of section by making a Polyline.
b. Right-click the Polyline and select Measure from the dropdown menu.
c. Go to the Profile tab to see the cross section.
7. Create contours: Go to Tools – Generate Contours. A dialog box will appear. A number
of parameters may be set:
a. Source data: DEM
b. Minimal altitude
c. Maximal altitude
d. Interval
Contours can be show over a DEM or orthomosaic. Contours can also be exported from
the Tools menu.
Bounding box alignment
The bounding box is set at an arbitrary orientation. On occasion, it is useful to modify the
orientation of the bounding box to a specific reference frame. An example python script to do
this is here: https://github.com/geojames/photoscan. This can be run from the command line or
within Agisoft (Tools – Run Script).
Python scripts
Agisoft has provided a number of Python scripts to perform additional tasks on their wiki page:
http://wiki.agisoft.com/wiki/Python . This includes scripts to change the bounding box
orientation (like above), to change the coordinate system to the bounding box, copy the bounding
box orientation, batch export orthophotos, create masks based on specific colors, and
automatically splitting data into chunks after photos are aligned and then merging chunks after
the dense cloud and mesh have been built.