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.2.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d85d0ea13d926ba2d4d4dd888884810e70e6ec44f7298a7f273b3d29af38d89 |
|
MD5 | 39b95fef66d8f8302788ac7105ae49b4 |
|
BLAKE2b-256 | 9e1ad867af8212ea0dc2bb7c38588ea18faa433f354fc21c7c3420d997af28ba |
Hashes for CSF_3DFin-1.2.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7401410e57d3c30c042d215a66489a6d12138085b683c0cf97f4a47554b60f70 |
|
MD5 | f1a8e6eda0687605550300398d16be02 |
|
BLAKE2b-256 | f8654f39eb6fe2b02ee2aa5d0625ec11708709996b6714cbdea1f82d4caa3ed6 |
Hashes for CSF_3DFin-1.2.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc34ff5204ea281041d12f99607387ce052fb9bca340266eab161d9a9b6931a9 |
|
MD5 | be01a9345c646eba2db32c3d10943a64 |
|
BLAKE2b-256 | 6e44504eebe4eb1f9f28fa3fc67a4b9f6c0ee4986e8b16faba4c69d62f34d988 |
Hashes for CSF_3DFin-1.2.0-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf2103335fa0d64e1146f7da6eb9611fff8079fd7e3db381891027beda14d674 |
|
MD5 | 025978eff1ccc6c55907f7fa5042e672 |
|
BLAKE2b-256 | c225396fd5da29485eae319e8b204aa0bfb203b78ea788ea8e9c6189020cf06d |
Hashes for CSF_3DFin-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb260f07840b8fe12cea3aa0dc2bfc7b0dc4919ae600ee36d34762b70087a9b0 |
|
MD5 | 5cb0e9965e8f3593cde6ea2dfe59ab8e |
|
BLAKE2b-256 | 6c2ea383ae1338bc92efeb7e16fb61b9fcd8ab8eb3be9b1ba6e03a987d9c5ca1 |
Hashes for CSF_3DFin-1.2.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d3d97eab6426cde8e2242c745db65205203a855997bc5a55565fa09ee8abee9 |
|
MD5 | c76f61d6e95093b89b68e8ce40683bc2 |
|
BLAKE2b-256 | 7468f475e6a558c152daba064be610c6862c5268a1f14f09ec886443fbd7f7e2 |
Hashes for CSF_3DFin-1.2.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 969e887aa1054dcc8159e6e32af0a1b60bbe34cf880e1a93c72315b19303b22b |
|
MD5 | 59a162c562ce3d3f8d40371c2c8444f2 |
|
BLAKE2b-256 | 3e2403d99a2af095d1796c05592a2a937a72fdf74b6b784f795fe61e6f4974de |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b65bfc5ffb340b8100709960f23d4c751171f5500a2c204cc31a50687cb44e93 |
|
MD5 | 3185f8add5ef1198de3223df05f6d9c4 |
|
BLAKE2b-256 | b35b2534cfc4226a9d52dc35ac75d18cb3911ac16505c5241f6cefe4f6e4a81d |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee3ca782adefc12cc9caf00b843599b8383e649383dfab7ad5feb80445b0afeb |
|
MD5 | 7272079a54f36dba233d4dcbf5dd6488 |
|
BLAKE2b-256 | 3584c5172f73e1ddfd8e1f328ec6eacb145049bf585be5887831683f9e959b9f |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5efd1947f8ccc47a59d9ea8cf7aa1bbe8179ab8cdc64e4208592673815bb321c |
|
MD5 | c1674659c7719ccf58d6c8fca462c6d0 |
|
BLAKE2b-256 | 1b3e3c5e2ef0cde9ed7ca02e0c3b19b62407017f57ebeb5dadb5027ec036bac6 |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cfcdc782b6e1a25cfdc0715f3df4df9a59d7adfba15a52f6c5fe5e9a95a4906 |
|
MD5 | 13ad3c2a44158e228cc3fb536cdec026 |
|
BLAKE2b-256 | 688a361c3a2acbfac46905231969a5f89da5f3fc91323ef6d90a3153a3ce96a7 |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 778cf5f16eaa46ff3d0b1bcaf4ff9d6e937761d9b2dc691fe118385b4f46654f |
|
MD5 | f1a1c8f2b8dab743941c72a5ba1e55c2 |
|
BLAKE2b-256 | 65c2389601308afac82f5c88d98c4d0ff536c125f7824c5ac4110194abe286e9 |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e39ea1bdc8395abdabbc2073ca0f0d88f57ab4b99242420e83a7d7bcdb1a7145 |
|
MD5 | 49ab291ca11c6cea3e318d06dae69ad2 |
|
BLAKE2b-256 | 87462c887b0072b4e6c517f271c5f1732ac419044dcbf2474f3945df7689e35f |
Hashes for CSF_3DFin-1.2.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02d49a41b8d48fea6c701d13887246eed6510b7cb22b68434864ad2a16033728 |
|
MD5 | cba64a0d2af69db96ea802bdc6f51c47 |
|
BLAKE2b-256 | 2a3759a75b4d1690f43fd493bb117f0e9ef6a4741e8d317218f9c79c30abb79d |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d325f48a4d5ff9d066f2a0e2c4810ca07aa5898381bbdf90274a13a0636e011 |
|
MD5 | cde60cff8f70669d54cd0d88d4ebe94e |
|
BLAKE2b-256 | 659a5a40f10c65d6b83c275c8b6f2a70101d479e8d30b0520db4d11932c47038 |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18d3307ac0a0512e5c92361f54ea30ebc0e9ae43edcbd9753a89412eaa80c966 |
|
MD5 | 1f64a82985e49703e6f86cefd26b9e4a |
|
BLAKE2b-256 | ff20ac91276b2b6b697295bd4995011832d7350f8f171ccea6f9eb68635d91e4 |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61802809e7e17f261174885e3f909a22e114e1a1e86bc318a0448467ac3d9408 |
|
MD5 | 885542ba311e4fcf3d6f1accbcf8b0c5 |
|
BLAKE2b-256 | e561473069c87cb6a303ee6e0057d86e16aadf3d87d79b69f16f08b6971a6b0c |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1872110a35f93534a3e0d647921780c910ed85e535e4c6713ec151d5e90f2489 |
|
MD5 | b45f2013854278d8131d64017c93b460 |
|
BLAKE2b-256 | ca77304387f960d3d1652c27d2ae23be054376b60f78de331554b6fbfc60abb0 |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adc9a85e4d8d6b291c0f060a8ce12555768ef7f9f466c78dba7fb7dc4cdc4183 |
|
MD5 | 8d739730c9dc3ee71a1c1e0e908f71d3 |
|
BLAKE2b-256 | 8f57d27d351d913ec5582a5e7b65cfb5f79d618ae517a3e449564746ff7cb11d |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f70b30d8aa9b4c2aebeb2537d1813acf6d21c501ca6300dba6a1b856b72e3741 |
|
MD5 | 5757a505fb6a343bca5d4a5dfc283b54 |
|
BLAKE2b-256 | b25f26adceceed6b5edf45707e66472ee1d3348131cfea74f12f22d3a9642303 |
Hashes for CSF_3DFin-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb413c76804a093809295b5efa6211afdba39885b0617839c5b69e4f8353ab9 |
|
MD5 | d9c152bf74bf0c81ebf7dac6a1ef833a |
|
BLAKE2b-256 | 560af9cb0d6115a6ead6677567a8b0ad509313265f0f3a5902fa5a59e852c69f |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6180c7e2e6ca405d9f4e5e0b199cd4444819fee2dcf2e08ba6dcfd52ff05c398 |
|
MD5 | 8b12c35777779df1b9c3ddad4911b990 |
|
BLAKE2b-256 | 0a642d444e9251eb22502b1c40e0f7cdc474f4b5bf8adcdb8df8b3e0b4218789 |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07d6f4548e0cfae07be471f05fc1445624d7770ca8ad75c88eb22a251984599c |
|
MD5 | 1be4c75cefa371874a8857337fe11fec |
|
BLAKE2b-256 | 8e7e5954d9eaf75f2f257cdee1dae2e4b90453c5d0b27cd70bc8ecbe95b20690 |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfb7d7b1ef526d013da634efcdb9c4051d5e44de6115cef764e43c22a35f6636 |
|
MD5 | a443075ab871723b57130ebd6b51a631 |
|
BLAKE2b-256 | be23afd8250e38ad0a39c9870e72e7f10f308c2060872bc4ce19ccbbfb68debb |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dc6014d7800f642f4458a101c041578a3dd9fbb56c788401e36e497bf956e33 |
|
MD5 | 85221a4682c91fd2d16310ad5e53da9e |
|
BLAKE2b-256 | fe96f1f8362b8796239b46e235d251a3c134a434f936d7e1a58f6034c0e88a89 |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d077e2ee90425e3300066840a8465286cb6b21bdcce0475ea52553cce079f1 |
|
MD5 | c9b5446d63264c3dabd8f494ebd3732c |
|
BLAKE2b-256 | e23fc435dd59c8972ecb4b4a428414e4175179b0284c5abb355815953cb04b3d |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5c909caa561243dd3e8c1472be4b2716405287a94f608399d8a5006217359e |
|
MD5 | 5227fe2822c0610a65a138ebbb438cf6 |
|
BLAKE2b-256 | 4f199fbf292e136aace581c5ebb21c600ea8e926bcdb0fa30a6b81a434edd61b |
Hashes for CSF_3DFin-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf6804983aeec92de1f2265a6fba7bed0cd3358680e2c641c1a56d5d93357422 |
|
MD5 | 526b648c0cf29cffa7a9c57d122de29d |
|
BLAKE2b-256 | d8888aa0ae5faefea4ab8a69348c3d2a26a0194550039011da230a609453fab5 |