
Now we’ll be using a much smaller filtered dataset. dataset_Z_filtered shape (169862, 3) CPU times: user 3min 16s, sys: 7.14 ms, total: 3min 16s Wall time: 3min 16s In our case, it was the reduction of the number of points by an order of magnitude in 3 minutes - not bad for a few lines of code, given that we made no real efforts for any optimization. With the help of this simple approach, we can greatly reduce the number of points in the cloud in no time even using moderate computing power. %%time def frange(start, stop, step): i = start while i x) &(dataset y) &(dataset 0: datasetfiltered = datasetfiltered >(datasetfiltered.min()+ zfiltered)] if datasetfiltered.shape > 0: dataset_Z_filtered = np.concatenate((dataset_Z_filtered, datasetfiltered)) print(‘dataset_Z_filtered shape’, dataset_Z_filtered.shape) To avoid this let’s divide our point cloud to small vertical parts. But for the rugged terrain, we have to take into account that some ground points can be higher than power lines in different parts of the image due to the ground incline. Power lines are placed high above the ground for safety reasons and to ensure their optimal performance. We need to find a method to eliminate those points that are not power lines. We have to stick to working with a DataFrame instead of a NumPy array due to memory requirements. Matrix manipulation functions are not fully compatible with sparse 3D matrices. But as a matter of fact, a sparse array works great for 2D but fails with 3D data. The obvious thing to do is to use a NumPy sparse array. It will use an enormous amount of RAM for the storage of really sparse data. But the number is too big if you try to convert this DataFrame into a three-dimensional NumPy array, as in this case, we will get a huge 5942479³ = 2.09*10²⁰ array. It is not enough if you want to get to small details. # Open a file in read mode: inFile = (“./LAS/simple.las”) # Grab a numpy dataset of our clustering dimensions: dataset = np.vstack().transpose() dataset.shape We read point cloud data from a las file and check the shape of the actual dataset. Laspy is great for handling point cloud data in Python. import laspy import scipy import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn import preprocessing from mpl_toolkits.mplot3d import Axes3D from matplotlib import path I will use NumPy, Sklearn, Laspy and SciPy libraries for the purpose of cluster formation and matplotlib for visualization. To simplify further categorization, I decided to check how we can form clusters out of these points.

The power line on the picture is actually a collection of points which form certain geometrical patterns. On the other hand, simple geometrical consideration may provide us with means to greatly simplify or even automate such processing.
#Point cloud data manual
However, mapping the points that belong to a power line requires a lot of manual efforts. Power lines are often clearly visible in point cloud visualization. Data for the ExperimentĪs an example let’s use the data generated by an aerial-based LIDAR for the detection of power lines. Therefore, I decided to try what can be done with point cloud data using a simple approach and pretty standard Python libraries (PCL can be used from Python but only so far, since only small subsets can be integrated seamlessly). But it may be too costly for a PoC development.

It makes sense for production-grade products that need high scalability. It often means that you have to dive into the library too deep. Unfortunately, at the moment it is not an easy task to apply the library to some solution of interest. Should particularly mention PCL - a graf of libraries developed by a great international community to provide instruments for both 2D and 3D data for a wide variety of applications.
