当前位置:网站首页>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])#显示一下
边栏推荐
- 2022 operation of simulation test platform for 100 simulated questions of main principals of metal and nonmetal mines (underground mines)
- Thread life cycle and its methods
- Practice of constructing ten billion relationship knowledge map based on Nebula graph
- Deveco studio 3.0 editor configuration tips
- PC博物馆-熟悉又陌生的懵懂年代
- 2021计算机三级数据库大题总结
- Tencent cloud international ECS has no network after logging in. How to troubleshoot?
- Recommended practice sharing of Zhilian recruitment based on Nebula graph
- MySQL从库Error:“You cannot ‘Alter‘ a log table...“
- Clipping of raster vector data
猜你喜欢

物联网低代码平台常用《组件介绍》

Can your code talk? (upper)

基于 Nebula Graph 构建百亿关系知识图谱实践

基于MATLAB的混沌数字图像加密技术研究与仿真实现

Talking from the little nematode -- tracing the evolution of nervous system and starting life simulation

安杰思医学冲刺科创板:年营收3亿 拟募资7.7亿

Why can't Bert completely kill the BM25??

IonQ联合GE Research证实:量子计算在风险聚合上有巨大潜力

3. Overall UI architecture of the project

运行近20年,基于Win 98的火星探测器软件迎来首次升级
随机推荐
运行近20年,基于Win 98的火星探测器软件迎来首次升级
3. Overall UI architecture of the project
如何设计数据可视化平台
Recommendation letter brain correspondent: if love is just a chemical reaction, can you still believe in love?
开源社邀您参加OpenInfra Days China 2022,议题征集进行中~
flutter 系列之:flutter 中的 offstage
Reverse a stack with recursive functions and stack operations only
Is it safe to open an account on the flush
一个bug肝一周...忍不住提了issue
[binary tree] the minimum string starting from the leaf node
量子前沿英雄谱|“光量子探险家”McMahon:将任何物理系统变成神经网络
原生JS 实现页面元素的拖动 拖拽
Opening and closing principle
配置文件加密(Jasypt的简单使用)
仅用递归函数和栈操作逆序一个栈
腾讯再遭大股东Prosus减持:后者还从京东套现37亿美元
从小小线虫谈起——溯源神经系统进化,开启生命模拟
Euler equation: a truly perfect formula in the history of mathematics!
智联招聘基于 Nebula Graph 的推荐实践分享
增额终身寿险有哪些产品可以买呢?