Data Processing Archive v2

From Ecosynth Wiki
Jump to: navigation, search

This page was archived on 2014-07-31 by JPD. Refer to Data Processing for the latest instructions.

The Ecosynth data processing pipeline covers the steps necessary for preparing for a data collection mission, processing images into a 3D point cloud, then post-processing the point cloud data into useful data products like canopy height models (CHMs), digital terrain models (DTMs), maps of forest biomass density, and more. This is the most current version of the pipeline; for previous versions including retired platforms and procedures visit the Data Processing Archive.


Flight Planning

There are a number of perimeters that need to be taken into account while creating a flight path.

  • Generally flight paths represent a tradeoff between altitude, area, and time.
  • Tests have shown the following approximate maximum safe flight times carrying the appropriate number of 5000 mAh 14.8V lipo batteries, Astro dog tracker, and Canon SD4000 camera.
    • 10 minutes (approx. 3.0km) with a UDrones A-RTF Arducopter Hexacaopter carrying one battery
    • 12 minutes (approx. 4.0km) with a Hybrid Mikrokopter-Arducopter Hexacopter carrying one battery
    • 30 minutes (approx. 8.0km) with a Hybrid Mikrokopter-Arducopter Octocopter carrying four batteries
    • 17 minutes (approx. 5.0km) with a 3D Robotis X8 carrying one MaxAmps 11000mAh battery.
  • There is a minimum of 75% side overlap of the images required in order to create the aforementioned data products.
  • Use the SD4000 parameters table to identify rough estimates of flight height vs. image overlap and track width requirements.
    camera_model excel spreadsheet
  • It is necessary to have basic information about the changes in terrain at the site, the height of trees and other features.
    • Flying height based on the parameters table should be estimated from the 'highest' object in the flight path.
    • Consider the height of where the copter will be launched from in relationship to the tallest features.
  • For example: A typical Ecosynth scan using a hybrid copter covers an 250m x 250m area of interest (AOI) flown 80m above the 40m high forest canopy with 25m track widths.

There are two main methods for creating a flight plan; directly in APM Mission Planner or in a GIS (we use ArcGIS) which is then uploaded to Mission Planner. For our purposes the second method is preferable despite taking more time and requiring GIS software because it allows higher user control in waypoint placement.

