当前位置:网站首页>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 .
边栏推荐
- jetson nano安装tensorflow踩坑记录(scipy1.4.1)
- [CVPR‘22 Oral2] TAN: Temporal Alignment Networks for Long-term Video
- 【Batch】learning notes
- [mixup] mixup: Beyond Imperial Risk Minimization
- 【Paper Reading】
- 【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
- 【Programming】
- Conversion of numerical amount into capital figures in PHP
- Convert timestamp into milliseconds and format time in PHP
- Deep learning classification Optimization Practice
猜你喜欢

MMDetection安装问题

【MagNet】《Progressive Semantic Segmentation》

Open3D学习笔记一【初窥门径,文件读取】

【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》

【Mixup】《Mixup:Beyond Empirical Risk Minimization》

将恶意软件嵌入到神经网络中

Implementation of yolov5 single image detection based on onnxruntime

open3d学习笔记三【采样与体素化】

【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》

Hystrix dashboard cannot find hystrix Stream solution
随机推荐
Win10 solves the problem that Internet Explorer cannot be installed
Correction binoculaire
【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
Win10+vs2017+denseflow compilation
C#与MySQL数据库连接
Deep learning classification Optimization Practice
Installation and use of image data crawling tool Image Downloader
TimeCLR: A self-supervised contrastive learning framework for univariate time series representation
Comparison of chat Chinese corpus (attach links to various resources)
MoCO ——Momentum Contrast for Unsupervised Visual Representation Learning
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
将恶意软件嵌入到神经网络中
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
Remplacer l'auto - attention par MLP
One book 1078: sum of fractional sequences
Solve the problem of latex picture floating
Machine learning theory learning: perceptron
Regular expressions in MySQL
Ppt skills
PHP returns the abbreviation of the month according to the numerical month








