当前位置:网站首页>mayavi可视化kitti
mayavi可视化kitti
2022-08-06 12:00:00 【江河地笑】
安装可视化环境,大概就下面几个包
conda install python=3.6.2
pip install pyqt5==5.15.2
pip install mayavi==4.6.0报错
Fatal Python error: _PyInterpreterState_Get(): no current thread state
解决conda install python==3.6
代码
import numpy as np
from mayavi import mlab
if __name__ == '__main__':
bin_file = r'D:\pycharm\project\PTT\data\kitti\training\velodyne\0000\000000.bin'
pointcloud = np.fromfile(bin_file, dtype=np.float32, count=-1).reshape([-1, 4])
x = pointcloud[:, 0] # x position of point
y = pointcloud[:, 1] # y position of point
z = pointcloud[:, 2] # z position of point
r = pointcloud[:, 3] # reflectance value of point
d = np.sqrt(x ** 2 + y ** 2) # Map Distance from sensor
vals = 'height'
if vals == "height":
col = z
else:
col = d
fig = mlab.figure(bgcolor=(1, 1, 1), size=(700, 500))
mlab.points3d(x, y, z,
d, # Values used for Color
mode="point",
colormap='spectral', # 'bone', 'copper', 'gnuplot', 'spectral', 'summer'
# color=(0, 1, 0), # Used a fixed (r,g,b) instead
figure=fig)
mlab.show()

边栏推荐
- Su Qiugui: The Secret of Google's Subdivision Deployment of Foreign Trade Enterprises
- Week 7 Learning Representation with Auto-Encoder(无监督学习)
- Kubernetes daily command
- Apscheduler定时任务
- Do-it-yourself databases: Fundamentals of concurrency management
- etcd 概念介绍
- 关机程序
- A domestic placeholder service
- STM32 startup process - startup_xxxx.s file analysis (MDK and GCC dual environment)
- ES6新特性——generator
猜你喜欢

kubernetes灰度发布

locust做性能测试

How to find stills?Where can I get HD resources?It's too late to meet these 9 website channels!original

Kubernetes 怎么优雅升级

重谈联想5G编码投票事件

CISP-PTE实操练习题讲解一(新版)

一文搞懂什么是kubernetes Service

Golang gin 配置腾讯云cos实现单文件与多文件上传

Office宏上线Cobalstrike

Teach you to draw pixel art and share 195 issues every week
随机推荐
嵌入式编程和PC编程的区别
STM32 startup process - startup_xxxx.s file analysis (MDK and GCC dual environment)
《ABP Framework 极速开发》 - 教程首发
Kubernetes Microservice Framework
XML使用
Zero with culture and art of tourism development of science and technology center "cultural art chain"
LeetCode 1403. 非递增顺序的最小子序列
Microsoft's new service allows businesses to expand access to their threat intelligence repository
kubernetes灰度发布
The digital transformation of how so difficult?!
The vant component van-dropdown-menu covers the list page in the applet, causing the bindtap click event to fail from time to time
Golang gin 配置腾讯云cos实现单文件与多文件上传
Absolutely!Ali people explain tens of billions of high-concurrency systems in 7 parts (full-color booklet open source)
Draw timing diagrams with code!YYDS
实践|美创助力“云学堂”数据安全风险管控建设
主板故障!教你如何用主板诊断卡检测维修电脑主板故障
电脑怎么清理灰尘 电脑清灰方法介绍
stdout stderr 重定向到文件
电脑死机是什么原因 怎样避免这个问题?
Kubernetes 虚拟机部署弊端