Design Flight Plan in Mission Planner

  1. Open Mission Planner and select “Flight Plan” in top menu bar.
  2. Locate your AOI by one of the following methods
    1. Right-click APM screen, select “Map Tool”, select “Zoom to”, type AOI location, and zoom as needed.
    2. Using Google Earth find the latitude and longitude coordinates for the center of your (AOI) and enter them in the home location.
    Right-click APM screen, select “Draw Polygon”, select “Add Polygon Point”. Add 4 points around your AOI. The location of these points can be altered by dragging them.
  3. Generate Waypoints by one of the following methods
    Method 1: SimpleGrid:
    Right-Click APM screen, select “Auto WP”, select “SimpleGrid”. A series of pop-up windows requiring values will appear.
    1. Relative Altitude- Height above launch point (canopy height + camera_model height)
    2. Distance between lines- Tract width
    3. Put a WP every x distance- Helps keep copter on straight flight path or to loiter along path. We find the copter does not deviate from path and enter -1 for our flights.
    4. Enter the line direction- To find the azimuth Left-click on a Polygon Point (note that nothing will appear on screen yet), right-click APM screen, select “Map Tool”, select “Measure Distance” (a point will be added), left-click on Polygon Point adjacent to first Point (again no point will appear), right-click APM screen, select “Map Tool”, select “Measure Distance”. The “AZ” value is the “Line Direction”
    Method 2: Survey(Grid):
    Right-Click APM screen, select “Auto WP”, select “Survey(Grid)”. A window will appear for generating waypoints.
    1. Coming soon.
  4. Change APM default values
    1. WP Radius- This is the minimum distance in meters the copter needs to be from the waypoint to be considered to have reached it before it continues to the next waypoint. This value is much too high for our purposes and should be changed to 5.
    2. Default Alt- This is the default height above launch point the copter will maintain in RTL (return to launch mode if RTL @ def Alt is checked. This height should be the same as your highest waypoint height.
    3. RTL @ def- If unchecked the copter will maintain the altitude it was at when switched to RTL. This this left checked so the default altitude is maintained.
    4. Verify Height- If checked Mission Planner will utilize Google Earth topography to adjust the copter altitude to the set altitude above the ground height beneath. For example, if you fly over gullies or hills the copter decrease or increase the altitude accordingly to maintain the set altitude above the ground. If left unchecked the copter will be kept at a constant height above the launch point altitude. This box should be checked.

Design Flight Plan in GIS

  1. Create AOI boundary layer using one of following methods:
    • Import existing high resolution imagery and create a new polygon, rectangle with right-angles, around the AOI.
    • The AOI boundary layer needs to be a rectangle with right angles and cannot be created in Google Earth alone. First, create a polygon around the AOI in Google Earth, export as KML/KMZ, and convert to layer in GIS. Then, create a new AOI boundary polygon, rectangle with right-angles, which contains the first polygon.
  2. Determine flight path specifications: altitude, buffer length, tract width
    1. Refer to camera_model spreadsheet and enter the lengths of major and minor flying axes. Chose the track width that optimizes flying time while staying under the FAA 120m altitude limit.
    2. Round off the minor flying axis length so it is a multiple of the tract width
  3. Create flight waypoints
    1. The copter will fly in a lawnmower pattern along the major axis therefore, waypoints tract width apart are needed along the minor axis. I use the Construct Points editor tool for this.
    2. Place an additional waypoint in the estimated launch location. This waypoint can be amended in the field once exact launch area is reached.
    3. Ensure the waypoints are in correct flight order; launch, path endpoints, landing.
    4. Calculate geometry of waypoints using geographic coordinate system in decimal degrees. I typically use WGS84.
    5. Export attribute table as .csv file.
  4. Build APM waypoint file
    1. Open the .csv waypoint file in excel and construct a 12 column spreadsheet in the following format. Note- it is easiest to format Columns I & J first.
      • Column A-“QGC WPL 110” header followed by waypoint numbers starting with “0”
      • Column B- no header, “1” in B2 followed by “0”s until the last waypoint (launch/landing site) is reached which is “1” then “0”s in remaining 2 rows
      • Column C- no header, “0” in C2 followed by “3”s until the last waypoint (launch/landing site) is reached which is “0” then “3”s in the remaining 2 rows.
      • Column D- no header, “16” in D2, “22” in D3, “115” in D4, “16” in D5, followed by alternating “115”& “16” until the last waypoint (launch/landing site) is reached which is “16” then “115” & “21” respectively in the remaining 2 rows.
      • Column E- no header, “0” in E2 then followed by alternating “0”& azimuth value in remaining rows
      • Column F- no header, “0” in all remaining rows
      • Column G- no header, “0” in all remaining rows
      • Column H- no header, “0” in all remaining rows
      • Column I- no header, launch/landing site latitude in I2, “0” in I3, “0” in I4, 1st waypoint latitude in I5, “0” in I6 followed by remaining waypoints; each separated by a “0” ending with the launch/landing site latitude and “0”s in the last 2 rows
      • Column J- no header, launch/landing site longitude in I2, “0” in I3, “0” in I4, 1st waypoint longitude in I5, “0” in I6 followed by remaining waypoints; each separated by a “0” ending with the launch/landing site longitude and “0”s in the last 2 rows
      • Column K- no header, “0” in K2, flight height above launch site in meters in K3, followed by alternating “0”& flight height in remaining rows until last waypoint (launch/landing site) is reached which is “height” then “0”s in the remaining 2 rows.
      • Column L- no header, “1”s in remaining row
    2. Export as tab delimited text file.
      • This is an example waypoint file of a short mission on UMBC campus.
0 1 0 16 0 0 0 0 39.25806 -76.70570 0 1
1 0 3 22 0 0 0 0 0 0 131 1
2 0 3 115 38 0 0 0 0 0 0 1
3 0 3 16 0 0 0 0 39.25866 -76.7056 131 1
4 0 3 115 38 0 0 0 0 0 0 1
5 0 3 16 0 0 0 0 39.25768 -76.7067 131 1
6 0 3 115 38 0 0 0 0 0 0 1
7 0 3 16 0 0 0 0 39.25754 -76.7064 131 1
8 0 3 115 38 0 0 0 0 0 0 1
9 0 3 16 0 0 0 0 39.25852 -76.7053 131 1
10 0 3 115 38 0 0 0 0 0 0 1
11 0 3 16 0 0 0 0 39.25838 -76.7051 131 1
12 0 3 115 38 0 0 0 0 0 0 1
13 0 3 16 0 0 0 0 39.2574 -76.7063 131 1
14 0 3 115 38 0 0 0 0 0 0 1
15 0 3 16 0 0 0 0 39.25726 -76.7061 131 1
16 0 3 115 38 0 0 0 0 0 0 1
17 0 3 16 0 0 0 0 39.25824 -76.7049 131 1
18 0 3 115 38 0 0 0 0 0 0 1
19 0 3 16 0 0 0 0 39.25806 -76.7057 131 1
20 0 3 115 38 0 0 0 0 0 0 1
21 0 3 21 0 0 0 0 0 0 0 1

Data Collection

Before leaving the lab go over the Flight Checklist to insure all field equipment is packed. In order to georeference the points the launch location elevation needs to be collected either in the field using a high-precision GPS unit, such as Trimble, or by extracting the value from a quality DEM in GIS. If using the GPS method it is recommended to start collecting positions point as soon at the launch location is reached.

Prepare Aircraft and Camera

Launch prep

  1. Turn on dog tracker on copter and the hand-held GPS unit
  2. Start up laptop
  3. Launch APM Tool Application
  4. Load the waypoint file
  5. Check that the flight distance is within safety boundaries
  6. Ensure WP Radius, Loiter Radius, and Default Alt have correct values. These tend to revert to default values.
  7. Check voltage on flight lipo battery
  8. Attach lipo to copter with velcro straps
  9. Plug lipo into copter
  10. Plug in laptop 3DR
  11. Check that the laptop and copter 3DRs are communicating
  12. Write waypoint file to copter
  13. Secure dome with zip-tie
  14. Place camera calibration target (Lastolite EZYBalance) in full sun
  15. Set up camera for Continuous Shooting (CS) mode using the simple method (a velcro strap) or the advanced method (CHDK):
    • In order to use the Canon PowerShot ELPH 520 hs for image collection it is necessary to keep the camera in Continuous Shooting (CS) mode throughout the duration of the flight. Conveniently, the camera will keep whatever exposure settings are applied at the first image, maintaining constant exposure throughout the flight. We have two main methods for 'keeping the shutter button pressed' during flight:
    Simple Method
    1. Turn on camera in manual shooting mode
    2. Adjust the function settings by clicking the "FUNC./SET" button
      • Set Light Metering to Spot
      • My Colors off
      • Daylight Auto White Balance is usually suitable
      • ISO between 200 or ISO 400 is usually suitable
      • Program in Rec. Mode
      • Self-Timer off
      • Continuous Drive Mode
      • 4:3 Still image aspect ratio
      • 10M recording pixels
      • Fine Compression
      • Default movie quality
    3. In the menu > Picture Settings:
      • AF Frame: Center
      • AF Frame Size: Normal
      • Digital Zoom: Standard
      • AF-Point Zoom: Off
      • Servo AF: Off
      • Continuous AF: Off
      • AF-Assist Beam: Off
      • Flash off
      • i-contrast: Off
      • Wind Filter: Off
      • Review: Off
      • Grid Lines: Off
      • IS Setting: Continuous,On
      • Date Stamp: Off
      • Face ID Settings: Off
    4. Set the camera to infinity focus (tap the tulip flower, then select infinity)
    5. Lightly tape a small piece of plastic, like a small extra plastic nut from the copter, to the shutter button (make sure not to depress the button
    6. Lightly wrap a velcro strap around the camera body
    7. Point camera at target with ISO 200 or 400 and shutter speed at least as fast as 1/800. Adjust shutter speed & ISO for good exposure on the target. Faster shutter speed is best.
    8. This part takes a little art: You need to use the velcro strap to push down the button while the camera is pointed at the calibration card, securing the velcro strap so that the button stays pressed. Make sure it is snug and can't wiggle off!
    9. Once you have the velcro strap secured, attach the camera to the copter and move on the next step.
    CHDK Method
    • The 'Simple' velcro method described above is very simple, but can be challenging for some people to get right. We also suggest using CHDK (Canon Hackers Development Kit) to enabling scripting of the continuous shooting mode. This does not require using the velcro strap to keep the button pressed.
    1. With CHDK and the continuous shooting script installed on the SD card
      1. Set SD card to lock position
      2. Insert SD card in camera
      3. Start camera in picture preview mode
      4. Navigate in the menu to Firmware Update and active the firmware update -- this initializes the CHDK firmware
    2. Load the fast intervalometer / continuous shooting script in CHDK and check that it is set to never stop taking pictures. You know this is set when additional information is displayed on the screen. This is tricky, so practice it.
    3. Assuming other settings are set as above
    4. Set the camera to infinity focus (tap the tulip flower, then select infinity)
    5. Point camera at target with ISO 200 or 400 and shutter speed at least as fast as 1/800. Adjust shutter speed & ISO for good exposure on the target. Faster shutter speed is best.
    6. Initiate the CHDK continuous shooting mode as per the onscreen instructions
    7. Attach camera to bottom of copter using velcro straps
  16. Time to Fly!

Fly the Mission

The following instructions are for autonomous launch, flight & landing. Instructions for manual launch and landing are in the Data Processing Archive.


  1. Move copter to open launch area
  2. Point red arm (forward) away from you
  3. Turn on transmitter and activate copter moving Throttle switch down and to right and hold there for 3 seconds (A on image below)
  4. Initiate automatic take-off or take-off manually to desired altitude
    1. To initiate auto take-off, apply a small amount of throttle to get the props spinning and then simultaneously switch the GPS and Height switches to their full on positions
      1. GPS 'GO' is position 0 on Flaps/Gyro for the Spektrum DX7 config we use (B in image)
      2. Height lock to position 0 on Gear/Mix switch (C in image)
    2. To do a manual take-off, apply throttle to launch copter to desired altitude
    3. When at desired altitude, initiate the auto mode by simultaneously switching on the GPS and Height switches as indicated above
  5. Once launched in auto mode, move the Throttle switch to the middle position
  6. Watch the unit fly its path. If line of sight is lost rely on the APM tool and the GPS hand-held unit for copter location

Ecosynth spektrum dx7 controls.jpg


  1. The copter will return to the launch location and land autonomously if the above flight plan directions were followed
  2. Allow the copter to descend to a few inches above the ground, then lower the Throttle complete and move the Height and GPS switches to the off position
  3. Deactivate copter by moving Throttle switch down and to left and hold there for 3 seconds
  4. Congratulations!


  1. Turn off transmitter
  2. Turn off camera
  3. Unplug lipo
  4. Turn off dog tracker & hand-held GPS unit if this is the last flight
  5. Verify that the flight photos are complete and uncorrupted
  6. Transfer photos to the laptop
  7. Pack equipment and head home
  1. Download telemetry files (.kmz, .txt & .gpx) from copter to processing computer
  2. Transfer photos to processing computer
  3. Recharge equipment- transmitter, lipo batteries, camera batteries, Garmin dog tracker & GPS hand-help unit
  4. Restock field kits if necessary
  5. Post-process launch location GPS data. This video gives directions for differential correction if using Trimble & Pathfinder Office.

Data Processing

There are 3 steps in creating georeferenced 3D point clouds; generate a 3D point cloud with computer vision, georeference the point cloud, and filter the point cloud. Each of these steps can be accomplished with multiple tools. PhotoScan or Ecosynther computer vision (CV) software can be used to generate the point cloud. Georeferencing can be done by supplying camera position coordinates from GPS in the PhotoScan 'Ground Control' tools or running the Ecosynth Aerial spline script. Filtering is accomplished using the Ecosynth Aerial noise removal script, but can be done as part of the fully automated Ecosynth Aerial Main Pre-processing tool or separated in conjunction with the Telemetry Toolset. Below are instructions for each of the processing options.

Prepare Data for Processing

Download the latest version of Ecosynth Aerial Pipeline Package & run the script corresponding to your operating system. Make sure to follow the Install Steps in the _documentation folder.

Convert Telemetry

If using PhotoScan to georeference the 3D point cloud the .gpx telemetry file downloaded from the copter must be converted to a .csv before processing. This step is not required for Ecosynther.

  1. Select Point Cloud Pre-Processing Tab in Ecosynth Aerial Application
  2. Select the Telemetry Conversion Script in Telemetry Tool Section
  3. Choose the .log.txt telemetry file
  4. Select the appropriate copter telemetry version
  5. Submit
  6. The outputs are sent to the "_outputs" folder in the Ecosynth Aerial Pipeline Package
  7. Cut and paste the project_name_GPSRows.txt to project folder
  8. Open project_name_GPSRows.txt in Excel as comma delimited
  9. Remove all rows beginning with CMD as well as all columns except LAT, LNG & RelAlt
  10. Save as project_name_telemetry.csv file
  11. Add project_name_telemetry.csv file to GIS
  12. Display X(long) & Y(lat) in GCS_WSG_1984
  13. Select telemetry point between first and last turn, export as project_name_telemetry.shp & add to map
  14. Create new attribute table field "adjusted_elev" =(RelAlt-2.2)/1.07 and delete RelAlt field
    • We have found the telemetry reported by the copter to be inaccurate and have calculated this off-set to rectify the issue
  15. Change data frame to a UTM Projected Coordinate System
  16. Create new "UTM_X" & "UTM_Y" fields and calculate their geometry
  17. Create new field "ELEV" and calculate as [launch location(MSL) +adjusted_elev]
    • The launch elevation can be obtained in the field using a high-precision GPS unit, such as Trimble, or by extracting the value from a quality DEM in GIS
  18. Export the attribute table as project_name_GPS_pts.txt

Trim Photo Set

The step must be taken regardless of which CV software you choose. Trimming the photo set to include only photo from first to last waypoint, excluding launch/landing waypoints, can be done visually or aided by CV software.


  1. Examine the photos carefully to locate the location where the copter reaches it's first waypoint and turns to head to the second.
  2. Examine the photos carefully to locate the location where the copter reaches it's last waypoint and turns to head to landing location.
  3. Copy the photos between first and last turn to a separate folder within project folder.

CV Software

  1. Select a subset of photos that includes the first turn of the copter and process this small set quickly in the computer vision software. When the model is complete, you can then see which photo was located at the first turn.
  2. Select a subset of photos that includes the lasts turn of the copter and process this small set quickly in the computer vision software. When the model is complete, you can then see which photo was located at the last turn.
  3. Copy the photos between first and last turn to a separate folder within project folder.

Back to top

Generate 3D Point Clouds with Computer Vision


These instructions are for running Agisoft PhotoScan v0.9.0 build 1584 (13 October 2012). Refer to the the PhotoScan Manual for specific questions and settings. We often use a screen capture software like Cam Studio to monitor the status of the job by placing the progress indicator in a small area near the system date/clock and making a screen capture every 30 seconds. This makes it possible to identify when the job actually finished.

PhotoScan can be used to create ungeoreferenced 3D point clouds that can then be georeferenced with the Ecosynth Aerial spline script or it can georeference the 3D point clouds using camera position coordinates from the copter's GPS telemetry data. If using PhotoScan to georeference the 3D point cloud it can can also be used to create a georeferenced orthomosaic.

Using PhotoScan to Create Ungeoreferenced 3D Point Clouds

  1. Open PhotoScan
  2. Go to Workflow > Add Photos
    • Add the trimmed flight photos
  3. Go to Workflow > Align Photos
    • Use Accuracy: High, Pair Selection: Generic
  4. Click OK and let it run. This could take 8+ hours depending on the number of photos
  5. Once PhotoScan has completed, save the job to your project folder
  6. Export the point cloud
    • Go to File > Export Points: and select a PLY file for export.
    • Generate an ASCII PLY file, not a binary file, and export colors, but not normals
  7. Export the cameras
    • Go to Tools > Export Cameras
    • Generate an XML file or other file type, for example CHAN.

Using PhotoScan to Create Georeferenced 3D Point Clouds

  1. Copy the script, located in the _scripts folder of the Ecosynth Aerial Pipeline Package, to the folder containing the trimmed flight photos
    • This step assigns GPS coordinates to each picture
  2. Copy the trimmed _GPS_pts.txt to the folder
    • Edit the GPS file to be in tab delimited format with "X" "Y" "Z" headers. Ensure there are no spaces in the headers
  3. Run the script in Command Line
    • This script assumes that the GPS_pts.txt and list of pictures are in the same order: i.e., that the first GPS point in the GPS list corresponds to the first GPS flight of the main flight, the last point is the last of the flight, and similarly that the first photo (based on an alphabetical A-Z sort) is the first photo in the main flight and the last is the last.
  4. The rough_camera_XYZ_from_GPS.txt output will be created and placed in the _outputs folder. Copy this file to project folder.
  5. Open PhotoScan
  6. Go to Workflow > Add Photos
    • Add the trimmed flight photos
  7. Upload the rough_camera_XYZ_from_GPS.txt file in PhotoScan Ground Control Tool
  8. Select appropriate coordinate system in Ground Control Settings
  9. Go to Workflow > Align Photos
    • Use Accuracy: High, Pair Selection: Ground Control
  10. Click OK and let it run.
    • PhotoScan takes less time to create a model using Ground Control camera positions, but it may still take a few hours.
  11. Once PhotoScan has completed, save the job to your project folder
  12. Export the point cloud
    • Go to File > Export Points: and select a PLY file for export.
    • Generate an ASCII PLY file, not a binary file, and export colors, but not normals
Create Georeferenced Orthomosaic
  1. Build Geometry
    • Go to Workflow > Build Geometry
    • Refer to PhotoScan Manual for setting corresponding to your particular needs
    • This process can take a few hours to complete
  2. Export the orthomosaic
    • Go to File > Export Orthomosaic
    • Refer to PhotoScan Manual for setting corresponding to your particular needs


Ecosynther is an open source CV software that can be used as an alternative to PhotoScan to create 3D point clouds. A complete set of instruction can be found at the Ecosynther User Guide

Back to top

Georeferencing Point Clouds

Point clouds must be georeferenced before that can be used for analysis. This process involves generating a table of 'coordinate pairs' to base the georeferencing on and executing a custom python script to sequentially georeference the whole point cloud. This step may be skipped if georeferencing was done with PhotoScan in the previous step, if not continue here. Make all Install Steps in the _documentation folder were followed correctly.

Ecosynth Aerial Spline Script

The spline method for georeferencing was developed to enable geocorrection of Ecosynth point clouds when it is not possible to place GCP markers at the site or when GCPs would not be visible, (e.g., in a closed canopy forest).

The idea behind this technique is that the GPS path from the copter telemetry (trimmed to the actual flight) and the path represented by the sequence of camera/photo points from the computer vision software should have the same relative geometry and that the 7-parameter transformation can be solved based by fitting the two paths together.

To accomplish this, the entire aerial GPS track (UTM coordinates) and the entire set of camera positions along the flight path (SfM coordinate system) are fitted to independent spline curves, from which a series of 100 XYZ pseudo-pairs of GPS and SfM camera locations are obtained using an interpolation algorithm (Python v2.7.2, Scipy v0.10.1 Interpolate module) and then used as input for the georeferencing of point clouds using the same Helmert transformation algorithm used in retired the GCP method.

  1. Select Point Cloud Pre-Processing Tab in Ecosynth Aerial Application
  2. Select the Main Pre-Processing Script in Main Pre-Processing Section
    1. Give a project name
    2. Upload the .out file exported from PhotoScan or Ecosynther
    3. Upload the ASCII .ply file exported from PhotoScan or Ecosynther
    4. Upload the .log file from copter GPS telemetry. This is the full, untrimmed .log file
    5. Enter the launch location altitude derived from the high-precision GPS unit or by extracted from a DEM
    6. Submit
    7. The outputs are sent to the "_outputs" folder in the Ecosynth Aerial Pipeline Package

The result will be a report of the internal horizontal and vertical RMSE error of the least-squares optimization as well as a text file of the solved 7 parameters. This 7-parameters info is the most important output of the georeferencing step and is used to georeference the entire point cloud in the filtering stage.

Back to top

Point Cloud Filtering

We are almost done! Before the data can be processed into a CHM, DTM or any other product, it is necessary to apply a final stage of processing and filtering to the point cloud. This stage performs the following tasks and generates the following output:

Function Parameters Output
Coordinate transform of point cloud 7-parameter file
raw ASCII PLY point cloud file
Exports unfiltered, but geocorrected point cloud
Sort out camera points looks for Bundler cameras by RGB value Exports a set of camera points and a set of non-camera points
Global X & Y Filter
(Crop to AOI)
Zscore/SD cutoff value (default:3)
(AOI XY Extents)
Internal point cloud file where extreme X and Y values have been trimmed away
(A soon to be updated version of the script uses an AOI (Area of Interest) as input for cropping the point cloud)
Local Elevation Zscore filter Zscore/SD cutoff value (default:3)
local window size (default:10m)
Exports a new point cloud where height values within 10m x 10m grid with |Zscore| > 3 are discarded
Local Median Filter FilterType (default: median)
local window size (default:1m)
Exports a set of points matching the window size, where only the median elevation value is retained, XY location is the window center

This process is executed entirely within the Python script. The script primarily utilizes functions from Numpy and Scipy to perform manipulations, queries, and statistical computation on the XYZ-RGB point cloud as an array dataset. Currently (2012-09-08) it has some memory issues with large point clouds when run in 32-bit in Windows. This is because it was programmed a little lazily and runs just fine in 64-bit implementations of Python in Linux.
To execute the script:

python point_cloud.ply params.txt

All output is numbered and named based on the stage of the program and located in an 'output' folder within the current working directory. When the script is run successfully, the result is two point clouds (local filter and median filter) that have been georeferenced, noise filtered and are ready for GIS (with the addition of a header, thanks ESRI!) or further analysis. In addition, the script generates PLY files of the output point clouds so that the results can be immediately previewed in Meshlab or a similar software.

Back to top

Generate a Digital Terrain Model

A digital terrain model (DTM) is a raster data layer that represents the ground surface elevation, typically when aboveground features (e.g., trees, forest canopy, and buildings) have been removed through filtering of 3D point clouds. This filtering can be performed with many different tools and algorithms, but often requires as much art as science in order to get the tool/algorithm parameters to work effectively for a dataset.

A DTM is a necessary component of a 3D remote sensing pipeline for measuring tree height. The elevation of the terrain is subtracted from the elevation of canopy points in order to determine true height above ground.

Previously, we used the ALDPAT LIDAR point cloud filtering toolset to apply terrain filtering algorithms to LIDAR and Ecosynth point cloud datasets. Recently, other tools have become available, e.g., LASTools and may be more effective and automated for terrain filtering.

To use a terrain filtering algorithm, import the median filter point cloud text file from the point cloud processing/noise removal output folder and execute the algorithm. A good result will maintain a large number of points and a high mean density (e.g., no large gaps in coverage) and have minimum error compared to a high quality standard like a LIDAR DTM.

Once a point cloud has been filtered to include only ground points, it is necessary to generat a raster DTM.

  1. Add a header to the output file if there is not one already -- typically X,Y,Z is sufficient
  2. Import the layer into ArcGIS, create XY points, and generate a new shapefile of the ground/terrain points
  3. Use interpolation, e.g., Kriging, to generate a raster model from the ground points layer
  4. Crop the raster model to the project AOI

In addition to generating a DTM using a filtering algorithm, it is also possible to use an existing LIDAR DTM. When provided by a LIDAR contractor, these are typically called bare earth products because the contractor has already filtering off the above-ground points.

Back to top

Generate a Canopy Height Model

A canopy height model (CHM) can be a raster or point cloud (vector) dataset where elevation Z values represent the height of that pixel/point above ground. This is different from the output of the point cloud filtering process that generates a point cloud representing the surface model where each elevation Z value represents height above mean sea level (or geoid or ellipsoid, depending upon the reference datum used).

The CHM is an important data product of the Ecosynth 3D remote sensing pipeline as it is a common dataset used for estimating biomass density, parameterizing fire models, mapping tree crowns and gaps, and predicting species diversity.

Creating a CHM is very simple once a DTM has been created or if an existing LIDAR DTM/bare earth data product is used.

  1. Add a header to the the local filtered point cloud text file that is in the output folder of the point cloud filtering process
    • The header can be simple: X,Y,Z,R,G,B -- but is necessary for ArcGIS to be able to import the file
  2. Import the file into ArcGIS as a text file, and create XY events using the X, Y, and Z fields and in the correct coordinate system. Refer to the ArcGIS help if you are unsure about importing XY coordinates.
  3. Export the XY events layer as a new shapefile
  4. Add in your DTM raster model for this area
  5. Use the Spatial Analyst tool 'Extract values to points' to assign a DTM elevation value to each point cloud point -- this creates a new shapefile with a field RASTERVALU that represents the DTM pixel value below that point
  6. In the new layer that is created from the last step, add a new field 'HEIGHT' (float) and subtract the RASTERVALU from the point Z value
  7. Ta-da! You have now created a layer that shows canopy height instead of elevation!

From here you can perform several additional tasks, including creating a CHM or extracting point cloud height statistics per forestry plots, as we did in our papers.

Back to top

Compute Point Cloud Grid Stats

If you want to generate a raster CHM from this dataset, it is recommended that you perform an additional stage of analysis to remove some of the complexity of the data. In this stage the CHM point cloud will be analyzed to extract information about point cloud statistics (count, density, mean/max/min/etc height) within 1m x 1m bins. This is useful because kriging or other types of analysis of the millions of points in a point cloud is very difficult for ArcGIS. By reducing the number of points in the point cloud, it is a lot easier for ArcGIS to produce useful raster maps: e.g., point density maps, CHM maps, etc.)

To extract grid statistics from the point cloud:

  1. Export the CHM point cloud table as a text file
  2. From the command line, execute the grid_stats script:
    python CHM_point_cloud.txt

The result will be a text file point cloud with X and Y values representing the center of 1m x 1m bins across the extents of the study area, within point cloud statistics for each bin. This can then be added back into ArcGIS as an XY layer, which can then be exported as a shapefile and interpolated into CHM and density maps.


An archive of this wiki page is located at Data Processing Archive and includes older data processing instructions used in the project, including procedures for using Mikrokopter flight control (ca. 2010), and older processing scripts that have been replaced by the tools available at

Back to top