From Zebra Aurora Vision Library
Point3DGrid数据类型表示三维空间中的点云。虽然这些点以网格结构组织,就像在Surface对象中一样,但与Surface对象不同的是,这些点的X和Y坐标可以有任意值。因此,整个Point3DGrid对象只有一个虚拟网格结构,无法保证网格中相邻的两个点在空间中彼此靠近。然而,网格结构允许为Point3DGrid对象定义感兴趣的区域。对于云中的每个点,它可能不存在。在这种情况下,存储一个特殊的点值来标记该点缺失。
在大多数情况下,应该优先选择Surface对象而不是Point3DGrid对象。因为Surface所需的空间要少得多,并确保两个相邻的点彼此相当接近,至少在XY平面上是如此。
一些过滤器可能会引入无效的点,即在一个或多个坐标上具有无穷大值的点。
可以使用Point3DGridValidPointsRegion来定位这些无效点。该过滤器还将返回所有有效点的区域,在大多数情况下,这些有效点应该是在进一步处理中唯一要考虑的点。
Library Definition
Methods:
int Width()
- returns number of grid columnsint Height()
- returns number of grid rowsPoint3D* Data()
- returns pointer to point cloud data bufferPoint3D* operator[]( int index )
- returns pointer to first point in the index rowstatic bool IsPointValid( const Point3D& inPoint )
- checks if a point is a valid point, i.e. it is not missing
struct Point3D { float x; float y; float z; };
Surface数据类型表示三维空间中的点云。所表示的点云以精确定义的方式组织。点的X坐标值创建了一个算术级数,Y坐标值也是如此。因此,整个Surface对象具有网格结构,这可以在点云表示中节省大量内存。它还允许为Surface对象定义感兴趣的区域。
内存实现
上述网格结构由四个值描述:X轴和Y轴上的偏移和比例,分别命名为:XOffset、XScale、YOffset、YScale。这些值表示网格第一行中的云点具有等于YOffset的Y坐标,第二行的Y坐标为:YOffset + YScale,第三行的Y坐标为:YOffset + 2 * YScale,依此类推。同样,网格连续列中的点具有等于XOffset、XOffset + XScale、XOffset + 2 * XScale等的X坐标。
Z坐标值的存储方式与Image对象中的值相同。与Image对象中一样,Surface值以6种可能的基元类型之一表示:sint8、uint8、sint16、uint16、sint32和real。要获得Z坐标的最终值,存储的值必须乘以ZScale,并且必须加上ZOffset。然而,云中的每个点都可能不存在。在这种情况下,存储一个特殊的Z值来标记该点缺失。
无效点
一些表面生成和转换过滤器可能会引入无效点,即Z坐标值为无穷大的点。此类过滤器的示例可以是ArrangePoint3DArray,它会在无法计算Z坐标的所有位置插入无效点(例如,由于输入数组中没有附近的点)。
可以使用SurfaceValidPointsRegion过滤器定位无效点,或使用ReplaceInvalidSurfacePoints过滤器将无效点替换为常数值。
备注
单个Surface对象不能分配超过2GB的内存。
Surface单个维度不应超过65535(因为区域出于性能原因使用16位整数)。
Library Definition
Methods:
int Width()
- returns number of grid columnsint Height()
- returns number of grid rowsint Pitch()
- returns byte-distance between consecutive rowsPlainType Type()
- returns type used for representing Z valuesdouble XOffset()
- returns X axis offsetdouble XScale()
- returns X axis stepdouble YOffset()
- returns Y axis offsetdouble YScale()
- returns Y axis stepdouble ZOffset()
- returns Z axis offsetdouble ZScale()
- returns Z axis stepdouble X( int xIndex )
- returns X coordinate of points in the xIndex columndouble Y( int yIndex )
- returns Y coordinate of points in the yIndex rowdouble Z( int xIndex, int yIndex )
- returns Z coordinate of the point defined by given indices
void* Data()
- returns pointer to point cloud data bufferT* RowBegin<T>( int i )
- returns pointer to first point in grid rowT* RowEnd<T>( int i )
- returns pointer to first after last point in grid rowT* Ptr<T>( int x, int y )
- returns pointer to point at specified coordinatesT& Value<T>( int i )
- allows to access Z coordinate value at specified coordinatesT Infinity<T>()
- returns the value used for representing a missing point
3D相机高图转换为Surface或Point3DGrid:
- 转换为Surface:你需要将每个像素的高度值转换为3D坐标。在这个过程中,像素的x和y坐标值通常被用作3D坐标的x和y值,而像素的值(高度)被用作3D坐标的z值。然后,你可以使用这些3D坐标来创建一个表面模型。这通常涉及到一些插值和平滑技术,以得到一个连续的表面。
- 转换为Point3DGrid:将高度图转换为点云的过程类似于将其转换为表面,但是你不需要进行插值或平滑。你只需要将每个像素的高度值转换为3D坐标,然后将这些坐标作为点云的点。