当前位置:网站首页>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
边栏推荐
- Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
- open3d学习笔记五【RGBD融合】
- 【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
- Ppt skills
- 【多模态】CLIP模型
- PHP returns the corresponding key value according to the value in the two-dimensional array
- Convert timestamp into milliseconds and format time in PHP
- Faster-ILOD、maskrcnn_benchmark训练coco数据集及问题汇总
- 联邦学习下的数据逆向攻击 -- GradInversion
- 使用百度网盘上传数据到服务器上
猜你喜欢
Translation of the paper "written mathematical expression recognition with bidirectionally trained transformer"
[learning notes] numerical differentiation of back error propagation
Faster-ILOD、maskrcnn_benchmark训练coco数据集及问题汇总
Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
Mmdetection installation problem
【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
论文写作tip2
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
Nacos service registration in the interface
[multimodal] clip model
随机推荐
open3d学习笔记二【文件读写】
【学习笔记】Matlab自编图像卷积函数
Regular expressions in MySQL
Win10+vs2017+denseflow compilation
Machine learning theory learning: perceptron
ModuleNotFoundError: No module named ‘pytest‘
【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
Eklavya -- infer the parameters of functions in binary files using neural network
PPT的技巧
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
[learning notes] numerical differentiation of back error propagation
Memory model of program
论文tips
Traditional target detection notes 1__ Viola Jones
Mmdetection installation problem
win10+vs2017+denseflow编译
Installation and use of image data crawling tool Image Downloader
Calculate the total in the tree structure data in PHP
What if a new window always pops up when opening a folder on a laptop
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》