此页面由 AI 自动翻译。查看英文原版

本页目录

  • 使用说明
  • 参考

PointCloudData

PointCloudData 封装了 3D 空间信息,代表了 3D 空间中的一组点。点云中的每个点都有自己的位置(X、Y、Z 坐标)。PointCloudData 用于表示 PointCloud 节点的输出,并可用于执行各种空间分析和重建任务。Setter 方法仅用于为 PointCloudData 消息提供元数据(将用于记录和重放点云)。

使用说明

  • 已组织 vs 已过滤 — 当在 PointCloud 节点上使用 setOrganized(true) 时,getWidth() / getHeight() 与源深度帧的尺寸匹配,并包含无效点(z ≤ 0)。当已过滤(默认)时,height1width 等于有效点的数量。
  • 颜色数据 — 当 isColor()true 时,使用 getPointsRGB() 来检索位置和 RGBA 颜色。在 Python 中,这将返回一个元组 (points, colors),其中 pointsnp.ndarray (N, 3) float32colorsnp.ndarray (N, 4) uint8
  • 边界框getMinX/Y/Z()getMaxX/Y/Z() 返回以配置的长度单位表示的轴对齐边界。

参考

PointCloudData 的详细 API 提供了对 3D 点云数据的生成、操作和检索的控制。

Python

class

dai::PointCloudData

#include PointCloudData.hpp
variable
ImgTransformation transformation
function
PointCloudData()
Construct PointCloudData message.
function
~PointCloudData()
function
std::vector< Point3f > getPoints()
function
std::vector< Point3fRGBA > getPointsRGB()
function
void setPoints(const std::vector< Point3f > & points)
function
void setPointsRGB(const std::vector< Point3fRGBA > & points)
function
unsigned int getInstanceNum()
Retrieves instance number
function
unsigned int getWidth()
Retrieves the height in pixels - in case of a sparse point cloud, this represents the hight of the frame which was used to generate the point cloud
function
unsigned int getHeight()
Retrieves the height in pixels - in case of a sparse point cloud, this represents the hight of the frame which was used to generate the point cloud
function
float getMinX()
Retrieves minimal x coordinate in depth units (millimeter by default)
function
float getMinY()
Retrieves minimal y coordinate in depth units (millimeter by default)
function
float getMinZ()
Retrieves minimal z coordinate in depth units (millimeter by default)
function
float getMaxX()
Retrieves maximal x coordinate in depth units (millimeter by default)
function
float getMaxY()
Retrieves maximal y coordinate in depth units (millimeter by default)
function
float getMaxZ()
Retrieves maximal z coordinate in depth units (millimeter by default)
function
bool isSparse()
Retrieves whether point cloud is sparse
function
bool isOrganized()
Retrieves whether point cloud is organized (height > 1) Organized point clouds have width x height structure from the original image Sparse point clouds have height == 1 and only contain valid points
function
bool isColor()
Retrieves whether point cloud is color
function
PointCloudData & setWidth(unsigned int width)
Specifies frame width
Parameters
  • width: frame width
function
PointCloudData & setHeight(unsigned int height)
Specifies frame height
Parameters
  • height: frame height
function
PointCloudData & setSize(unsigned int width, unsigned int height)
Specifies frame size
Parameters
  • height: frame height
  • width: frame width
function
PointCloudData & setSize(std::tuple< unsigned int, unsigned int > size)
Specifies frame size
Parameters
  • size: frame size
function
PointCloudData & setMinX(float val)
Specifies minimal x coordinate in depth units (millimeter by default)
Parameters
  • val: minimal x coordinate in depth units (millimeter by default)
function
PointCloudData & setMinY(float val)
Specifies minimal y coordinate in depth units (millimeter by default)
Parameters
  • val: minimal y coordinate in depth units (millimeter by default)
function
PointCloudData & setMinZ(float val)
Specifies minimal z coordinate in depth units (millimeter by default)
Parameters
  • val: minimal z coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxX(float val)
Specifies maximal x coordinate in depth units (millimeter by default)
Parameters
  • val: maximal x coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxY(float val)
Specifies maximal y coordinate in depth units (millimeter by default)
Parameters
  • val: maximal y coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxZ(float val)
Specifies maximal z coordinate in depth units (millimeter by default)
Parameters
  • val: maximal z coordinate in depth units (millimeter by default)
function
PointCloudData & setSparse(bool val)
Specifies whether point cloud is sparse
Parameters
  • val: whether point cloud is sparse
function
PointCloudData & setColor(bool val)
Specifies whether point cloud is color
Parameters
  • val: whether point cloud is color
function
PointCloudData & setInstanceNum(unsigned int instanceNum)
Specifies instance number
Parameters
  • instanceNum: instance number
function
const ImgTransformation & getTransformation()
Retrieves image transformation data
function
PointCloudData & setTransformation(const ImgTransformation & transformation)
Specifies image transformation data
Parameters
  • transformation: transformation data
