FME Version
Introduction
If you already have a point cloud dataset that is classified but want to make sure there are no errors in this classification, how would you find the outliers with FME? This article is here to show you various methods of achieving clean point cloud classifications. See Re-classifying a Point Cloud in FME to learn how to classify a point cloud.
You can create the workspace on your own or follow along with the completed workspace, which can be downloaded from the Files section on this article.
Step-by-step Instructions
Above is an image preview of what this method looks like and what transformers are being used. We first have to make sure that we have a point cloud dataset that already has a classification for us to analyze. If you do not have one of your own, you may find the dataset used in this article in the Files section.
This is the recommended method for a point cloud of any size. If you have a smaller dataset or tiled point cloud, see Other Methods for Smaller Datasets for additional methods.
1. Open FME Workbench
Open FME Workbench and click New to create a new workspace.
2. Add the Point Cloud Data
Add a LAS Reader and browse to the dataset or drag and drop the LAS dataset onto the canvas. (D11.las)
3. Filter by Classification Component
Add a PointCloudFilter to the canvas and set the expression to: @Component(classification)==6 and name the output port to building
4. Convert Point Cloud to Raster
Add a NumericRasterizer to the canvas and connect this to the building output port of the PointCloudFilter. In the parameters, set the Resolution Specification to Cell Spacing and X and Y Cell Spacing to 1. Leave the rest of the parameters as default values.
5. Evaluate the Raster
Add a RasterExpressionEvaluator transformer to the canvas and connect it to the NumericRasterizer. In the parameters, set the Mode to One Raster and set the Band Expression to: if(A[0]==0,0,100) and the Interpretation to UInt32.
6. Add a RasterConvolver
Add a RasterConvolver to the canvas and connect this to the output port of the RasterExpressionEvaluator. In the parameters, set the Convolution Filter to User Defined. If you are using your own data, you may choose to customize this to suit your needs. For our example, we will be using these weights and parameters:
- Size: 3 x 3
- Divisor: Sum of Kernel Weights
- Operation: Sum
- Weights:
1 | 1 | 1 |
1 | 10 | 1 |
1 | 1 | 1 |
7. Evaluate the Raster (Again)
Add another RasterExpressionEvaluator transformer to the canvas and connect it to the RasterConvolver Output port. In the parameters, set the Mode to One Raster and set the Band Expression to: if(A[0]<=45,1,0) and the Interpretation to UInt32.
8. Set Point Cloud Component
Add a PointCloudOnRasterComponentSetter transformer to the canvas. Connect the Output port from the RasterExpressionEvaluator_2 to the Raster input port and connect the PointCloud input port to the building output port from the PointCloudFilter in step 3.
In the parameters, set the Components to Set to Custom and Interpolation Type to Bicubic. See table below for configuration. Leave all the other parameters as default values.
Band | Component | Default Value |
---|---|---|
0 | outlier | 0 |
1 |
9. Filter by Outlier Component
Place a second PointCloudFilter transformer on the canvas and connect it to the PointCloudOnRasterComponentSetter output port. Input this expression: @Component(outlier)==1 and name the output port outlier. The cleaned classified point cloud will exit the <Unfiltered> output port.
Other Methods for Small Datasets
These are less recommended but are valid options if the first option is not sufficient for your scenario. Before attempting these next methods, consider breaking your data into smaller pieces with transformers such as a Tiler or Sampler.
Method 1: Point Cloud to Points Method
This method takes your point cloud classification as input and uses these transformers:
The limitation with this method is that as of the 2022 version of FME, the NeighborFinder does not operate using Bulk Mode. It takes each individual point and compares it to every other point, which could take up a lot of computing power depending on the amount of data in your point cloud classification.
Method 2: Vertical Outliers Method
Similar to the previous method, this uses the same transformers and adds a CoordinateSwapper transformer before and after. This method has the same limitations as the previous method but has the advantage of being able to look for vertical outliers.
A similar method to find vertical outliers using the CoordinateSwaper transformer can be found in this article: Removing Noise in Point Clouds.
Method 3: Point Cloud Clipper Method
This method takes your point cloud classification as input and uses these transformers:
- NumericRasterizer
- RasterExtentsCoercer
- Deaggregator
- DonutHoleExtractor
- Generalizer
- Tester (@Area() > Threshold)
- Clipper (Candidate = Original Classification, Clipped by Tester Output)
The limitation of this method is with the Clipper. As of version 14 of the Clipper (FME 2022), clipping point clouds and rasters requires holding the entire feature in memory. This is often solved by using a Tiler transformer beforehand so that each feature of the Candidate passed in is more manageable.
Additional Resources
- Removing Noise in Point Clouds
- Tutorial: Point Cloud Transformations
- Re-classifying a Point Cloud in FME
- Tutorial: Getting Started with Point Clouds
Data Attribution
The data used here originates from open data made available by the City of Coquitlam, British Columbia. It contains information licensed under the Open Government License - Coquitlam.
Comments
0 comments
Please sign in to leave a comment.