pmkalshetti / fast_point_cloud_sampling

Fast point cloud sampling using graph signal processing.
24 stars 5 forks source link

help #1

Open wangdongw opened 3 years ago

wangdongw commented 3 years ago

I am not familiar with using pybind11 to compile python modules. Can you provide compiled python modules? Thank you very much for your help.

pmkalshetti commented 3 years ago

Hi @wangdongw, unfortunately it is not immediately possible for me to provide the compiled module.

You can try to compile by following the below steps:

  1. Install the dependencies (Pybind11, OpenMP, Eigen, Open3D)
  2. Modify the path on line 19 in CMakeLists.txt to point to the install directory of Open3D
  3. Generate build files using cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
  4. Compile using cmake --build build/. This will generate the .so file.
  5. You can now copy this file to your project directory and import the graph_filter module

Hope this helps. Feel free to re-open if you face any problem.

wangdongw commented 3 years ago

Thank you very much and I will try it again.

------------------ 原始邮件 ------------------ 发件人: "Pratik @.>; 发送时间: 2021年6月18日(星期五) 晚上6:55 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Hi @wangdongw, unfortunately it is not immediately possible for me to provide the compiled module.

You can try to compile by following the below steps:

Install the dependencies (Pybind11, OpenMP, Eigen, Open3D)

Modify the path on line 19 in CMakeLists.txt to point to the install directory of Open3D

Generate build files using cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

Compile using cmake --build build/. This will generate the .so file.

You can now copy this file to your project directory and import the graph_filter module

Hope this helps. Feel free to re-open if you face any problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

wangdongw commented 3 years ago

Dear pmkalshett, my system is Windows, and I want to konw if I can use the CMake and VS2015 software to generate the python module ? I have try it the whole day, but not successful.  

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年6月18日(星期五) 晚上6:55 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Hi @wangdongw, unfortunately it is not immediately possible for me to provide the compiled module.

You can try to compile by following the below steps:

Install the dependencies (Pybind11, OpenMP, Eigen, Open3D)

Modify the path on line 19 in CMakeLists.txt to point to the install directory of Open3D

Generate build files using cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

Compile using cmake --build build/. This will generate the .so file.

You can now copy this file to your project directory and import the graph_filter module

Hope this helps. Feel free to re-open if you face any problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

pmkalshetti commented 3 years ago

Yes it should be possible. Are you getting an error during compilation?

wangdongw commented 3 years ago

Yes,especially during the compilation process of Open3D.

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年6月18日(星期五) 晚上11:57 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Yes it should be possible. Are you getting an error during compilation?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

wangdongw commented 3 years ago

Yes, no matter what I set, the Open3D_DIR path is empty.

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年6月18日(星期五) 晚上11:57 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Yes it should be possible. Are you getting an error during compilation?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

pmkalshetti commented 3 years ago

Is the error during installation of Open3D or while compiling the current project?

wangdongw commented 3 years ago

The Open3d install successful by Cmake, but the VS2015 can not bulid successful. When compiling the current project, the path of open3d cannot be searched.

------------------ 原始邮件 ------------------ 发件人: "Pratik @.>; 发送时间: 2021年6月19日(星期六) 晚上6:39 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Is the error during installation of Open3D or while compiling the current project?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

pmkalshetti commented 3 years ago

The CMakeLists.txt would need to be modified to be able to use in Windows. Unfortunately, I do not have a Windows machine to test this. You can try adapting the current CMakeLists.txt using https://github.com/intel-isl/open3d-cmake-find-package/blob/master/CMakeLists.txt.

wangdongw commented 3 years ago

Thank you very much. I will try it again. ------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年6月19日(星期六) 晚上7:01 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

The CMakeLists.txt would need to be modified to be able to use in Windows. Unfortunately, I do not have a Windows machine to test this. You can try adapting the current CMakeLists.txt using https://github.com/intel-isl/open3d-cmake-find-package/blob/master/CMakeLists.txt.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

wangdongw commented 3 years ago

I installed the ununtu system, but it always shows that the Open3D library cannot be found when cmake, as shown in the attached picture. Can you help me?------------------ 原始邮件 ------------------

发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年6月19日(星期六) 晚上7:01 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

The CMakeLists.txt would need to be modified to be able to use in Windows. Unfortunately, I do not have a Windows machine to test this. You can try adapting the current CMakeLists.txt using https://github.com/intel-isl/open3d-cmake-find-package/blob/master/CMakeLists.txt.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

