当前位置:网站首页>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
边栏推荐
- 【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
- 用全连接层替代掉卷积 -- RepMLP
- Semi supervised mixpatch
- 【TCDCN】《Facial landmark detection by deep multi-task learning》
- 【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
- 用MLP代替掉Self-Attention
- 【Batch】learning notes
- TimeCLR: A self-supervised contrastive learning framework for univariate time series representation
- Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
- The difference and understanding between generative model and discriminant model
猜你喜欢

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

用全连接层替代掉卷积 -- RepMLP

基于onnxruntime的YOLOv5单张图片检测实现
![[multimodal] clip model](/img/45/8501269190d922056ea0aad2e69fb7.png)
[multimodal] clip model

jetson nano安装tensorflow踩坑记录(scipy1.4.1)

【学习笔记】Matlab自编高斯平滑器+Sobel算子求导

【Mixup】《Mixup:Beyond Empirical Risk Minimization》

EKLAVYA -- 利用神经网络推断二进制文件中函数的参数

论文写作tip2

【MagNet】《Progressive Semantic Segmentation》
随机推荐
conda常用命令
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
Semi supervised mixpatch
【Batch】learning notes
Use Baidu network disk to upload data to the server
用MLP代替掉Self-Attention
【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
超时停靠视频生成
【Programming】
What if the laptop can't search the wireless network signal
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
半监督之mixmatch
[Sparse to Dense] Sparse to Dense: Depth Prediction from Sparse Depth samples and a Single Image
【Wing Loss】《Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks》
Open3d learning notes II [file reading and writing]
Win10 solves the problem that Internet Explorer cannot be installed
latex公式正体和斜体
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
【多模态】CLIP模型