The Opals Point Cloud Labeler (PCL) is an Addon for Opals. The PCL allows the manual classification of 3D Pointclouds.
For the usage of the PCL a license of Opals is required.
To use the PCL the installation of some python packages is required. The installation of those packages is done via the following command line:
pip install -r requirements.txt
For running the PCL please type:
python PointCloudLabeler.pyw
With the PCL it is possible to manually label 3D point clouds. To start the labeling process, the point cloud must be read in. Then an axis has to be defined. The labeling process is performed along this axis. It is possible to define several axes. Once an axis is defined, a polygon is created at the start of the axis. The polygon is normal to the axis. The extension of the polygon depends on the point density of the point cloud. The points inside the polygon are displayed as a vertical slice. This point can now be labeled. Once a section is labeled, it can be moved to the next section. To get a first prediction of the classes, it is possible to predict the classes of the unclassified points of the next section with a KNN tree (kNN - k Nearest Neighbors).
To get an overview of the whole area of the point cloud, a shading is displayed. This shading allows the definition of several axes. These axes can be used to navigate through the point cloud. The overview has a zoom and pan function. Use the mouse wheel to zoom in and out. To pan, press the left mouse button and drag over the shading (1). The PCL sequentially displays a portion of the full point cloud that can be classified (2). To change the active axis, select "Selection Mode". When this mode is activated, the active axis can be changed by clicking on the desired axis. To add a new axis, select "Draw Mode". An axis can then be simply drawn into the overview by clicking inside the shading. The vertices of an axis can be moved, deleted or a new vertex can be added to an axis. This is done by selecting the "Edit Mode". Use the three magnifying glass icons to zoom in and out (3). The different axes are listed with the corresponding information (the number of nodes and the lenght from the respective axis). The ceckbox of the currently active axis is checked. An axis can be deleted by right-clicking on it. The various axes, accompanied by the pertinent information, are enumerated. The deletion of an axis is initiated by right-clicking on the relevant item (4). In order to classify a point cloud, it is necessary to load the dataset. All data types that the Opals Datamanger can process are allowed. Once the data has been read in, it is possible to read in an existing axis datamanger (5). The panel can be used for classification, navigation and to display a greater or lesser number of points. The displayed section can be coloured either by class or by height. The different classes can be selected from a drop-down menu. When a section is classified, the classes of the following section can be predicted via a KNN tree (kNN - k Nearest Neighbors). The number of points displayed can be modified by adjusting the section geometry using the "Across" and "Along" numeric fields. The "Overlap" numeric field allows the user to define the degree of overlap between each section and its neighbours (6). To give a general overview of the displayed section of the total point cloud, some information is displayed. First, the current station of the section is displayed. The other information is about the points themselves (loaded points, classified points, unclassified points and a histogram of the classes) (7). It is possible to cover the whole area of interest with an axis (Axis Generation) (8).
The first line is the path to the laser scan data. The data can be in any format accepted by opalsImport. Once the point cloud has been imported and a shading is displayed we can now define the axes needed to navigate through the point cloud. This can be done in several ways:
Once all points of the current section have been classified, you can select whether a prediction with kNN from the classes of the next section. For a prediction, an empty kdtree object is created with PointIndexLeaf, which represents a spatial leaf with a point index, is created. This kdTree object is filled with the points of the previous section. In the next step, the parameters are defined for how the prediction is to be carried out:
| Parameter | Value |
|---|---|
| nnCount | 1 |
| searchPoint | Coordinates of a point in the new section |
| searchMode | nearest |
| maxSearchDist | -1 |
With the point for which the class is to be predicted, the kdtree object is searched for its nearest neighbor. The maximum search radius is defined as -1. This means that the search continues until a nearest neighbor is found. If a neighbor is found, the class of the neighbor is assigned to the point. A prediction should only be made for those points that are not yet assigned to a class (equals to the value 0). To perform the prediction, select the different options (predict next, predict previous, always predict, no prediction) out of a dropdown menu.
For the editing of an axis the "Edit Modus" has to be turned on:
The axis is stored as a linestring of coordinate tuples: [[x1,y1],[x2,y2],...]
Note: It is only possible to edit the active axis!
By generating axes, the entire area of interest can be covered. To do this, a polygon is created whose corner coordinates correspond to the coordinates of the corners of the area. In the next step, the centre point of this polygon will be evaluated. Once the centre point has been determined, the polygon is intersected by polylines. The distance between the polylines and the angle of rotation of the polylines can be adjusted. Each adjustment results in a preview for a first look at the area coverage. Note that the rotation angles are in degrees! Once the desired configuration has been selected it must be confirmed. It is also possible to export the polylines to a shape file.
The data (strip149.laz) used in the following example is contained in the demo directory and read in.
As mentioned before, it is possible to predict the classification for an unclassified section. This prediction is shown in Figure 9. On the left hand side no prediction has been selected. The predicted classification is shown on the right.
The PCL is still in active development, therefore it can happend that the tool crashes sometimes. If you have trouble getting the PCL to run at all, here are couple of hints:
More information about the PCL can be find here: PCL Git Hub
Bug reports can be sent to the OPALS Team. Please include a short description of what you were trying to achieve, using what type of files, and the text from the error message. Copy-and-paste the messages printed to the console and include them in the bug report. Thank you!