PointCloudData

PointCloudData encapsulates 3D spatial information, representing a collection of points in a 3D space. Each point within the point cloud has its own position (X, Y, Z coordinates). PointCloudData is used to represent the output of PointCloud nodes, and can be used to perform a variety of spatial analysis and reconstruction tasks.

Setter methods are only used to provide metadata to the PointCloudData message (will be used for recording and replaying pointclouds).

Reference

The detailed API for PointCloudData offers control over the generation, manipulation, and retrieval of 3D point cloud data.

class depthai.PointCloudData
getData(self: object) → numpy.ndarray[numpy.uint8]
getHeight(self: depthai.PointCloudData)int
getInstanceNum(self: depthai.PointCloudData)int
getMaxX(self: depthai.PointCloudData)float
getMaxY(self: depthai.PointCloudData)float
getMaxZ(self: depthai.PointCloudData)float
getMinX(self: depthai.PointCloudData)float
getMinY(self: depthai.PointCloudData)float
getMinZ(self: depthai.PointCloudData)float
getPoints(self: object) → numpy.ndarray[numpy.float32]
getRaw(self: depthai.ADatatype)depthai.RawBuffer
getSequenceNum(self: depthai.PointCloudData)int
getTimestamp(self: depthai.PointCloudData)datetime.timedelta
getTimestampDevice(self: depthai.PointCloudData)datetime.timedelta
getWidth(self: depthai.PointCloudData)int
isSparse(self: depthai.PointCloudData)bool
setData(*args, **kwargs)

Overloaded function.

  1. setData(self: depthai.Buffer, arg0: list[int]) -> None

  2. setData(self: depthai.Buffer, arg0: numpy.ndarray[numpy.uint8]) -> None

setHeight(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData
setInstanceNum(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData
setMaxX(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData
setMaxY(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData
setMaxZ(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData
setMinX(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData
setMinY(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData
setMinZ(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData
setSequenceNum(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData
setSize(*args, **kwargs)

Overloaded function.

  1. setSize(self: depthai.PointCloudData, width: int, height: int) -> depthai.PointCloudData

  2. setSize(self: depthai.PointCloudData, size: tuple[int, int]) -> depthai.PointCloudData

setTimestamp(self: depthai.PointCloudData, arg0: datetime.timedelta)depthai.PointCloudData
setTimestampDevice(self: depthai.PointCloudData, arg0: datetime.timedelta)depthai.PointCloudData
setWidth(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData
class dai::PointCloudData : public dai::Buffer

PointCloudData message. Carries point cloud data.

Public Functions

PointCloudData()

Construct PointCloudData message.

PointCloudData(std::shared_ptr<RawPointCloudData> ptr)
~PointCloudData() = default
std::vector<Point3f> &getPoints()
unsigned int getInstanceNum() const

Retrieves instance number

unsigned int getWidth() const

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

unsigned int getHeight() const

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

float getMinX() const

Retrieves minimal x coordinate in depth units (millimeter by default)

float getMinY() const

Retrieves minimal y coordinate in depth units (millimeter by default)

float getMinZ() const

Retrieves minimal z coordinate in depth units (millimeter by default)

float getMaxX() const

Retrieves maximal x coordinate in depth units (millimeter by default)

float getMaxY() const

Retrieves maximal y coordinate in depth units (millimeter by default)

float getMaxZ() const

Retrieves maximal z coordinate in depth units (millimeter by default)

bool isSparse() const

Retrieves whether point cloud is sparse

PointCloudData &setTimestamp(std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> timestamp)

Retrieves image timestamp related to dai::Clock::now()

PointCloudData &setTimestampDevice(std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> timestamp)

Sets image timestamp related to dai::Clock::now()

PointCloudData &setInstanceNum(unsigned int instance)

Instance number relates to the origin of the frame (which camera)

Parameters
  • instance: Instance number

PointCloudData &setSequenceNum(int64_t seq)

Specifies sequence number

Parameters
  • seq: Sequence number

PointCloudData &setWidth(unsigned int width)

Specifies frame width

Parameters
  • width: frame width

PointCloudData &setHeight(unsigned int height)

Specifies frame height

Parameters
  • height: frame height

PointCloudData &setSize(unsigned int width, unsigned int height)

Specifies frame size

Parameters
  • height: frame height

  • width: frame width

PointCloudData &setSize(std::tuple<unsigned int, unsigned int> size)

Specifies frame size

Parameters
  • size: frame size

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)

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)

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)

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)

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)

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)

template<typename ...T>
void getPclData() const
int64_t getSequenceNum() const

Retrieves sequence number

std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> getTimestamp() const

Retrieves timestamp related to dai::Clock::now()

std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> getTimestampDevice() const

Retrieves timestamp directly captured from device’s monotonic clock, not synchronized to host time. Used mostly for debugging

Private Functions

std::shared_ptr<RawBuffer> serialize() const override

Private Members

RawPointCloudData &pcl
std::vector<Point3f> points
template<typename ...T>
struct dependent_false

Public Static Attributes

constexpr bool value = false

Got questions?

Head over to Discussion Forum for technical support or any other questions you might have.