CSF: Ground Filtering based on Cloth Simulation
Project description
CSF
Airborne LiDAR filtering method based on Cloth Simulation. This is the code for the article:
W. Zhang, J. Qi*, P. Wan, H. Wang, D. Xie, X. Wang, and G. Yan, “An Easy-to-Use Airborne LiDAR Data Filtering Method Based on Cloth Simulation,” Remote Sens., vol. 8, no. 6, p. 501, 2016. (http://www.mdpi.com/2072-4292/8/6/501/htm)
This is a modified version of the Original Code for 3DFin purposes
List of changes:
- Better handling of numpy arrays in the python bindings (avoid expensive copies)
New feature has been implemented:
Now, We has wrapped a Python interface for CSF with swig. It is simpler to use now. This new feature can make CSF easier to be embeded into a large project. For example, it can work with Laspy (https://github.com/laspy/laspy). What you do is just read a point cloud into a python 2D list, and pass it to CSF. The following example shows how to use it with laspy.
# coding: utf-8
import laspy
import CSF
import numpy as np
inFile = laspy.read(r"in.las") # read a las file
points = inFile.points
xyz = np.vstack((inFile.x, inFile.y, inFile.z)).transpose() # extract x, y, z and put into a list
csf = CSF.CSF()
# prameter settings
csf.params.bSloopSmooth = False
csf.params.cloth_resolution = 0.5
# more details about parameter: http://ramm.bnu.edu.cn/projects/CSF/download/
csf.setPointCloud(xyz)
ground = CSF.VecInt() # a list to indicate the index of ground points after calculation
non_ground = CSF.VecInt() # a list to indicate the index of non-ground points after calculation
csf.do_filtering(ground, non_ground) # do actual filtering.
outFile = laspy.LasData(inFile.header)
outFile.points = points[np.array(ground)] # extract ground points, and save it to a las file.
out_file.write(r"out.las")
Reading data from txt file:
If the lidar data is stored in txt file (x y z for each line), it can also be imported directly.
import CSF
csf = CSF.CSF()
csf.readPointsFromFile('samp52.txt')
csf.params.bSloopSmooth = False
csf.params.cloth_resolution = 0.5
ground = CSF.VecInt() # a list to indicate the index of ground points after calculation
non_ground = CSF.VecInt() # a list to indicate the index of non-ground points after calculation
csf.do_filtering(ground, non_ground) # do actual filtering.
csf.savePoints(ground,"ground.txt")
How to use CSF in Python
Thanks to @rjanvier's contribution. Now we can install CSF from pip as:
pip install cloth-simulation-filter
How to use CSF in Matlab
see more details from file demo_mex.m
under matlab folder.
How to use CSF in R
Thanks to the nice work of @Jean-Romain, through the collaboration, the CSF has been made as a R package, the details can be found in the RCSF repository. This package can be used easily with the lidR package:
library(lidR)
las <- readLAS("file.las")
las <- lasground(las, csf())
How to use CSF in C++
Now, CSF is built by CMake, it produces a static library, which can be used by other c++ programs.
linux
To build the library, run:
mkdir build #or other name
cd build
cmake ..
make
sudo make install
or if you want to build the library and the demo executable csfdemo
mkdir build #or other name
cd build
cmake -DBUILD_DEMO=ON ..
make
sudo make install
Windows
You can use CMake GUI to generate visual studio solution file.
Binary Version
For binary release version, it can be downloaded at: http://ramm.bnu.edu.cn/projects/CSF/download/
Note: This code has been changed a lot since the publication of the corresponding paper. A lot of optimizations have been made. We are still working on it, and wish it could be better.
Cloudcompare Pulgin
At last, if you are interested in Cloudcompare, there is a good news. our method has been implemented as a Cloudcompare plugin, you can refer to : https://github.com/cloudcompare/trunk
Related project
A tool named CSFTools
has been recently released, it is based on CSF, and provides dem/chm generation, normalization. Please refer to: https://github.com/jianboqi/CSFTools
License
CSF is maintained and developed by Jianbo QI. It is now released under Apache 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for CSF_3DFin-1.1.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27bb0a3b9c35af255323fef94a80751beffdff4a24f1195ca5776018f3bd17bb |
|
MD5 | 6391f8e7fd7f662924c71c47b38467e6 |
|
BLAKE2b-256 | 2da9ae07fa30deaa30914da0db905b308fce5c0d2aa02c88d1b47e3b34485c2b |
Hashes for CSF_3DFin-1.1.5-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c39aa43a82def488d5663d48cec4928031bf8febc6d2a9ac584edc7d3354dfb |
|
MD5 | 08150d5e39ed693f53c2e54ea90ad62e |
|
BLAKE2b-256 | a2793b5414bf109aaa35835d23a8dfc674856df5f0aaf1f6079e4863d59cc16f |
Hashes for CSF_3DFin-1.1.5-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f55acf0bdb8e72cc894a459e2a742d25b8be5330b8db643a3c1bc17db39fc29 |
|
MD5 | d53bd69d778f639782d1b01e6cf217c9 |
|
BLAKE2b-256 | d6d867b8e4a3c1976e9b452c3199c54c4fa06a361e644c17d39d32beaa8fe72b |
Hashes for CSF_3DFin-1.1.5-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa65a357864c7b4745407c5b1eae0559c425b9782369c2399125b1c1985ca05a |
|
MD5 | 561a7f693c9c8ff52e7cfaea9ee7baeb |
|
BLAKE2b-256 | ff27d1d4634f839ecc0ef8f2d91d2ff68b49af74daa28f8cc4ff08a0fcd453cc |
Hashes for CSF_3DFin-1.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c001ec85327817f51190f243c7dbff6220faff5999e022972fdc56b4a6d961c0 |
|
MD5 | 9120cb81d37a7d576603b0831a454430 |
|
BLAKE2b-256 | f609a186c47b3d22c0b321021fcc888f172bdc0ea0b5f6d3ab139f654751def0 |
Hashes for CSF_3DFin-1.1.5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27835d65807b2a79f3190276d322338e30ecd544ad861adc66868f73a9e4c451 |
|
MD5 | 3e2dc521cffe294661157fe08b98dbbb |
|
BLAKE2b-256 | feb98540f0667d0e773dbb860a82008764a1a3002600db8e79e2da57f51175ab |
Hashes for CSF_3DFin-1.1.5-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db7636fcf41fd3c77f7161a266f7c6e9110b2bb0254633e2aa52b9c8e160e3a3 |
|
MD5 | 581323cfd279e7c22d95241437daf2a8 |
|
BLAKE2b-256 | b853fc5eaa3023b57cc99211035a891f2b236aeda15c3544b4eddc0fc7c29b7c |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5544dd5c9bbc432e9bba7d0b29621abb068aacf2686791809ec8800981a94a7 |
|
MD5 | 0e9cf27e0a4b7837e1c9063337b87898 |
|
BLAKE2b-256 | 1755e33bf6b40117220d016b646aba973af8c3c99b510f6b1393992129614214 |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ce6d995434d5b8c8e58410d221ac300720d75ee866c769a83458c381bf27809 |
|
MD5 | 6e595f86a881513d4e365083bb425a49 |
|
BLAKE2b-256 | ac7b8cc891281d437b6d3917a55533e7d2d6fa206d6174afef2f3caa81609977 |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4cb5716edfeb2511fbc593d0c98243eb27b6a52db2edc0e10017e66ad490573 |
|
MD5 | 3af91004338d5d087b7049a7e6e165fb |
|
BLAKE2b-256 | d4219ef4544de9f55a0dd9873b95f8723972d87934faf7417acefc1bea19a455 |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1e1c35f4422fd289005adc46c568981879f76819c47566cfcbc5f1305599e7 |
|
MD5 | 0024bba6995e62db6e3006eef53e72e9 |
|
BLAKE2b-256 | d88d7ca069318541b238106b0ba031698779f3d38e2b4de5a8c672e7cd59a81b |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dea604a7593ae092f34120672afaf77d744d73be5beb10fbc038659eba5eca89 |
|
MD5 | cc79a757b0f7ea6d34fc7ec0ed5a8ea4 |
|
BLAKE2b-256 | 15ccc5cea380edaba84969184e19d7ba8e3573cc07c9155361c96e09453b61c3 |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8798518e25542adabc38adeeb0f4225f8cdd331e9ca46081b0726f203dc2968f |
|
MD5 | 490aeb3d656c74bc27f64ec517fdf6c9 |
|
BLAKE2b-256 | 83b994ef15dbd14ea30bb2e37072e32669d1de17fcc1d395f0ae68333659f240 |
Hashes for CSF_3DFin-1.1.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ce113e768f0b49b32a30c7159e40d1f6f9d6592d5317bc19e105935dc6c610b |
|
MD5 | 2b8f2e226e4d4517f530d52ac50ae448 |
|
BLAKE2b-256 | 3f0ec25d40fd24379be8b9574a7edba9e62e540b6cdfd42feb708506b8914396 |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 960a7cbb598ec8eb6a52b5c176f7ad6a30d427b2ccf34595d08f6626a6e1650b |
|
MD5 | 24241efef03e55de1c318134f6b3291b |
|
BLAKE2b-256 | cf73eaafb03f51022cbea42660c1349d39598d03ff74f7ba19468f1a49f35000 |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ccae568b583ba761fdf2feb503d36784ec3977b288338d1dad337e625fc3df7 |
|
MD5 | 4c1385fd916811877a3d174f249ea5e7 |
|
BLAKE2b-256 | 8977da26ad875f6733264241b222a95533b1a2eca9514ea54511f9d4fca8b56a |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d89e81acc717be3aeb8838c0234212f7362883d7b30395b0a58f6e2607441330 |
|
MD5 | 4c1a82f6ac1de1530ce339296f309a6c |
|
BLAKE2b-256 | db3fb7290e51864e6b79bbf1bf554b4c4912c2c9a21a225917bba6def05b8ce3 |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2d4df052e43b278d1ad4d6cc3b857cf5b4414a72a09c56a4fac52006d32be4 |
|
MD5 | 7725d6a68602934482308a5076fa7ba2 |
|
BLAKE2b-256 | 656d5602888ef1e2a4aa4ac4ffbf6f1c3921ab148494d1d2d8777aae36ad580f |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ac52efa413ccb50185756a52bf82dcd7be21e34eacfbe06b161fc4c60ced23 |
|
MD5 | 7c8fd9589d97f1289114ea51d15b2ea6 |
|
BLAKE2b-256 | 952d6e6122548c830f9a76dcd0b53b9754a877bdb19ad782ec0b9eba128c9795 |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e982f1f2f1fe5c82dd3108675f220d477c4294dbc0e0accedc2c806bdc5eadac |
|
MD5 | ee6007dd031d6898add5228e47c8aa25 |
|
BLAKE2b-256 | b49e896deb5de8149e1ff1e26c6f1cd91506d5956ebbf3ed9a8ea8b5f991cc0f |
Hashes for CSF_3DFin-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3914fe56024e8ce75c0a907febab8313c15aee8a13216adc0aab81d6aba2386f |
|
MD5 | 7db010e93a0f72caa12a7987ade80712 |
|
BLAKE2b-256 | 6f8240ea8bd7f097bdee2a8b00b5ce8b6100e32d90003b8cec61e24f9612d0d6 |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8633d3e16fa5542b3c80538dcddaac7de5596289145786857a978f273c7d2c01 |
|
MD5 | a92df3fde0f263feb3707f5aa9dc53dd |
|
BLAKE2b-256 | 6c58aec0ba4e7fffd50e7dc49c5ec5ddae99115353f0d815636b4681bedf225a |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf292ecd44d177c15d55e6281e35c9f1a6e96aab239c4d6933fcfd6b3be2572c |
|
MD5 | 7eb6146cded1a45eda0d3c38491f03b0 |
|
BLAKE2b-256 | 0e24cd88e5d310b0683eb5d72b7ac75eaef54dd484bb0b32fa23c8f90f433092 |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93c50a4a53d3592a4f7dc9b1b583939a83c388c081e01d2cc8d11cc669853a6 |
|
MD5 | 3d04fed78a79cb9fea6d9e705d555bb4 |
|
BLAKE2b-256 | 9bb6c7bd160d104887cbba7288db5f2b010434a74344b465dc7736264bd86479 |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb468caecaf31294d0d540bf869e43e2a872f324a7a50921771cea38a08db316 |
|
MD5 | 2ba3c7bf164884f9e9cef0b4e522881b |
|
BLAKE2b-256 | ea39c8393756a04c0f68432847aa30d7e27193e0b66c1d089dfce43a646b6604 |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acb999e0a0da20fb1821d955207b920e1e100b37f4d7db207abfb2eb496511ea |
|
MD5 | 2f59b9cd2a7957a5c8c127087179b0e4 |
|
BLAKE2b-256 | 061c430591271675d5e317982eb757b83fc723138f0f3f50f45508c162fbdae0 |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2fe115ab349bef5587457025b7efe718af47a1afe8c11c2bff2c3b81575b3a |
|
MD5 | 38a9832950aa1e79d9e638a42301a781 |
|
BLAKE2b-256 | c60336321681828565c428f2ba6be13a6089a1ad8f3ad70d71caf9b42460e1ac |
Hashes for CSF_3DFin-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa4e2d8423bdf7d5d604d17eee7bd720703ba9ad813d5d792337d10afa3cb656 |
|
MD5 | e8022525227a19ef9f5f3423f37b0f94 |
|
BLAKE2b-256 | ffde08acdf83b8f9b239599abb61055b8039bd8585f294cca6501209e045305c |