naurril / SUSTechPOINTS

3D Point Cloud Annotation Platform for Autonomous Driving
GNU General Public License v3.0
839 stars 217 forks source link

计算边界框内的点 #94

Closed ace-roger closed 1 year ago

ace-roger commented 2 years ago

我需要计算边界框内的点数。 任何功能/Python 脚本。

就像我想一次知道框架中每个对象的边界框中的所有点

naurril commented 2 years ago

https://github.com/naurril/SUSTechPOINTS/blob/522d1daef1e829f433cada6f420189ab3daee249/public/js/lidar.js#L1164

ace-roger commented 2 years ago

嗨 naurril

我无法完全掌握js代码,您能否提供逻辑或python示例来计算长方体内部的点数

提前致谢

ace-roger commented 2 years ago

嗨 naurril

我正在使用这个 bbox-utils 库来计算边界框内的点

https://colab.research.google.com/drive/1NR9fR5hWHDtNcOyp8U0nPPjeuXR_auxd?usp=sharing#scrollTo=qe2ZyykD5aos

ref : https://bbox-utils.readthedocs.io/en/latest/api/bbox_utils.html#module-bbox_utils.bbox_3d

我得到了错误的点数,任何具体原因

naurril commented 2 years ago

bbox-utils 的 euler angle的顺序是YZX , 这个工具用的是XYZ, 问题可能是这里

ace-roger commented 2 years ago

Eular Angle ->YZX - 计数是错误的

我正在尝试转换 https://github.com/naurril/SUSTechPOINTS/blob/522d1daef1e829f433cada6f420189ab3daee249/public/js/lidar.js#L416 从js到python

你能告诉我这个函数做什么或提供python等价物吗

https://github.com/naurril/SUSTechPOINTS/blob/522d1daef1e829f433cada6f420189ab3daee249/public/js/lidar.js#L384

naurril commented 2 years ago

方法是,把所有的点转换到bbox坐标系,然后判断哪些点在长宽高范围之内

ace-roger commented 2 years ago

你好 naurril

使用边界框点 psr_to_xyz,

我正在使用此代码

https://stackoverflow.com/questions/21037241/how-to-determine-a-point-is-inside-or-outside-a-cube/21037466#21037466 Approach #2

我想获得其中没有 pcd 点的边界框 - 所以我可以删除它们

使用上述逻辑,它运行良好

谢谢