Loading [MathJax]/extensions/tex2jax.js
Python script qltAccuracyRegion
See also
python.workflows.qltAccuracyRegion

Aim of module

Performs an absolute accuracy check for entire flight blocks w.r.t. to reference regions (on the ground).

General description

This script is intended to check the absolute accuracy of (laser scanning) point clouds (PCs). For this purpose the absolute accuracy is reported as 3D shifts between the laser points (check PC) and given reference data (reference PC). Since there are no corresponding points between both PCs, these accuracy measures can only be derived for larger groups of points – termed regions. For each region a transformation of the check PC towards the reference PC is computed using opalsICP. The effect of this transformation on the center of gravity of the check PC within each region is then reported as absolute accuracy measure. This is a 3D displacement vector for each region. For this ICP based approach it is required that within each region at least three smooth tilted surfaces (e.g. roofs) with different expositions are present. The resulting accuracy information is stored in a shape file and a text file. The input file for the reference PC defines the boundary of the individual polygons of each region. Before ICP is computed, these polygons from the reference PC are densified with 3D points (using opalsRasterize) where the density is derived from the check PC.

See also
Script documentation

The check PC is a set of ODM files, e.g. the strips of an ALS flight, and is addressed using the parameter -infile.

The reference PC is addressed using the parameter refFile.

The paramters for opalsICP can be set in the configuration file for qltAccuracyRegion. The most important ICP parameter is the transformation type, which defaults to shifts. Other meanigful choices are zShift and rigid. The other options helmert and full are not recommended, as they estimate parameters that make less sense in the context of an absolute accuracy check. Additionally, the maxIter parameter might be adapted by the user. The other parameters are set automatically based on the point density of the check PC.

The following ouput files are generated in the folder defined by outfile:

  • absAcc_overview.txt: A text file containing the following information for each region: The region ID, the coordinates of the region center, the components of the displacement vector and its length (dX, dY, dZ, dS) together with their accuracy. Additionally, the rotation angles with their accuracy, and the number of observations (i.e. correspondencies) used and the standard deviation of the point to plane correspondencies (std(dp)). Note that the information about the rotation angles is only meaningful if rigid was used as transformation type. Additionally, the reference file and the checked input files are listed.
  • absAcc_overview.shp: A shape file containing the centers of gravity of each region. Each point stores the accuracy measures and values listed above for absAcc_overview.txt.
  • A shape file with the regions as multipolygons. Its file name is derived from the input parameter -refFile. This file is only generated in the case if -refFile is a text file or a shape file of simple polygons.

The following parameters are optional for this script and may be specified using a cfg file under the group [script.qltAccuracyRegion]:

  • borderWidth (default 10): The bounding window (X and Y) of each reference region is extended by borderWidth in each of the four directions. This extended bounding window is then used to cut the merged check PCs before applying ICP.
  • regionAttrOnShape (default '_RegionID'): If the reference regions are provided on a shape file, then regionAttrOnShape specifies the attribute name that contains the region ID.

Parameter description

-refFile a file with reference data (txt, odm or shape)
Type : Path
Remark : mandatory
Description: The following options are implemented:
  • A text file of points defining tilted planar areas (polygons). At least three polygons are required to form a region. The format of this text file is: X Y Z ip ir, where X,Y,Z are the point coordinates, ip is the polygon ID within the region of ID ir. These points define closed polygons, which is achieved by connecting the first with the last point with the same ip and ir. The points on the file are expected to be sorted by ir and then by ip. If more than 4 points define a polygon, then these points are required to be ordered clock-wise or counter-clock-wise. In case of 3 or 4 points the ordering is not important and fixed automatically (if required). Comment lines on this file must start with an '#'.
  • A shape file of simple polygons, where tilted planar areas are defined as polygons. All polygons with the same attribute value form a region. The shape file attribute that specifies the region is set by the parameter regionAttrOnShape.
  • A shape file of multipolygons, where tilted planar areas (polygons) are already grouped into regions. Each multipolygon defines a region and the attribute name specified by parameter regionAttrOnShape defines the region ID (which in this case is only used for identifying the stored results.)

