当前位置:网站首页>Open3d learning notes 1 [first glimpse, file reading]
Open3d learning notes 1 [first glimpse, file reading]
2022-07-02 07:53:00 【Silent clouds】
Third party Library Download
pip install open3d
Be careful ,windows stay cmd Errors may be reported during installation , If it's installed anaconda In the Prompt Next use pip install .
A simple example
import numpy as np
import open3d as o3d
# Create some space points randomly
points = (np.random.rand(1000, 3) - 0.5) / 4
colors = np.random.rand(1000, 3)
# Statement , Then convert to point cloud
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
pcd.colors = o3d.utility.Vector3dVector(colors)
# Show
o3d.visualization.draw_geometries([pcd], window_name="3D", width=1280, height=720)
File read mode
1. Point cloud reading
import open3d as o3d
print("Load a ply point cloud, print it, and render it")
pcd = o3d.io.read_point_cloud("mode/wurenji.PLY")
o3d.visualization.draw_geometries([pcd], window_name="3D", width=1280, height=720)
characteristic : Only some files can be opened , Such as ply and pcd, To open stl, Then use the following method
The official document describes the format supported by the function
Format | describe |
---|---|
xyz | Each line includes [x, y, z], among x,y,z yes 3D coordinate |
xyzn | Each line includes [x, y, z, nx, ny, nz], among nx、ny、nz It's normal |
xyzrgb | Each line includes [x, y, z, r, g, b], among rgb Again [0, 1] Floating point number range |
pts | Please refer to Official documents |
ply | – |
pcd | – |
You can specify the file type explicitly . under these circumstances , File extensions will be ignored .
pcd = o3d.io.read_point_cloud("../../test_data/my_points.txt", format='xyz')
2.Mesh
import open3d as o3d
print("Load a ply point cloud, print it, and render it")
#---------#
pcd = o3d.io.read_triangle_mesh("mode/mogu3.STL")
pcd.compute_vertex_normals()
#--------#
o3d.visualization.draw_geometries([pcd], window_name="3D", width=1280, height=720)
The official document describes the format supported by the function
ply | stl | obj | off | gltf/glb |
---|
3D Show
o3d.visualization.draw_geometries()
Parameters :
draw_geometries(geometry_list,window_name='Open3D',width=1920,height=1080,left=50,top=50,point_show_normal=False,mesh_show_wireframe=False,mesh_show_back_face=False,lookat,up,front,zoom)
- geometry_list ( List [ open3d.geometry.Geometry ] ) – List of geometry to visualize .
- window_name ( str , optional , default=‘Open3D’ ) – Display title of the visualization window .
- width ( int , optional , default=1920 ) – The width of the visualization window .
- height ( int , optional , default=1080 ) – The height of the visualization window .
- left ( int , optional , default=50 ) – The left margin of the visualization window .
- top ( int , optional , default=50 ) – The top margin of the visualization window .
- point_show_normal ( bool , optional , default=False ) – If set to true, Then the point normals are visualized .
- mesh_show_wireframe ( bool , optional , default=False ) – If set to true, Then visualize the grid wireframe .
- mesh_show_back_face ( bool , optional , default=False ) – Also visualize the back of the mesh triangle .
- lookat ( numpy.ndarray [ numpy.float64 [ 3 , 1 ] ] ) – The observation vector of the camera .
- up ( numpy.ndarray [ numpy.float64 [ 3 , 1 ] ] ) – The up vector of the camera .
- front ( numpy.ndarray [ numpy.float64 [ 3 , 1 ] ] ) – The front vector of the camera .
- zoom ( float ) – Zoom of camera .
Reference article
https://blog.csdn.net/weixin_40511249/article/details/113557181?spm=1001.2014.3001.5502
https://blog.csdn.net/weixin_40511249/article/details/113557296?spm=1001.2014.3001.5502
https://zpcblue.blog.csdn.net/article/details/106272710?spm=1001.2014.3001.5502
边栏推荐
- How to clean up logs on notebook computers to improve the response speed of web pages
- 【AutoAugment】《AutoAugment:Learning Augmentation Policies from Data》
- [CVPR‘22 Oral2] TAN: Temporal Alignment Networks for Long-term Video
- 用MLP代替掉Self-Attention
- 【Paper Reading】
- The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
- What if the notebook computer cannot run the CMD command
- 【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
- Apple added the first iPad with lightning interface to the list of retro products
- Record of problems in the construction process of IOD and detectron2
猜你喜欢
Traditional target detection notes 1__ Viola Jones
图像增强的几个方法以及Matlab代码
[mixup] mixup: Beyond Imperial Risk Minimization
Hystrix dashboard cannot find hystrix Stream solution
Semi supervised mixpatch
【Mixup】《Mixup:Beyond Empirical Risk Minimization》
【深度学习系列(八)】:Transoform原理及实战之原理篇
【学习笔记】反向误差传播之数值微分
使用百度网盘上传数据到服务器上
【MobileNet V3】《Searching for MobileNetV3》
随机推荐
【学习笔记】反向误差传播之数值微分
【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
How to clean up logs on notebook computers to improve the response speed of web pages
label propagation 标签传播
[binocular vision] binocular stereo matching
Replace self attention with MLP
CPU的寄存器
【学习笔记】Matlab自编图像卷积函数
【Programming】
[learning notes] numerical differentiation of back error propagation
Faster-ILOD、maskrcnn_benchmark训练coco数据集及问题汇总
图像增强的几个方法以及Matlab代码
Translation of the paper "written mathematical expression recognition with bidirectionally trained transformer"
jetson nano安装tensorflow踩坑记录(scipy1.4.1)
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
C#与MySQL数据库连接
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》