This tutorial illustrates how to perform point cloud classification in Agisoft Metashape Professional in manual and automatic modes and how to produce Digital Terrain Model (DTM). Metashape allows not only to generate and visualize dense points cloud but also to classify the points within them.
There are 3 options:
- automatic ground points classification (classifies dense point cloud based on the user-defined parameters);
- automatic multi-class point classification (automatically classifies dense point cloud to the supported classes);
- classify dense points cloud manually.
Point cloud classification opens the way to customize Build Mesh and Build DEM steps: you can choose what type of objects within the scene you would like to be reconstructed and indicate the corresponding point class as a source data for mesh generation. For example, if you build mesh or DEM based on ground points only, it will be possible to export DTM (as opposed to DSM).
This article describes the following processing steps:
- Automatic Classify Ground Points
- Automatic dense cloud multi-class classification (Classify Points)
- Classify Point Manually
- Filtering points based on points colors
- Build DEM
- Export DEM
If you need guidance on how to build a dense point cloud with Metashape Pro refer to Orthophoto & DEM Generation and follow all steps up to Build Dense Cloud.
Metashape Standard version supports: Select Points by Masks, Select Points by Color, Filter by Confidence, Filter by Selection.
Automatic Classify Ground Points
1. Select Classify Ground Points... command from the Tools > Dense Cloud menu.
2. The following parameters control automatic ground points classification procedure:
- Max angle (deg) - Determines one of the conditions to be checked while testing a point as a ground one, i.e. sets limitation for an angle between terrain model and the line to connect the point in question with a point from a ground class. In fact, this parameter determines the assumption for the maximum slope of the ground within the scene.
- Max distance (m) - Determines one of the conditions to be checked while testing a point as a ground one, i.e. sets limitation for a distance between the point in question and terrain model. In fact, this parameter determines the assumption for the maximum variation of the ground elevation at a time.
- Cell size (m) - Determines the size of the cells for point cloud to be divided into as a preparatory step in ground points classification procedure. Cell size should be indicated with respect to the size of the largest area within the scene that does not contain any ground points, e. g. building or close forest
3. Click OK button to run the classification procedure. Generally automatic classification procedure consists of two steps.
- At the first step the dense cloud is divided into cells of a certain size. In each cell the lowest point is detected. Triangulation of these points gives the first approximation of the terrain model.
- At the second step new point is added to the ground class, providing that it satisfies two conditions: it lays within a certain distance from the terrain model and that the angle between terrain model and the line to connect this new point with a point from a ground class is less than a certain angle. The second step is repeated while there still are points to be checked.
4. Switch to the Dense Cloud to Dense Cloud Classes view mode using the corresponding buttons located on the Toolbar.
5. In case the result of automatic dense cloud classification is not acceptable the procedure can be re-run using adjusted parameters (for example, if some on-ground objects like stones and small bushes were classified as ground points it is reasonable to reduce Max angle and Max distance parameter values).
It is important to reset the assigned classes for the dense cloud prior to starting the procedure again with the new set of parameters. To reset classification results choose Reset Classification option in Tools > Dense Cloud menu and then select point classes you wish to be discarded.
Automatic dense cloud multi-class classification (Classify Points)
Metashape allows for semantic classification of dense point clouds to solve the task of higher-level interpretation of the reconstructed data.
1. Select Classify Points... command from the Dense Cloud submenu of the Tools menu.
2. In the Classify Points dialog box select the source point class for the classification procedure in the From field.
3. Select the target classes from the list in "To" field.
4. Define Confidence parameter in 0 - 1 range. Higher value of the parameter means that the point which class cannot be reliably assigned, will remain unclassified.
5. Click OK button to run the classification procedure.
6. Switch to Dense Cloud Classes view mode using Dense Cloud toolbar button. The result of the filtering will be shown in the Model view.
The list of classes and their colors used in Metashape described below:
Classify Point Manually
1. Switch to the Dense Cloud or Dense Cloud Classes view mode using the corresponding buttons located on the Toolbar.
2. Select points in the Model view to be placed to a certain class using Rectangle Selection, Circle Selection or Free-Form Selection tools.
3. To add new points to the current selection hold the Ctrl key during the selection of additional points. To remove some points from the current selection hold the Shift key during the selection of points to be removed.
3. When all the points to be assigned to any class are in selection, choose Assign Class... command from the Tools menu.
4. In the Assign Class dialog specify source and destination class points. If you need to reset the classification results for selected points, choose Any Class in From field and Created (never classified) in To field.
5. The result of the filtering will be shown in the Model view.
Filtering points based on points colors
To remove points based on point colors.
1. Switch to Dense Cloud view mode using Dense Cloud toolbar button.
2. Choose Select Points by Color... command from the Dense Cloud submenu of the Tools menu.
3. In the Select Points by Color dialog box choose color to be used as the filter.
4. Click OK button to run the selection procedure.
5. The result of the filtering will be shown in the Model view.
6. Select Reset filter command from the Dense Cloud submenu of the Tools menu to cancel filtering by colors.
New when the dense point cloud has been generated it is possible to generate polygonal mesh model based on the certain point classes. To produce Digital Terrain Model (DTM) on ground point class should be used for mesh reconstruction.
1. Select Build DEM command from the Workflow menu.
2. Set the following recommended values for the parameters in the Build DEM dialog. Uncheck all classes except class and click OK button to start building geometry.
3. Here are results of DEM generation based on class:
After the polygonal model reconstruction to export DEM use the standard export instruments.
1. Select Export DEM > Export GeoTIFF/BIL/XYZ command from File menu.
2. Set the following recommended values for the parameters in the Export DEM dialog.
3. Click Export... button and then specify target file name and select type of the exported file (e.g. GeoTIFF).
4. Click Save button to start DEM export.