Derives and stores statistical parameters describing the local distribution of a point attribute for each point of an ODM.
The aim of opalsPointStats is to scan a point cloud stored in an ODM file (inFile) and to analyze the distribution of a selected point attribute (attribute) within a local neighbourhood (searchRadius). The derived statistical measures (feature) are stored as additional attributes of the current point. The module computes one or more statistical features within a single run. The point neighbourhood can be defined in 2D, 2.5D or 3D (searchMode), i.e., points are selected within a infinite vertical cylinder (2D), a finite vertical cylinder (2.5D) or a sphere (3D). For details on how to define the shape of the query cylinder please refer to parameter searchRadius.
The selected statistical features are calculated by aggregating the signed attribute deviations of the feature point and its neighbours from a reference model (refModel). The following reference models are supported:
zeroPlane: Whereas the three other reference models deliver 'relative' values, this models aggregates the 'absolute' attribute values. Hence, this reference model is often used to derive features like min, max, mean, median, minority and majority. Attention: Please note that this reference model is NOT the default model (see reference model horizontalPlane)
horizontalPlane (default): The vertical attribute deviations w.r.t the attribute of the feature point are aggregated.
tiltedPlane: The tilted plane mode is only available for elevations (i.e., attribute=z). In this case, the orthogonal distance w.r.t a local surface tangent plane passing through the feature point are aggregated. The module uses existing local normal information (NormalX, NormalY, NormalZ; see Module Normals) for tilting the local plane. Considering the local slope helps to distinguish, e.g.,
low vegetation areas from smoothly sloped regions. However, the tilted plane is only used if the standard deviation of the plane fitting (sigma) is below the given threshold (maxSigma). Otherwise the module drops back to the horizontal plane model. Please note that the orientation of normal vector is relevant to the computation in case of slope adaption. Positive distances are computed for points within the positive half-space of the normal vector. The other half-space will result in negative distances. Thus, the horizontal plane mode is a special case of the more generic tilted plane with a fixed normal vector of (0|0|1).
grid file: In this case, the vertical deviations to a grid/raster model are aggregated. The raster must be provided in GDAL readable format (gridFile).
Currently, the following statistical features are supported (also see opals::StatFeature::Type for further details):
Consequently, features like min and max represent relative rather than absolute values, and therefore, cannot be directly compared with the point attribute values (c.f. Figure 1)
The computed statistical features are stored as user-defined attributes (see ODM as a database table) within the current ODM using a fixed attribute naming schema. For the zeroPlane reference model the attribute is composed of _ + attribute name + feature name, whereas for the other reference models _d is used as prefix indicating the relative nature (d for difference) of these statistical values. Both, the attribute and feature name start with a capital letter. A few examples are listed below:
Please note that running Module PointStats multiple time with the same attribute/feature combination but with different filters will not change the name of the derived ODM feature and, thus, overwrite the existing feature. User Module AddInfo in this case to copy/backup previously calculated attributes.
Possible values: d2 ..... Search based on 2D coordinates (x and y) only d3 ..... Search based on full 3D coordinates (x,y and z) d2_5 ... Search based on 3D coordinates but with different horizontal and vertical scalesFeature computation searches data within a infinte cylinder (d2), a finite cylinder (d2_5) or a sphere (d3).
Possible values: automatic ... derived mode from attribute type real ........ allow arbitrary bin width values integer ..... limits bin width and centers bins to natural numbersFor features aggregated into bins like minority and majority, the bin center is used as representative value. The same applies to procMode=integer, where the bin limits are shifted by half the bin size so that the corresponding integer value is located in the bin center. With procMode=real the bin limits are mutiples of the bin sizes, which is suitable for processing features of floating point (real) type. In automatic mode the module selects real or integer procMode based on the attribute type.
Possible values: weightedAverage .... weighted average (low pass filter) simpleAverage ...... simple average (low pass filter) nearestNeighbour ... nearest neighbour bilinear ........... bi-linear interpolation bicubic ............ bi-cubic interpolation never .............. indicator avoiding resamplingMethod to be used for resampling the input grids to the specified grid structure of the output grid. This option is only considered while using a grid file as reference model (see option refModel).
The data used in the following example are located in the $OPALS_ROOT/demo/
directory. In this example, the dataset fullwave.fwf
containing full waveform ALS point data (x, y, z, gps time, amplitude, echo width, echo nr, echo qualifier) of a wooded area is used. First, the data have to be imported into the ODM.
In the first example only the mandatory parameters inFile, feature and searchRadius are specified. The following command computes and stores the local minimum values as _dZMin attribute
Using Module Info
the newly computed attribute can be inspected (on the screen or within the log file).
The attribute statistics clearly show that _dZMin is NOT an absolute (refModel=horizontalPlane), but a relative measure. If absolute values are required one can use refModel zeroPlane to compute this information.
As before, opalsInfo helps to check the computed results.
In general, opalsPointStats extracts point features that can be used for point classification. In the following example a simple strategy is shown to separate tree canopy points from the overall point cloud. LIDAR data of vegetated areas
typically show a significat height variation. High range values will reflect high vegetation. On the other hand, the rank feature describes the relative vertical position of a point. Therefore those two features are appropriate measures to classify vegetation.
The following command computes the two features for the given demo data set:
Making use of the new attributes within a filter, tree canopy points can be e.g. exported into a LAS file. The following command exports all points with a local hight spread of at least 5 [m] and a relative position withon the search sphere of more than 90% as tree canopy points into pts_canopy.las
. By simply inverting the defined filter all other points are written to pts_rest.las
:
Using an appropriate visualisation tool (e.g. FugroViewer) the result can be inspected as shown below