jakarto3d / jakteristics Goto Github PK
View Code? Open in Web Editor NEWCompute point cloud geometric features from python
Compute point cloud geometric features from python
Hey folks,
I was wondering whether one could easily support a per-point search radius (precomputed from optimal neighbourhood in PDAL) for calculating the geometric features.
I had a crack at it with this commit on a fork, as I thought it would be relatively straightforward to just extend the float to an array. But I am not well-versed enough in cython and c++ extensions to python to really effectively understand what went wrong.
In building the c++ extension I get:
× Building wheel for jakteristics (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running bdist_wheel
running build
running build_py
copying jakteristics/main.py -> build/lib.linux-x86_64-cpython-310/jakteristics
copying jakteristics/utils.cpp -> build/lib.linux-x86_64-cpython-310/jakteristics
copying jakteristics/extension.cpp -> build/lib.linux-x86_64-cpython-310/jakteristics
running build_ext
building 'jakteristics.extension' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_NO_DEPRECATED_API=1 -I/tmp/pip-build-env-9kki0rhb/overlay/lib/python3.10/site-packages/numpy/core/include -Ijakteristics/ckdtree/ckdtree/src -Ijakteristics/ckdtree/_lib -I/home/liam/projects/jakteristics/.venv/include -I/home/liam/.pyenv/versions/3.10.8/include/python3.10 -c jakteristics/ckdtree/ckdtree/src/query_ball_point.cxx -o build/temp.linux-x86_64-cpython-310/jakteristics/ckdtree/ckdtree/src/query_ball_point.o -fopenmp
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_NO_DEPRECATED_API=1 -I/tmp/pip-build-env-9kki0rhb/overlay/lib/python3.10/site-packages/numpy/core/include -Ijakteristics/ckdtree/ckdtree/src -Ijakteristics/ckdtree/_lib -I/home/liam/projects/jakteristics/.venv/include -I/home/liam/.pyenv/versions/3.10.8/include/python3.10 -c jakteristics/extension.cpp -o build/temp.linux-x86_64-cpython-310/jakteristics/extension.o -fopenmp
jakteristics/extension.cpp: In function ‘PyObject* __pyx_pf_12jakteristics_9extension_compute_features(PyObject*, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_obj_12jakteristics_7ckdtree_7ckdtree_cKDTree*, int, int, int, PyObject*, float)’:
jakteristics/extension.cpp:3905:99: error: assignment of read-only location ‘* __pyx_temp_pointer’
3905 | *((__pyx_t_5numpy_float64_t const *) __pyx_temp_pointer) = __pyx_temp_scalar;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
jakteristics/extension.cpp:3988:71: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
3988 | __pyx_t_9 = ((__pyx_v_n_neighbors_at_id > __pyx_v_max_k_neighbors) != 0);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
jakteristics/extension.cpp:4048:63: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
4048 | for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_27; __pyx_t_10+=1) {
| ~~~~~~~~~~~^~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for jakteristics
Failed to build jakteristics
ERROR: Could not build wheels for jakteristics, which is required to install pyproject.toml-based projects
Figured i'd give you a ping in case the answer is obvious to you devs. It'll take me quite some time to pick through and figure out what's going on.
Happy to open a PR if this is fixable and useful.
Cheers!
Hi, jakteristics, I have a question about installation of your code, when I run python -m pip install jakteristics, I met the following problem:
ERROR: Could not build wheels for jakteristics, which is required to install pyproject.toml-based projects.
Then I try to install pyproject.toml-based projects, by running pip install --use-feature=2020-resolver . But it couldn't solve this issue. Do you have some suggestions about how to solve this issue? Thank you in advance!
I mean the operation similar to "subtraction" which can be used for background subtraction or to extract (segment) the changed part of the original point cloud.
Might be relevant to this link?
https://www.cloudcompare.org/doc/wiki/index.php?title=Distances_Computation
Thank you
Hi, I tested this package with Toronto3d data (L001) which includes 21 million points. The code stops without raising any errors. I checked and found out that the issue is ckdtree cannot be created. Is there anything we can fix this> for example, can be set leafsize to a lower number than 16?
Hi,
Is it possible to implement the calculation of the Number of neighbours?
Thanks
features = compute_features(xyz, search_radius=0.15, format="{feature}_{radius}")
jakteristics
wheel seems to not be available for MacOS.
Users who want to install jakteristics
on MacOs need to :
1 ) install gcc-12
and g++-12
compilers and use them instead of the default clang to build the jakteristics
wheel (gcc
and g++
binaries will be located in /opt/homebrew/bin
folder)
2 ) install jakteristics
with CC=gcc-12 CXX=g++-12 pip install jakteristics
when I run
pc_normals = compute_features(pc.astype(np.float64), search_radius=0.1, feature_names=["nx","ny","nz"])
I got many ‘nan’
How can this happen?
pc_normals = compute_features(pc.astype(np.float64), search_radius=0.1, feature_names=["nx","ny","nz"])
(Pdb) print np.isnan(pc).sum()
0
(Pdb) n
/home/gy/PVCNet1014/Utils.py(95)Compute_Normals()
-> pc_normals = np.expand_dims(pc_normals, axis = 0)
(Pdb) print np.isnan(pc_normals).sum()
318
there are 318 nans
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.