当前位置:网站首页>open3d里pointcloud和numpy数组之间的转化
open3d里pointcloud和numpy数组之间的转化
2022-06-28 14:24:00 【江湖夜雨abc】
open3d中在使用open3d.io.read_point_cloud()
读取点云数据后,返回的是pointcloud类型的数据,有时候希望能用numpy处理点云,这时候需要进行二者之间的转换(严格地说只是数据经过复制再传输而已)。
1.pointcloud转换成numpy
import numpy as np
import open3d as o3d
A=[]
pcd=o3d.io.read_point_cloud("/bunny.ply")#路径需要根据实际情况设置
A=np.asarray(pcd.points)#A已经变成n*3的矩阵
print(A)
2.numpy数组中的数据转化成pointcloud
#这里B已经是一个n*3的numpy.ndarray(也就是常见的数组类型)
pcd=o3d.geometry.PointCloud()#实例化一个pointcloud类
pcd.points=o3d.utility.Vector3dVector(B)#给该类传入坐标数据,此时pcd.points已经是一个点云了
o3d.visualization.draw_geometries([pcd.points])#显示一下
边栏推荐
- Analysis and processing of GPS data format [easy to understand]
- What are the consequences of opening an account with Huatai Securities? How to open an account is the safest
- Design a stack with getmin function
- Solving Hanoi Tower problem
- Ding! Techo day Tencent technology open day arrived as scheduled!
- 华泰证券开户有什么后果 怎么办理开户最安全
- MySQL slave error: "you cannot 'alter' a log table“
- Thread life cycle and its methods
- 华泰证券app 怎么办理开户最安全
- Opengauss kernel: analysis of SQL parsing process
猜你喜欢
Reading notes of Mr. toad going to see a psychologist
How to design data visualization platform
openGauss内核:SQL解析过程分析
PC Museum - familiar and strange ignorant age
基于MATLAB的混沌数字图像加密技术研究与仿真实现
After nearly 20 years of operation, the Mars probe software based on win 98 has been upgraded for the first time
Quantum frontier hero spectrum - "light quantum Explorer" McMahon: turning any physical system into a neural network
推荐四款可视化工具,解决 99% 的可视化大屏项目!
Work study management system based on ASP
A bug liver a week I can't help mentioning issue
随机推荐
一个bug肝一周...忍不住提了issue
A bug liver a week I can't help mentioning issue
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Play NAS home NAS server setup scheme "suggestions collection"
[binary tree] allocate coins in the binary tree
Navicat premium 16 permanent crack activation tool and installation tutorial (available for personal test)
Dry goods | how to calculate the KPI of scientific researchers, and what are the h index and G index
同花顺上开户是安全的吗
Regular matching numbers, English and English symbols
Votre Code parle? (1)
Which is safer, a securities company or a bank? How to open an account is the safest
Work study management system based on ASP
接雨水系列问题
Rails进阶——框架理论认知与构建方案建设(一)
开源社邀您参加OpenInfra Days China 2022,议题征集进行中~
Reverse a stack with recursive functions and stack operations only
Configuration file encryption (simple use of jasypt)
Only four breakthrough Lenovo smart Summer Palace in mainland China won the "IDC Asia Pacific Smart City Award in 2022"
线程终止的 4 种方式
After nearly 20 years of operation, the Mars probe software based on win 98 has been upgraded for the first time