Starting from the Metashape Professional 2.0, the program supports unstructured aerial laser scans data processing. The result of aerial laser scanning is a 3D array of laser reflection points, which can be uploaded to Metashape project and processed.
The tutorial below describes the main workflow processing steps:
- Import Trajectory
- Import aerial LiDAR data
- Trajectory masking tools
- How to reduce the noise of a point cloud
- Aerial LiDAR boresight calibration (in Agisoft Metashape 2.2)
Import Trajectory
The scanning trajectory for laser scan data can be imported in Metashape. The following formats are supported for the trajectory import: Character-separated values (*.txt, *.csv, *.trjt, *.xyz), SBET (*.out, *.sbet), SOL (*.sol), TerraScan (*.trj).
In order to be used properly, the trajectory should be imported to the project prior to the import of the laser scan data. The trajectory file is used to reliably determine the direction of the point cloud normals. If the trajectory file is not used, the normals will be calculated automatically.
1. Select File > Import > Import Trajectory... command to import trajectory.
2. Select the file with the trajectory. For character-separated values formats specify the following parameters: Columns (X, Y, Z, GPS Time), Delimiter (Tab, Comma, Semicolon, Space or other) and Skip rows in the Import Trajectory dialog window. For other formats, the data will be loaded automatically.
3. Click OK button.
The trajectory will be displayed in the Model view and new layer with the trajectory will also appear in the Workspace pane. The trajectory can be displayed as various modes: Solid View, Elevation View, Time View.
In Elevation and Time view modes, the red value corresponds to the largest value, the blue value corresponds to the smallest.
You can show or hide local LiDAR coordinate system axes, select Show Local Axes option on the Toolbar:
Import aerial LiDAR data
The laser scan point cloud can be imported in the following formats: ASPRS LAS (*.las), LAZ (*.laz), ASTM E57 (*.e57), ASCII PTS (*.pts, *.pts.gz), PTX (*.ptx), Stanford PLY (*.ply), Wavefront OBJ (*.obj), Point Cloud Data (*.pcd).
1. To import laser scans select File > Import > Import Point Cloud... command.
2. In the Import Point Cloud dialog box browse to the folder containing the laser scans and select the corresponding files. Then click Open button.
Multiple point clouds can be loaded at the same time. Select all point clouds from the folder with laser scans data for importing. In this case the parameters from the Import Point Cloud dialog window will be applied to all the selected point cloud files.
3. Set the parameters for import and enable checkbox Use as laser scans in the Import Point Cloud dialog window.
The Trajectory option for the Scanner position parameter is available only if the trajectory has been imported to the project prior to the point cloud import.
If the option Use as laser scans was not enabled in the Import Point Cloud dialog window, it is possible to enable this command in the Point Cloud context menu, after it was imported in the project and reflected in the chunk's content on the Workspace pane.
You may choose all point clouds related to the laser scans and apply Use as Laser Scans command.
The following parameters can be changed in the Import Point Cloud dialog box:
- Coordinate System: Set coordinate system from the dropdown list or upload parameters of a customized geographical coordinate system corresponding to the point clouds being imported.
- Coordinate Precision: To specify a custom value for coordinate precision enable Custom option and add the value in the corresponding field. Alternatively use Default option, then Metashape calculates coordinate precision automatically. The calculated value corresponds to the average density value for all points from the point cloud.
- Parameters: To import the point cloud as a laser scan, enable the Use as laser scans parameter. If the point normals are not stored in the files being imported, Metashape would calculate the point normals automatically. To determine the normal of a point in a point cloud, Metashape approximates the local surface of the model with a plane. If the point cloud was obtained in an unstructured form, then Unknown option should be selected in the Scanner Position field. If the point cloud was recorded in a structured form, then the Origin parameter should be selected. If point cloud saves a trajectory file, then use - Trajectory parameter value.
The direction of the approximation plane is determined by the nearby neighbors of a given point. The number of nearby points to consider is defined by Normal estimation neighbors parameter value. If the imported cloud is very noisy, 28 (default value) neighbors may not be enough to determine the normals confidently. For such point clouds, it is worth increasing the Normal estimation neighbors value up to 100. Increasing the number of neighbors will slow down the calculation, smooth out the normals at the corners, but will help to avoid noise. In some cases, increasing the number of neighbors can also help to avoid large plots with the inverted normals.
4. Click OK button to add the data into project.
If the trajectory file was not uploaded before the point cloud import, then it can be applied after the point cloud was uploaded as laser scans. Import the trajectory file (select File > Import > Import Trajectory...), and choose Set Trajectory > Trajectory command from the laser scans context menu.
IMPORTANT! In this case, the normals for the point cloud will not be recalculated taking into account the trajectory, because the normals are calculated only at the point cloud import stage. But using a trajectory for a point cloud will help improve the quality of the model.
The process is shown on the animation below:
To show or hide laser scans in the Model view use Show Laser Scans toolbar button:
Depending on the information recorded in the laser scan data, the cloud can be displayed as various modes: Solid View, Colors View, Classes View, Intensity View, Elevation View, Return View, Scan Angle View, Source ID View, Confidence View:
Based on the imported laser scan point cloud it is possible to perform classification, build DEM and build mesh. For the purpose select Laser Scans as Source data on the corresponding processing step. See an example of the dialog window below:
If the project includes both laser scans data and digital imagery for the same scene, all the data should be loaded to the same chunk and to be processed together. In this case you can also build texture, orthomosaic and tiled model.
Trajectory masking tools
For convenient work with the aerial laser scan (for example, displaying only part of the point cloud, or the exclusion of a turning area), masking tools for the trajectory (Сreate Mask, Mask Selection, Unmask Selection, Crop Mask by Selection, Reset Mask) are implemented in Metashape.
How to create a mask for a trajectory manually
The tools are available in the Tools > Trajectory menu. To apply masking, first select the desired area in the Model view using the Selection tools on the toolbar.
Then select the desired command for masking from the Tools menu (in the example below we used - Crop mask by selection):
Select Tools > Trajectory > Reset Mask command to reset mask:
How to create a mask for a trajectory automatically
It is important that the trajectory file contains information about the angles in order to apply the automatic masking tool. If the trajectory file was imported into the project in versions prior to 2.1.1, then you need to re-import the trajectory file so that the tool is available.
In Metashape, it is possible to automatically mask the trajectory. Select Tools > Trajectory > Create mask...:
In the Create Mask dialog window, you can set the following parameters:
- Heading angle threshold (deg) - the maximum difference between the values of the Heading angle and the points of the trajectory segment.
- Minimal segment duration (s) - minimal duration of the segment.
- Minimal segment distance (m) - minimal distance of the segment.
If a segment is smaller by any of the specified minimum parameter parameters, it is not added to the result.
- Crop segments with point clouds - this option allows to exclude trajectory positions that don't have any corresponding laser scans points.
- Trim ends of segments - this option allows to cut off the ends of the segments where the tuning starts/ends.
To check which of the conventions was in the file when importing the trajectory, you can enable Show Local Axes in the drop-down Trajectory menu on the Toolbar:
How to reduce the noise of a point cloud
Metashape supports the option to smooth point cloud. The tool allows to reduce the noise level of the point cloud. During the smoothing algorithm will consider the neighboring points in some neighborhood for each point of the cloud.
The neighborhood is defined by a sphere with the specified radius. For each point from the neighborhood a plane is considered that is perpendicular to the point's normal, then the original 3D point is projected onto this plane. The effect of the point from the neighborhood is measured proportionally to the distance between the projection of the original 3D point and the considered point from the neighborhood - more distant points have much less effect than close points.
When all the points from the neighborhood are considered the new position of the original 3D point will be determined as the average position of the projections mentioned above, taken with the weight proportional to the discussed distances.
To smooth point cloud:
1. Select an active Point Cloud on the Workspace pane.
2. Choose Process > Smooth Point Cloud... command from the Lase Scans context menu:
3. In the Smooth Point Cloud dialog box set the radius of the ball in in which the approximate position of the point will be searched. Smoothing radius can be set in meters or in points (the point size is comparable to the resolution of the point cloud). For a classified point cloud, it is possible to specify the class in which to perform smoothing.
Smoothing can be applied only in the selected area of the point cloud. Select a part of the point cloud of the selection tools, and then run the tool and enable Apply to selection option:
4. Click OK button to start the procedure. The progress dialog box will appear displaying the current processing status.
To assess noise reduction, we built a profile on a point cloud using the Measure Profile on the toolbar tool. A detailed description of the tool can be found in the article: Measurement tools in Model view
Select Calculate profile tool on the Toolbar. On the point cloud select the point where the measurement should be started by left mouse button click. Then left-click on the second point. To calculate the profile and finish drawing the polyline use the right mouse button click. The profile will be displayed in the Measure Profile dialog window:
Aerial LiDAR boresight calibration
Starting from version 2.2 of Agisoft Metashape Professional, it is possible to perform boresight calibration in Metashape. In most cases, we recommend performing this process.
IMPORTANT: Trajectory file was imported into the project and the point cloud was imported with the trajectory file in mind.
You can visually estimate the displacement of point clouds if the displacement is large in the Model view, or using the profile tool.
On the example below, point clouds are displayed in different colors for convenience. The color for the point cloud can be configured through the context menu of laser scans in the Workspace pane.
The following are examples of several workflows:
- One trajectory file and several aerolidars
- One point cloud combined in third-party software and one trajectory file
One trajectory file and several aerial lidars
To perform boresight calibration, you need to enable the Adjust rotation option on the Lidar Callibration dialog window. Select Tools > LiDAR Calibration:
Click OK button.
Only one set of displacement parameters can be associated with a trajectory. If different displacement parameters need to be applied to several point clouds associated with the same trajectory, then the trajectory will have to be duplicated for each set of offsets. To duplicate the trajectory file, select the appropriate command in the context menu and assign different trajectory files for each point cloud. Then the 2 parts will be displayed in the Lidar Calibration dialog box:
To calculate the values, you need to perform an alignment. Select Workflow > Align Laser Scans. Set Accuracy for alignment and it is important to enable the Reuse local frame option as in the screenshot below:
- Accuracy - at High accuracy setting the software works with the original distance between points, Medium setting causes downscaling by factor of 4, at Low accuracy source files are downscaled by factor of 16, and Lowest value means further downscaling by 4 times more. Highest accuracy setting upscales the distance between points by factor of 4.
- Reset current alignment - if this option is checked, all the key, and matching points will be discarded and the alignment procedure will be started from the very beginning. Uncheck this option to sub align some extra laser scans added to the chunk with already aligned set of laser scans.
- Key point limit - the number indicates upper limit of feature points on every laser scans to be taken into account during current processing stage. Using zero value allows Metashape to find as many key points as possible, but it may result in a big number of less reliable points.
- Vertical axis - set the vertical axis (X, Y or Z) of rotation of the laser scan.
- Reuse local frame - parameter allows to improve the result of key points matching based on the available alignment of the aerolidars.
You do not need to use the Reset current alignment option, because we will refine the values based on the aligned data. And it is also important to enable the Reuse local frame option to improve the alignment of aerolidars.
Click OK button to start the alignment process. The calculated values will be available in the Lidar Calibration dialog window after alignment (select Tools > Lidar Calibration):
The result after alignment on the Model view:
One point cloud combined in third-party software and one trajectory file
There are cases when point clouds were combined in a third-party program and uploaded to the Metashape as one cloud, but there are irregularities at the crossing of routes. In this case, using the trajectory masking tool, you need to divide the point cloud into several parts.
After that, disable the original point cloud so that it is not taken into account. Selects Disable Laser Scans option from the LiDAR context menu on the Workspace pane.
Enable the Adjust rotation option on the Lidar Callibration dialog window. Select Tools > LiDAR Calibration:
To calculate the values, you need to perform an alignment. Select Workflow > Align Laser Scans:
The calculated values will be available in the Lidar Calibration dialog window after alignment (select Tools > Lidar Calibration):