pmkalshetti commented 3 years ago

I don't see any attached image on the Github web interface at https://github.com/pmkalshetti/fast_point_cloud_sampling/issues/1

wangdongw commented 3 years ago

I installed the Open3D by Anaconda command : conda install open3D. 

The results of Cmake are following: -- Found pybind11: /home/wangdongw/anaconda3/include (found version "2.6.1" ) -- Could NOT find Open3D (missing: Open3D_DIR) -- Configuring done -- Generating done -- Build files have been written to: /home/wangdongw/test_my/fast_point_cloud_sampling

The Open3D can not be found, even if I have modified the path on line 19 in CMakeLists.txt to point to the install directory of Open3D.

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年8月22日(星期天) 凌晨3:07 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

I don't see any attached image on the Github web interface at #1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

wangdongw commented 3 years ago

Perhaps you can provide the version and installation method of the dependent library, the error may be related to this, thank you.

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年8月22日(星期天) 凌晨3:07 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

I don't see any attached image on the Github web interface at #1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

wangdongw commented 3 years ago

Is Open3D used as a C++ library or a python library in this project?

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年8月22日(星期天) 凌晨3:07 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

I don't see any attached image on the Github web interface at #1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

pmkalshetti commented 3 years ago

Open3D is used as a C++ library as well as a python library. The way to install Open3D would be to compile its source code and also generate its python bindings, instead of using conda install.

wangdongw commented 3 years ago

I have compiled open3D, and I can find the path of open3d in cmake, but it still prompts that Open3D.h cannot be found.

(base) @.***:~/test_my/fast_point_cloud_sampling$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /home/wangdongw/anaconda3/bin/python (found version "3.8.8")  -- Found PythonLibs: /home/wangdongw/anaconda3/lib/libpython3.8.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Found pybind11: /home/wangdongw/anaconda3/include (found version "2.6.1" ) -- Found OpenMP_C: -fopenmp (found version "4.5")  -- Found OpenMP_CXX: -fopenmp (found version "4.5")  -- Found OpenMP: TRUE (found version "4.5")   CMake Deprecation Warning at /usr/local/lib/cmake/Open3D/Open3DConfig.cmake:18 (cmake_policy):   The OLD behavior for policy CMP0072 will be removed from a future version   of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all   policies are deprecated and that a policy should be set to OLD only under   specific short-term circumstances.  Projects should be ported to the NEW   behavior and not rely on setting a policy to OLD. Call Stack (most recent call first):   CMakeLists.txt:20 (find_package)

-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE   -- Found OpenMP_C: -fopenmp (found version "4.5")  -- Found OpenMP_CXX: -fopenmp (found version "4.5")  -- Found X11: /usr/include    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so    -- Found Open3D: /usr/local/lib/cmake/Open3D/Open3DConfig.cmake (found version "0.13.0")  -- Configuring done -- Generating done -- Build files have been written to: /home/wangdongw/test_my/fast_point_cloud_sampling/build (base) @.:~/test_my/fast_point_cloud_sampling$ cmake --build build/ [ 50%] Building CXX object CMakeFiles/graph_filter.dir/wrapper.cpp.o In file included from /home/wangdongw/test_my/fast_point_cloud_sampling/wrapper.cpp:1:0: /home/wangdongw/test_my/fast_point_cloud_sampling/graph_filter.h:2:10: fatal error: Open3D/Open3D.h: 没有那个文件或目录  #include <Open3D/Open3D.h>           ^~~~~ compilation terminated. CMakeFiles/graph_filter.dir/build.make:75: recipe for target 'CMakeFiles/graph_filter.dir/wrapper.cpp.o' failed make[2]: [CMakeFiles/graph_filter.dir/wrapper.cpp.o] Error 1 CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/graph_filter.dir/all' failed make[1]: [CMakeFiles/graph_filter.dir/all] Error 2 Makefile:90: recipe for target 'all' failed make: [all] Error 2

------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年8月22日(星期天) 下午5:04 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Open3D is used as a C++ library as well as a python library. The way to install Open3D would be to compile its source code and also generate its python bindings, instead of using conda install.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

wangdongw commented 3 years ago

Open3D.h can be found by changing the include<Open3D/Open3D.h> in the graph_filter.h file to include<open3d/Open3D.h>.

