当前位置:网站首页>点云目标检测KITTI数据集bin文件可视化,一站式解决
点云目标检测KITTI数据集bin文件可视化,一站式解决
2022-07-26 16:59:00 【马斯丁】
参考该链接方法一,需要安装mayavi,numpy,pyqt5;
numpy+mayavi.mlab
1.安装依赖库
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install mayavi -i https://pypi.tuna.tsinghua.edu.cn/simple2.读取.bin格式文件进行可视化
import mayavi.mlab
import numpy as np
import os
def viz_mayavi(points, vals="distance"): # 可视化只用到了3维数据(x,y,z)!
x=points[:, 0]
y=points[:, 1]
z=points[:, 2]
r=points[:, 3] # reflectance value of point
d=np.sqrt(x**2+y**2)
if vals == "height":
col = z
else:
col = d
# 创建可视化模板的尺寸
fig=mayavi.mlab.figure(bgcolor=(0, 0, 0), size=(1280, 720))
mayavi.mlab.points3d(x, y, z,
col,
mode="point",
colormap='spectral',
figure=fig,
)
mayavi.mlab.show()
if __name__ == "__main__":
bin_file_path = 'bin_2pcd'
bin_files = os.listdir(bin_file_path)
for bin_file in bin_files:
if bin_file.endswith(".bin"):
mypointcloud = np.fromfile(bin_file_path + '/' + bin_file, dtype=np.float32, count=-1).reshape([-1, 4])
viz_mayavi(mypointcloud,vals="height")3.就可以得到可视化结果
备注:
期间遇到无法运行的以下错误,可直接参考下面链接:Ubuntu18.04下解决Qt出现qt.qpa.plugin:Could not load the Qt platform plugin “xcb“问题_盼小辉丶的博客-CSDN博客_bicyclegan
一般情况下问题是一样的,详情看以上链接,解决方法如下;
sudo apt-get install libxcb-xinerama0至此,快乐看点云吧!
边栏推荐
- 国际象棋机器人夹断7岁男孩手指,原因是「棋手违反安全规则」?
- (24)Blender源码分析之顶层菜单显示代码分析
- Analysis of interface testing
- Is it safe to open an account online now? Who do you want to open a stock account?
- Spark数据格式UnsafeRow
- 兆骑科创海外高层次人才引进平台,创业赛事活动路演
- 【元宇宙欧米说】剖析 Web3 风险挑战,构筑 Web3 生态安全
- Mondriaans‘s Dream(状态压缩DP)
- [template] segment tree 1
- 来吧开发者!不只为了 20 万奖金,试试用最好的“积木”来一场头脑风暴吧!
猜你喜欢

跨站脚本攻击(XSS)

Week 16 OJ practice 1 calculates the day of the year

Kudu design tablet

敏捷开发与DevOps的对比

Asemi rectifier bridge kbpc3510, kbpc3510 package, kbpc3510 application

即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战

ASEMI整流桥KBPC2510,KBPC2510参数,KBPC2510规格书

跨站点请求伪造(CSRF)

Tianyi cloud web application firewall (edge cloud version) supports the detection and interception of Apache spark shell command injection vulnerabilities

Definition of graph traversal and depth first search and breadth first search (I)
随机推荐
The diagram of user login verification process is well written!
PIP installation module, error
图扑 3D 可视化国风设计 | 科技与文化碰撞炫酷”火花“
【元宇宙欧米说】剖析 Web3 风险挑战,构筑 Web3 生态安全
云渲染-体积云【理论基础与实现方案】
[cloud native] IVX low code development was introduced into Tencent map and previewed online
Centos安装docker以及mysql和redis环境
Open source kaggle cat and dog data set -- used in classic CNN classification practice
Is it really safe and reliable to exempt five in case of opening an account in a stock company
硬件开发与市场产业
Diagram of seven connection modes of MySQL
03 | implement usereducer and usestate
the loss outweighs the gain! Doctors cheated 2.1 million yuan and masters cheated 30000 yuan of talent subsidies, all of which were sentenced!
Common super easy to use regular expressions!
Pay attention to the traffic safety warning of tourism passenger transport issued by the Ministry of public security
uni-app
敏捷开发与DevOps的对比
(25) top level menu of blender source code analysis blender menu
机器视觉在服务机器人中的应用
Cross Site Request Forgery (CSRF)