Python script preMergeChannelsPointclouds
See also
python.workflows.preMergeChannelsPointclouds

Aim of module

Merges individual spectral channels of a multispectral LiDAR into a multispectral 3D point cloud.

General description

Multispectral and hyperspectral LiDAR (MSL/HSL) systems are breakthrough in laser scanning. Thanks to MSL and HSL technologies, it is possible to acquire 3D point cloud data in more than one spectral channel. Therefore, n dimentional point cloud (denoting to additional radiometric features) could be achieved by MSL systems. In multispectral LiDAR systems, the number of points recorded in each channel could differ depending on the interaction of land object with different wavelengths. Hence, removing the duplicate points (i.e., points with the same coordinate) and then merging the spectral information are essential. On the other hand, combining the point clouds of each channels minimize the number of missing data. Therefore, after merging point clouds of MSL data, a comprehensive multispectral point cloud would achieved, featuring intensity information of all channels for each point in conjunction to coordinate. For more information on the multispectral LiDAR, please refer to the related literature.

Data Processing

In order to merge the spectral information of all channels and create MSL data, nearest neighbor search in 3D space is actively applied in each channel to estimate the intensity values in other wavelengths. Generating a multispectral point cloud from several monochromatic ones is divided into two phases. The following sections give a brief description of the necessary processing steps.

Phase 1: Importing the point clouds of all channels and enhancing intensity contrast

The first phase consists of importing all monochromatic point clouds into separate ODMs. It is recommended to stretch intensity values to improve radiometric contrast. Intensity stretching can be done using upper quantile or lower/upper quantile as are shown in Figure 1 and Figure 2, respectively. In these formula Ai is amplitude value of a point. QL(A) and QU(A) denote to lower and upper quantiles. The default values for QL(A) and QU(A) are 0.01 and 0.99, respectively.

Fig. 1: histogram stretching using upper quantile
Fig. 2: histogram stretching using lower/upper quantile

Phase 2: Merging point clouds of all channels

The second phase involves amalgamating the point clouds of each spectral channel, which may have been stretched previously. This spectral merging process entails iterating through all points which have just single intensity value and searching for the nearest corresponding points in the other channels. Therefore a single ODM file is created. This file encompasses all non-redundant points from monochromatic point clouds, each with a single intensity value. Its creation is achieved through the importation of all ODM point clouds corresponding to laser channels. Afterwards, the missed intensity values for each point within the initial multispectral point cloud which are related to other channels, will be estimated by intensity values of the nearest neighbor points. This can be computed by calling AddInfo module multiple times and performing the spatial queries by defining two filters:

  1. The first filter defines the processing points (for channel 1: FileID==1)
  2. The second filter defines the potential neighbor points (for channel 1: FileID=2/3).

Eventually, the multispectral point cloud is computed.

Parameter description

-channelNames Name of multispectral channel attributes
Type : String
Remark : optional
Description: If not specified, the naming would be done automatically (channel_1, channel_2, ...)
-stretchHisto Doing histogram stretching
Type : Boolean
Remark : optional, default: True
Description: Histogram stretching will not be performed if strtchHisto be False
possible inputevaluates to
1, true, yes, Boolean(True), TrueBoolean(True)
0, false, no, Boolean(False), FalseBoolean(False)
-quantiles upper or lower/upper quantiles for histogram stretching
Type : Floating-point number
Remark : optional, default: (0.01, 0.99)
Description: If one parameter is defined, then intensity values will be stretched to maxValue. Otherwise, they will be scaled to 0-maxValue
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 (.odm)
Type : String
Remark : optional, default: MS_pc.odm
Description: Specifies the name of the merged multispectral point cloud.If not specified, the result will be stored in MS_pc.odm file.
-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/preMergeChannelsPointclouds.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

To run the following example start an opalsShell and change to the $OPALS_ROOT/demo//multispectral directory

Description of data

The MSL data used for the present example were gathered by a Teledyne Optech Titan sensor. This data includes three point cloud of three laser channels operating at 1550 nm (channel 1= SWIR), 1064 nm (channel 2= NIR), and 532 nm (channel 3= green). While for each point only a single intensity (amplitude) value is measured. The radiometric information of the two remaining channels can be queried via merging spectral information and generating the multispectral point cloud. The study area is an area in Sweden (Spatial Reference System: RWEREF99 TM, EPSG: 3006), as is shown in Figure 3-5. The files can be found in the $OPALS_ROOT/demo//multispectral directory

Fig. 3: Channel 1 (SWIR), pd=26.69 point/m2
Fig. 4: Channel 2 (NIR), pd=27.79 point/m2
Fig. 5: Channel 3 (Green), pd=28.88 point/m2

To generate the merged multispectral point cloud run the following command

opals preMergeChannelsPointclouds -inf ch1.laz ch2.laz ch3.laz -channel _SWIR _NIR _Green

The resulting point cloud visualised with RGB colors is shown below

Fig. 6: multispectral point cloud, pd=83.93 point/m2

References

Takhtkeshha, N., Mandlburger, G., Remondino, F., & Hyyppa, J. (2024). Multispectral LiDAR technology and applications: a review. Sensors, https://doi.org/10.3390/s24051669.

Takhtkeshha, N., Mandlburger, G., Remondino, F., & Hyyppa, J. (2024). A Review of Multispectral LiDAR Data Processing.

Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8