码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 如何实现点云体素化及由密集特征得到二维伪装


    点云体素化

    1. def preprocess(self, lidar):
    2. #[N,4]
    3. # This func cluster the points in the same voxel.
    4. # shuffling the points
    5. np.random.shuffle(lidar)
    6. #把每个点分配到体素里,点坐标减去起始,除以每个体素的大小
    7. voxel_coords = ((lidar[:, :3] - np.array([self.xrange[0], self.yrange[0], self.zrange[0]])) / (
    8. self.vw, self.vh, self.vd)).astype(np.int32)
    9. # convert to (D, H, W) [N,3]
    10. voxel_coords = voxel_coords[:,[2,1,0]]
    11. #np.unique该函数是去除数组中的重复数字,并进行排序之后输出。axis=0(返回二维数组的唯一行)return_inverse返回旧列表里面的值在新列表里的索引
    12. #return_counts返回新列表里面的行在旧列表里面的个数。
    13. voxel_coords, inv_ind, voxel_counts = np.unique(voxel_coords, axis=0, \
    14. return_inverse=True, return_counts=True)
    15. #[N1,3],[N,1],[N1,1]N1表示非空体素的个数,voxel_counts统计每个非空体素里面的点个数
    16. voxel_features = []
    17. for i in range(len(voxel_coords)):
    18. #self.T每个体素里面最多点数
    19. voxel = np.zeros((self.T, 7), dtype=np.float32)
    20. #得到这个体素里面的点
    21. pts = lidar[inv_ind == i]
    22. if voxel_counts[i] > self.T:
    23. pts = pts[:self.T, :]
    24. voxel_counts[i] = self.T
    25. # 进行数据扩充,np.concatenate不增加维度对两向量相加
    26. voxel[:pts.shape[0], :] = np.concatenate((pts, pts[:, :3] - np.mean(pts[:, :3], 0)), axis=1)
    27. voxel_features.append(voxel)
    28. #voxel_features[N1,35,7],voxel_coords[N1,3]
    29. return np.array(voxel_features), voxel_coords

    密集特征得到二维伪图像特征

    1. def voxel_indexing(self, sparse_features, coords):
    2. #sparse_features[B,N1,C] coords[N1,4]
    3. dim = sparse_features.shape[-1]
    4. dense_feature = torch.zeros(cfg.N, cfg.D, cfg.H, cfg.W, dim).to(cfg.device)
    5. dense_feature[coords[:,0], coords[:,1], coords[:,2], coords[:,3], :]= sparse_features
    6. return dense_feature.permute(0, 4, 1, 2, 3)

  • 相关阅读:
    谷粒商城 (五) --------- 人人开源搭建后台系统
    Haproxy-1.5.19版本的基础运用
    关于 Hypervisor的理解
    记一次线上环境排查错误过程
    java计算机毕业设计基于安卓Android/微信小程序的校园报修管理APP
    传言称 iPhone 16 Pro 将支持 40W 快速充电和 20W MagSafe
    Java web应用性能分析之【自定义prometheus监控指标】
    java培训课程Spring MVC之文件上传
    无人机的力量——在民用方面的应用
    【.NET 深呼吸】全代码编写WPF程序
  • 原文地址:https://blog.csdn.net/slamer111/article/details/127639141
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号