mesh->vox&pointcloud cuda_voxelizer v0.4.11的安装与运行
cuda_voxelizer v0.4.11
https://github.com/Forceflow/cuda_voxelizer
conda install pip
pip install cmake
git clone https://github.com/Forceflow/cuda_voxelizer.git
#安装依赖 trimesh2
git clone https://github.com/Forceflow/trimesh2.git
cd trimesh2
make
#报错 GL/gl.h: No such file or directory
sudo apt-get install mesa-common-dev
sudo apt-get install libgl1-mesa-dev
#报错 GL/glu.h: No such file or directory
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
#报错 X11/extensions/XInput.h: No such file or directory
sudo apt-get install libxi-dev
make #编译完成
#安装依赖 glm
git clone https://github.com/g-truc/glm.git
cd glm
mkdir build && cd build
cmake ..
make -j8
sudo make install
#编译 cuda_voxelizer
cd cuda_voxelizer
vim CMakeList
#修改
SET(Trimesh2_INCLUDE_DIR ../trimesh2/include)
SET(Trimesh2_LINK_DIR ../trimesh2/lib.Linux64)
#删除
IF(NOT EXISTS "${Trimesh2_LINK_DIR}")
MESSAGE(FATAL_ERROR "Trimesh2 library dir does not exist")
ENDIF()
#编译
mkdir build
cd build
cmake ..
make
#下载stanfor bunny
wget http://graphics.stanford.edu/pub/3Dscanrep/bunny.tar.gz
tar -xzvf bunny.tar.gz
cd bunny
cd reconstruction/
cp bun_zipper.ply ../../
#改名
cp bun_zipper.ply bunny.ply
#运行 输出 .binvox
./cuda_voxelizer -f bunny.ply -s 256
#.binvox 可视化
https://www.patrickmin.com/viewvox/
chmod +x viewvox
./viewvox bunny.ply_256.binvox
#生成展示窗口
#生成时间对比 以生成256*256的体素为例
#使用gpu加速 Total runtime: 8703.4 ms
./cuda_voxelizer -f bunny.ply -s 256 -o obj -thrust
#使用cpu Total runtime: 8983.1 ms
./cuda_voxelizer -f bunny.ply -s 256 -o obj -cpu
#生成时间对比 以生成256*256的点云为例
#使用gpu加速 Total runtime: 804.5 ms
./cuda_voxelizer -f bunny.ply -s 256 -o obj_points -thrust
#使用cpu Total runtime: 682.8 ms
./cuda_voxelizer -f bunny.ply -s 256 -o obj_points -cpu
本文来自博客园,作者:甫生,转载请注明原文链接:https://www.cnblogs.com/fusheng-rextimmy/p/15521778.html