当前位置:网站首页>Open3d learning note 4 [surface reconstruction]
Open3d learning note 4 [surface reconstruction]
2022-07-02 07:54:00 【Silent clouds】
open3d Surface reconstruction
Alpha shapes
Reconstruction with convex hull .
import open3d as o3d
mesh_ply = o3d.io.read_triangle_mesh("mode/bunny.ply")
# sampling
pcd = mesh_ply.sample_points_poisson_disk(750)
# Take a look at the convex hull
hull, _ = pcd.compute_convex_hull()
hull_ls = o3d.geometry.LineSet.create_from_triangle_mesh(hull)
hull_ls.paint_uniform_color((1, 0, 0))
o3d.visualization.draw_geometries([pcd, hull_ls], width=1280, height=720)
# Start surface reconstruction ,alpha Adjustable value
alpha = 0.1
print(f"alpha={alpha:.3f}")
mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape(pcd, alpha)
mesh.compute_vertex_normals()
print(mesh)
o3d.visualization.draw_geometries([mesh], mesh_show_back_face=True, width=1280, height=720)
result :
Convex hull condition
Reconstruction effect ,Alpha=0.1
continue ,Alpha = 0.015
Rolling ball method
import open3d as o3d
mesh = o3d.io.read_triangle_mesh("mode/bunny.ply")
mesh.compute_vertex_normals()
# Old rules , Sample first
pcd = mesh.sample_points_poisson_disk(3000)
# Here you can see the normal
o3d.visualization.draw_geometries([pcd], point_show_normal=True, width=1280, height=720)
# Start rebuilding
radii = [0.005, 0.01, 0.02, 0.04]
rec_mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting(pcd, o3d.utility.DoubleVector(radii))
o3d.visualization.draw_geometries([pcd, rec_mesh], width=1280, height=720)
effect :
Normal annotation
Reconstruction effect
Poisson surface reconstruction
The two above , The rolling ball method looks good , But in fact, both are chicken ribs , Is not smooth . Poisson reconstruction will be better in this regard .
There is only one adjustable parameter for Poisson surface reconstruction , That's it depth, This defines the depth of the octree , If the value is high, there will be more details .
import open3d as o3d
mesh = o3d.io.read_triangle_mesh("mode/Fantasy Dragon.ply")
mesh.compute_vertex_normals()
pcd = mesh.sample_points_poisson_disk(3000)
with o3d.utility.VerbosityContextManager(o3d.utility.VerbosityLevel.Debug) as cm:
mesh, densities = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(pcd, depth=9)
# Paint him a color
mesh.paint_uniform_color([1, 0, 0])
o3d.visualization.draw_geometries([mesh], zoom=0.664,
front=[-0.4761, -0.4698, -0.7434],
lookat=[1.8900, 3.2596, 0.9284],
up=[0.2304, -0.8825, 0.4101],
width=1280,
height=720)

Next, let's go through the process , Look at the density of points .
print('visualize densities')
densities = np.asarray(densities)
density_colors = plt.get_cmap('plasma')(
(densities - densities.min()) / (densities.max() - densities.min()))
density_colors = density_colors[:, :3]
density_mesh = o3d.geometry.TriangleMesh()
density_mesh.vertices = mesh.vertices
density_mesh.triangles = mesh.triangles
density_mesh.triangle_normals = mesh.triangle_normals
density_mesh.vertex_colors = o3d.utility.Vector3dVector(density_colors)
o3d.visualization.draw_geometries([density_mesh], zoom=0.664,
front=[-0.4761, -0.4698, -0.7434],
lookat=[1.8900, 3.2596, 0.9284],
up=[0.2304, -0.8825, 0.4101],
width=1280,
height=720)

Purple is low density , Yellow is high density , You can screen out some with low density . give the result as follows :
There seems to be no change . Sampling point 3000 In the case of reconstruction , There are still some scattered noises . To remove noise , There are two ways : The first one is : Continue to reduce sampling points ; The second kind , Increase sampling point . Reducing sampling points will lose more details , So it's not recommended .
Let's see the effect of increasing sampling points .
Sampling point =10000
Almost restored the original appearance , But what if the low-density area is removed ?
Become incomplete . So use the delete function depending on the situation .
Let's take a look at reducing sampling points .
Sampling point =1000
As expected , Although the original scattered points are gone , But at the same time, many details have been lost , Do more harm than good .
Next, change the model to see the reconstruction effect .
Sampling point 15000
Close to the limit , Even the sampling points basically cover the whole model , Some details will still be lost .
边栏推荐
- How gensim freezes some word vectors for incremental training
- One book 1078: sum of fractional sequences
- iOD及Detectron2搭建过程问题记录
- 解决jetson nano安装onnx错误(ERROR: Failed building wheel for onnx)总结
- [multimodal] clip model
- yolov3训练自己的数据集(MMDetection)
- 【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
- Installation and use of image data crawling tool Image Downloader
- Feature Engineering: summary of common feature transformation methods
- 【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
猜你喜欢

【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》

【学习笔记】Matlab自编图像卷积函数

【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》

ABM thesis translation

Replace self attention with MLP
![[learning notes] numerical differentiation of back error propagation](/img/1c/e28e31d7cc5ccc38607c7839ccc5f0.png)
[learning notes] numerical differentiation of back error propagation
![[multimodal] clip model](/img/45/8501269190d922056ea0aad2e69fb7.png)
[multimodal] clip model

Proof and understanding of pointnet principle

【AutoAugment】《AutoAugment:Learning Augmentation Policies from Data》

半监督之mixmatch
随机推荐
What if a new window always pops up when opening a folder on a laptop
Replace convolution with full connection layer -- repmlp
CONDA common commands
Execution of procedures
open3d学习笔记五【RGBD融合】
Summary of open3d environment errors
【双目视觉】双目立体匹配
What if the laptop can't search the wireless network signal
Nacos service registration in the interface
Ppt skills
[C # note] the data in DataGridView saved in WinForm is excel and CSV
解决jetson nano安装onnx错误(ERROR: Failed building wheel for onnx)总结
Feature Engineering: summary of common feature transformation methods
论文写作tip2
用MLP代替掉Self-Attention
CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
Hystrix dashboard cannot find hystrix Stream solution
Apple added the first iPad with lightning interface to the list of retro products
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
Open3d learning notes II [file reading and writing]