function
PointCloudData & updateBoundingBox()
Recomputes the bounding box (min/max X, Y, Z) from the current point data. All stored points are included regardless of their z value. If the cloud is empty, all bounds are set to 0.
inline function
void getPclData()
inline function
void setPclData(T...)
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
function
DEPTHAI_SERIALIZE(PointCloudData, width, height, minx, miny, minz, maxx, maxy, maxz, instanceNum, color, transformation, Buffer::ts, Buffer::tsDevice, Buffer::sequenceNum)
function
int64_t getSequenceNum()
Retrieves image sequence number
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
struct

dai::PointCloudData::dependent_false

C++

class

dai::PointCloudData

#include PointCloudData.hpp
variable
ImgTransformation transformation
function
PointCloudData()
Construct PointCloudData message.
function
~PointCloudData()
function
std::vector< Point3f > getPoints()
function
std::vector< Point3fRGBA > getPointsRGB()
function
void setPoints(const std::vector< Point3f > & points)
function
void setPointsRGB(const std::vector< Point3fRGBA > & points)
function
unsigned int getInstanceNum()
Retrieves instance number
function
unsigned int getWidth()
Retrieves the height in pixels - in case of a sparse point cloud, this represents the hight of the frame which was used to generate the point cloud
function
unsigned int getHeight()
Retrieves the height in pixels - in case of a sparse point cloud, this represents the hight of the frame which was used to generate the point cloud
function
float getMinX()
Retrieves minimal x coordinate in depth units (millimeter by default)
function
float getMinY()
Retrieves minimal y coordinate in depth units (millimeter by default)
function
float getMinZ()
Retrieves minimal z coordinate in depth units (millimeter by default)
function
float getMaxX()
Retrieves maximal x coordinate in depth units (millimeter by default)
function
float getMaxY()
Retrieves maximal y coordinate in depth units (millimeter by default)
function
float getMaxZ()
Retrieves maximal z coordinate in depth units (millimeter by default)
function
bool isSparse()
Retrieves whether point cloud is sparse
function
bool isOrganized()
Retrieves whether point cloud is organized (height > 1) Organized point clouds have width x height structure from the original image Sparse point clouds have height == 1 and only contain valid points
function
bool isColor()
Retrieves whether point cloud is color
function
PointCloudData & setWidth(unsigned int width)
Specifies frame width
Parameters
  • width: frame width
function
PointCloudData & setHeight(unsigned int height)
Specifies frame height
Parameters
  • height: frame height
function
PointCloudData & setSize(unsigned int width, unsigned int height)
Specifies frame size
Parameters
  • height: frame height
  • width: frame width
function
PointCloudData & setSize(std::tuple< unsigned int, unsigned int > size)
Specifies frame size
Parameters
  • size: frame size
function
PointCloudData & setMinX(float val)
Specifies minimal x coordinate in depth units (millimeter by default)
Parameters
  • val: minimal x coordinate in depth units (millimeter by default)
function
PointCloudData & setMinY(float val)
Specifies minimal y coordinate in depth units (millimeter by default)
Parameters
  • val: minimal y coordinate in depth units (millimeter by default)
function
PointCloudData & setMinZ(float val)
Specifies minimal z coordinate in depth units (millimeter by default)
Parameters
  • val: minimal z coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxX(float val)
Specifies maximal x coordinate in depth units (millimeter by default)
Parameters
  • val: maximal x coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxY(float val)
Specifies maximal y coordinate in depth units (millimeter by default)
Parameters
  • val: maximal y coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxZ(float val)
Specifies maximal z coordinate in depth units (millimeter by default)
Parameters
  • val: maximal z coordinate in depth units (millimeter by default)
function
PointCloudData & setSparse(bool val)
Specifies whether point cloud is sparse
Parameters
  • val: whether point cloud is sparse
function
PointCloudData & setColor(bool val)
Specifies whether point cloud is color
Parameters
  • val: whether point cloud is color
function
PointCloudData & setInstanceNum(unsigned int instanceNum)
Specifies instance number
Parameters
  • instanceNum: instance number
function
const ImgTransformation & getTransformation()
Retrieves image transformation data
function
PointCloudData & setTransformation(const ImgTransformation & transformation)
Specifies image transformation data
Parameters
  • transformation: transformation data
function
PointCloudData & updateBoundingBox()
Recomputes the bounding box (min/max X, Y, Z) from the current point data. All stored points are included regardless of their z value. If the cloud is empty, all bounds are set to 0.
inline function
void getPclData()
inline function
void setPclData(T...)
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
function
DEPTHAI_SERIALIZE(PointCloudData, width, height, minx, miny, minz, maxx, maxy, maxz, instanceNum, color, transformation, Buffer::ts, Buffer::tsDevice, Buffer::sequenceNum)
function
int64_t getSequenceNum()
Retrieves image sequence number
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
struct

dai::PointCloudData::dependent_false

需要帮助?

请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。