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

PointCloudData message. Carries point cloud data.

getData(self: object) → numpy.ndarray[numpy.uint8]

Get non-owning reference to internal buffer

Returns

Reference to internal buffer

getHeight(self: depthai.PointCloudData)int

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

getInstanceNum(self: depthai.PointCloudData)int

Retrieves instance number

getMaxX(self: depthai.PointCloudData)float

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

getMaxY(self: depthai.PointCloudData)float

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

getMaxZ(self: depthai.PointCloudData)float

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

getMinX(self: depthai.PointCloudData)float

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

getMinY(self: depthai.PointCloudData)float

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

getMinZ(self: depthai.PointCloudData)float

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

getPoints(self: object) → numpy.ndarray[numpy.float32]
getRaw(self: depthai.ADatatype)depthai.RawBuffer
getSequenceNum(self: depthai.PointCloudData)int

Retrieves sequence number

getTimestamp(self: depthai.PointCloudData)datetime.timedelta

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

getTimestampDevice(self: depthai.PointCloudData)datetime.timedelta

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

getWidth(self: depthai.PointCloudData)int

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

isSparse(self: depthai.PointCloudData)bool

Retrieves whether point cloud is sparse

setData(*args, **kwargs)

Overloaded function.

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

Parameter data:

Copies data to internal buffer

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

Parameter data:

Copies data to internal buffer

setHeight(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData

Specifies frame height

Parameter height:

frame height

setInstanceNum(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData

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

Parameter instance:

Instance number

setMaxX(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData

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

Parameter val:

maximal x coordinate in depth units (millimeter by default)

setMaxY(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData

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

Parameter val:

maximal y coordinate in depth units (millimeter by default)

setMaxZ(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData

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

Parameter val:

maximal z coordinate in depth units (millimeter by default)

setMinX(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData

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

Parameter val:

minimal x coordinate in depth units (millimeter by default)

setMinY(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData

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

Parameter val:

minimal y coordinate in depth units (millimeter by default)

setMinZ(self: depthai.PointCloudData, arg0: float)depthai.PointCloudData

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

Parameter val:

minimal z coordinate in depth units (millimeter by default)

setSequenceNum(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData

Specifies sequence number

Parameter seq:

Sequence number

setSize(*args, **kwargs)

Overloaded function.

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

Specifies frame size

Parameter height:

frame height

Parameter width:

frame width

  1. setSize(self: depthai.PointCloudData, size: Tuple[int, int]) -> depthai.PointCloudData

Specifies frame size

Parameter size:

frame size

setTimestamp(self: depthai.PointCloudData, arg0: datetime.timedelta)depthai.PointCloudData

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

setTimestampDevice(self: depthai.PointCloudData, arg0: datetime.timedelta)depthai.PointCloudData

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

setWidth(self: depthai.PointCloudData, arg0: int)depthai.PointCloudData

Specifies frame width

Parameter width:

frame width

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.