Quantcast
Channel: User JRR - Stack Overflow
Viewing all articles
Browse latest Browse all 50

Answer by JRR for Compute eigenvalues for large point clouds as quickly as possible with R

$
0
0

The problem of point_metrics() is that it calls user's R code millions of times and this have a cost. Moreover it cannot be safely multithreaded. The function is good for prototyping but for production you must write your own code. For example you can reproduce the function segment_shape() with point_metrics() but segment_shape() is pure C++ and multi-threaded and is often an order of magnitude faster.

Let try with ~3 millions points. The two examples are not equivalent (different output) but the computation load is almost the same (eigen value decomposition).

system.time({point_metrics(cloud_raw, .stdshapemetrics, k = 20)})#> 110 secondsset_lidr_threads(4L)system.time({segment_shapes(cloud_raw, shp_plane(k = 20))})#> 17 seconds

Also you may be advised to use the adequate function readLAS() as a function of your point-cloud. The previous examples, if read with readTLSLAS(), take 190 and 50 seconds respectively because my point-cloud is ALS. But if you are working with TLS you are better to use readTLSLAS().

Also .stdshapemetrics is nothing else than a wrapper around the C++ you already found. No gain expected.

As a conclusion:

Or go on the lidR repo and ask for a new feature of a native fast eigen value decomposition.


Viewing all articles
Browse latest Browse all 50

Latest Images

Trending Articles



Latest Images