Common Package/Script Options
Settings concerning the general options for (package) scripts.
-infile input text file, directory or strip file
Type : Path
Remark : mandatory
Description: As input either the name of an ASCII file (extension .txt) containing the names of the data files (one file per line) or an expression using wildcards to specify the respective data sets are accepted.
-outfile output directory or settings file (.txt)
Type : Path
Remark : optional
Description: Specifies the directory where the final results are stored. If not specified, the results are created in the current working directory.
-tempdir temporary directory
Type : Path
Remark : optional, default: current directory
Description: Specifies the directory where all intermediate results are stored. If not specified, a TEMP subdirectory is created in the current working directory. Additional subdirectories (one per involved module) are created.
-cfg Path to configuration file
Type : Path
Remark : optional, default: $OPALS_ROOT/cfg/qltAccuracyRegion.cfg
Description: The name of a configuration file containing all relevant calculation parameters is expected. If not specified, the default cfg files as provided by the OPALS distribution are used.
-projectDir project directory
Type : Path
Remark : optional, default: current directory
Description: The default project directory is the current working directory, but can be easily changed by this parameter. All path parameters, if not specified as absolute paths, are interpreted relative to the project directory.
-skipIfExists skip processing if result already exists
Type : Boolean
Remark : optional, default: True
Description: Skip processing if result already exists. In order to re-run current script it is useful to repeat the processing only if the respective output does not already exist. This allows for incremental processing of large projects.
possible inputevaluates to
1, true, yes, Boolean(True), TrueBoolean(True)
0, false, no, Boolean(False), FalseBoolean(False)
-distribute determine how many local processes should be used
Type : String
Remark : optional
Description: according to the number chosen as the value, independent processes are being started to parallelise (parts of) the program and therefore enhance the runtime.
Logging Options
Settings concerning the verbosity level of logging.
-fileLogLevel Log level in the logfile
Type : LogLevel
Remark : optional, default: info
-screenLogLevel Log level on screen
Type : LogLevel
Remark : optional, default: info
-logger Logger
Type : Logger
Remark : optional
Description: Logger is usually provided by the opals framework.The user may provide their own logger object, but it has to function in the same way as the opals Logger.

Examples

The data used in the following examples can be found in the $OPALS_ROOT/demo/ directory.

Example 1

opals _import -inFile strip??.laz -o .
opals qltAccuracyRegion -i strip??.odm -refFile cpt_3d_points.txt -t temp -o QC\acc

This example uses the six demo strips strip11.laz, strip21.laz, strip22.laz, strip31.laz, strip32.laz, and strip12.laz. The combined DSM of this strips is shown in the following figure.

Figure 1: Combined zcoding and shading of the area covered by the six ALS strips.

For this example four regions are defined in the reference PC file cpt_3d_points.txt, each containing four tilted (roof) planes. Most of these planes are defined by four points; see the following figure.

Figure 2: Distribution of the points defining the four regions.

The begining of this text files contains a comment about the column semantics, followed by the definition of the first region with its four roof planes:

#       X            Y         Z     PolyId  RegionId
  529570.430  5338703.920   276.590     0     0
  529577.393  5338702.970   276.470     0     0
  529578.105  5338706.689   279.049     0     0
  529570.430  5338707.639   279.063     0     0
  529580.083  5338705.265   278.691     1     0
  529593.138  5338702.495   278.806     1     0
  529594.167  5338707.876   277.130     1     0
  529580.874  5338710.566   277.102     1     0
  529583.960  5338728.369   274.506     2     0
  529587.758  5338727.578   278.184     2     0
  529590.369  5338736.756   278.119     2     0
  529586.888  5338738.814   274.683     2     0
  529589.420  5338727.736   278.115     3     0
  529593.138  5338726.312   274.328     3     0
  529596.462  5338735.965   274.209     3     0
  529593.376  5338736.756   277.013     3     0
  529591.714  5338736.123   278.284     3     0
...

To better understand what the points on this textfile with their polygon and region IDs define, the following figure highlights the polygon boundaries of the roof planes in the four regions (distinguished by different colors).

Figure 3: Polygons and regions defined by cpt_3d_points.txt.

After running qltAccuracyRegion the following files are created in QC/acc of the demo folder:

  • absAcc_overview.txt: A text file containing the following information for each region: The region ID, the coordinates of the region center, the components of the displacement vector and its length (dX, dY, dZ, dS) together with their accuracy, and the rotation angles with their accuracy. Additionally, the reference file and the checked input files are listed.
  • absAcc_overview.shp: A shape file containing the centers of gravity of each region. Each point stores the accuracy measures and values listed above for absAcc_overview.txt; see figure 4 below.
  • cpt_3d_points_multipoly.shp: A shape file with the regions as multipolygons. It is shown in the 3rd figure above.
Figure 4: absAcc_overview.shp loaded in QGIS (black dots) and display of the stored statistics derived for region with ID 1.
@ strip
strip ID of an image (opalsStripAdjust)
@ temp
File path to replace $OPALS_TEMP with.
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8