当前位置:网站首页>点云目标检测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至此,快乐看点云吧!
边栏推荐
- Hosts this file has been set to read-only solution
- JS 闭包 模拟私有变量 面试题 立即执行函数IIFE
- [machine learning] principle and code of mean shift
- 大咖访谈 | 开源对安全是双刃剑——《大教堂与集市》中文译本作者卫剑钒
- Brief introduction to CUDA image construction
- 【集训Day3】delete
- 天翼云Web应用防火墙(边缘云版)支持检测和拦截Apache Spark shell命令注入漏洞
- 国际大咖 VS 本土开源新星 | ApacheCon Asia 主题演讲议程全览
- URL跳转漏洞
- Is it safe to open an account online now? Who do you want to open a stock account?
猜你喜欢

第16周OJ实践1 计算该日在本年中是第几天

【集训Day2】cinema ticket

JS recursive Fibonacci sequence deep cloning

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

重磅公布!ICML2022奖项:15篇杰出论文,复旦、厦大、上交大研究入选

Coscon'22 city / school / institution producer solicitation order

AI遮天传 DL-多层感知机

Ascend target detection and recognition - customize your own AI application

hosts该文件已设置为只读的解决方法

JS function scope variables declare that the variables that promote the scope chain without VaR are global variables
随机推荐
带你熟悉云网络的“电话簿”:DNS
深度学习实验:Softmax实现手写数字识别
Is it safe to open an account online now? Who do you want to open a stock account?
GAN (Generative Adversarial Network,GAN)生成式对抗网络
RedisDesktopManager去除升级提示
236. 二叉树的最近公共祖先
机器视觉在服务机器人中的应用
Cross Site Request Forgery (CSRF)
URL跳转漏洞
A collection of commonly used shortcut keys for office software
Asemi rectifier bridge kbpc3510, kbpc3510 package, kbpc3510 application
【集训Day2】Sculpture
Hardware development and market industry
树形dp问题
兆骑科创海外高层次人才引进平台,创业赛事活动路演
【集训Day1】 Dwarves line up
图解用户登录验证流程,写得太好了!
Diagram of seven connection modes of MySQL
【模板】线段树 1
Interview with celebrities | open source is a double-edged sword for security -- Wei Jianfan, author of the Chinese translation of cathedral and market