当前位置:网站首页>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
边栏推荐
- 【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
- 半监督之mixmatch
- How to clean up logs on notebook computers to improve the response speed of web pages
- Sorting out dialectics of nature
- Label propagation
- Regular expressions in MySQL
- Latex formula normal and italic
- CPU的寄存器
- The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
- 【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
猜你喜欢

【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
![[multimodal] clip model](/img/45/8501269190d922056ea0aad2e69fb7.png)
[multimodal] clip model

【Batch】learning notes

Installation and use of image data crawling tool Image Downloader

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

【双目视觉】双目立体匹配

【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》

【MobileNet V3】《Searching for MobileNetV3》

程序的执行

利用Transformer来进行目标检测和语义分割
随机推荐
Regular expressions in MySQL
Thesis tips
论文写作tip2
【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
用MLP代替掉Self-Attention
【TCDCN】《Facial landmark detection by deep multi-task learning》
Daily practice (19): print binary tree from top to bottom
CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
利用Transformer来进行目标检测和语义分割
Solve the problem of latex picture floating
open3d环境错误汇总
What if the notebook computer cannot run the CMD command
【TCDCN】《Facial landmark detection by deep multi-task learning》
Common CNN network innovations
Faster-ILOD、maskrcnn_benchmark安装过程及遇到问题
Two dimensional array de duplication in PHP
【双目视觉】双目矫正
【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》
【Programming】
程序的内存模型