But when I execute the program, it shows that the given parameters are inappropriate, when calling the function VectorXd compute_scores(const MatrixXd &points, const std::string filter_type, const int scale_min_dist, const int scale_max_dist).

(base) @.***:~/test_my/fast_point_cloud_sampling$ python sample_point_cloud.py ./single_cubes.ply Read 2048 points Traceback (most recent call last):   File "sample_point_cloud.py", line 18, in <module>     pcd_sampled = sample_pcd(pcd_orig, args.filter_type, args.n_samples, 10, 10)   File "/home/wangdongw/test_my/fast_point_cloud_sampling/utils.py", line 50, in sample_pcd     scores = compute_scores_from_points(points_orig, filter_type, scale_min_dist, scale_max_dist)   File "/home/wangdongw/test_my/fast_point_cloud_sampling/utils.py", line 32, in compute_scores_from_points     scores = graph_filter.compute_scores(points, filter_type, scale_min_dist, scale_max_dist) TypeError: compute_scores(): incompatible function arguments. The following argument types are supported:     1. (arg0: Eigen::Matrix<double, -1, -1, 0, -1, -1>, arg1: str, arg2: int, arg3: int) -> Eigen::Matrix<double, -1, 1, 0, -1, 1>

Invoked with: array([[-2.56927705,  0.92165005, -2.2477231 ],        [-2.61531067,  1.30091953, -2.25721502],        [-1.5797869 ,  1.26831937, -2.24264693],        ...,        [-1.57416272,  0.62228197, -3.08259273],        [-1.58739209,  0.59657085, -2.6286819 ],        [-2.52568102,  1.59275889, -3.2295742 ]]), 'high', 10, 10

Do you know how to solve it ? ------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年8月22日(星期天) 下午5:04 @.>; @.**@.>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1)

Open3D is used as a C++ library as well as a python library. The way to install Open3D would be to compile its source code and also generate its python bindings, instead of using conda install.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Leerw commented 2 years ago

Open3D.h can be found by changing the include<Open3D/Open3D.h> in the graph_filter.h file to include<open3d/Open3D.h>. But when I execute the program, it shows that the given parameters are inappropriate, when calling the function VectorXd compute_scores(const MatrixXd &points, const std::string filter_type, const int scale_min_dist, const int scale_max_dist). (base) @.:~/test_my/fast_point_cloud_sampling$ python sample_point_cloud.py ./single_cubes.ply Read 2048 points Traceback (most recent call last):   File "sample_point_cloud.py", line 18, in <module>     pcd_sampled = sample_pcd(pcd_orig, args.filter_type, args.n_samples, 10, 10)   File "/home/wangdongw/test_my/fast_point_cloud_sampling/utils.py", line 50, in sample_pcd     scores = compute_scores_from_points(points_orig, filter_type, scale_min_dist, scale_max_dist)   File "/home/wangdongw/test_my/fast_point_cloud_sampling/utils.py", line 32, in compute_scores_from_points     scores = graph_filter.compute_scores(points, filter_type, scale_min_dist, scale_max_dist) TypeError: compute_scores(): incompatible function arguments. The following argument types are supported:     1. (arg0: Eigen::Matrix<double, -1, -1, 0, -1, -1>, arg1: str, arg2: int, arg3: int) -> Eigen::Matrix<double, -1, 1, 0, -1, 1> Invoked with: array([[-2.56927705,  0.92165005, -2.2477231 ],        [-2.61531067,  1.30091953, -2.25721502],        [-1.5797869 ,  1.26831937, -2.24264693],        ...,        [-1.57416272,  0.62228197, -3.08259273],        [-1.58739209,  0.59657085, -2.6286819 ],        [-2.52568102,  1.59275889, -3.2295742 ]]), 'high', 10, 10 Do you know how to solve it ? ------------------ 原始邮件 ------------------ 发件人: "pmkalshetti/fast_point_cloud_sampling" @.>; 发送时间: 2021年8月22日(星期天) 下午5:04 @.>; @*.**@*.***>; 主题: Re: [pmkalshetti/fast_point_cloud_sampling] help (#1) Open3D is used as a C++ library as well as a python library. The way to install Open3D would be to compile its source code and also generate its python bindings, instead of using conda install. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

add this line in the front of wrapper.cpp:

#include <pybind11/eigen.h>