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

本页目录

  • 配置选项
  • 输出坐标系选择
  • 参考

PointCloudConfig

PointCloudConfig 承载着 PointCloud 节点的配置。它可以在管道启动前通过 initialConfig 设置,也可以在运行时通过 inputConfig 队列发送。

配置选项

  • setOrganized(bool) — 当设置为 true 时,输出会保留所有 width × height 个点(包括无效的 z ≤ 0)。当设置为 false(默认值)时,只输出有效点。
  • setLengthUnit(LengthUnit) — 输出坐标单位:METERCENTIMETERMILLIMETER(默认值)、INCHFOOT
  • 设置坐标系
    • setTransformationMatrix(matrix) — 对每个输出点应用自定义的 4×4(或仅包含 3×3 旋转)变换矩阵。默认值:单位矩阵。仅当坐标系类型为 DEFAULT 时使用。
    • setTargetCoordinateSystem(CameraBoardSocket) — 使用设备校准将点变换到另一个摄像头接口的坐标系中。
    • setTargetCoordinateSystem(HousingCoordinateSystem) — 将点变换到外壳坐标系中。

输出坐标系选择

这三种坐标系模式是互斥的:
  • DEFAULT — 使用单位矩阵或自定义变换矩阵(如果已设置),并与帧外参组合。
  • CAMERA_SOCKET — 通过校准变换到目标摄像头的坐标系。
  • HOUSING — 通过校准变换到外壳坐标系。

参考

Python

class

dai::PointCloudConfig

#include PointCloudConfig.hpp
function
PointCloudConfig()
function
~PointCloudConfig()
function
bool getOrganized()
Retrieve whether the point cloud is organized (all width*height points kept).
Returns
true if all width*height points are output, false if only valid (z > 0) points are kept
function
std::array< std::array< float, 4 >, 4 > getTransformationMatrix()
Retrieve transformation matrix applied to every output point.
Returns
4x4 row-major transformation matrix (identity by default)
function
LengthUnit getLengthUnit()
Retrieve the length unit used for output point coordinates.
function
PointCloudConfig & setOrganized(bool enable)
Enable or disable organized point cloud output. When true all width*height points are kept; when false only points with z > 0 are emitted.
function
PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 4 >, 4 > & transformationMatrix)
Set a 4x4 transformation matrix applied to every output point. Default is the identity matrix.
function
PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 3 >, 3 > & transformationMatrix)
Convenience overload: set a 3x3 rotation matrix (translation set to zero).
function
PointCloudConfig & setLengthUnit(LengthUnit unit)
Set the length unit for output point coordinates.
function
PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera, bool useSpecTranslation)
Set target coordinate system to another camera socket.
Parameters
  • targetCamera: Target camera socket
  • useSpecTranslation: Use spec translation instead of calibration (default: false)
function
PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS, bool useSpecTranslation)
Set target coordinate system to housing coordinate system.
Parameters
  • housingCS: Target housing coordinate system
  • useSpecTranslation: Whether to use spec translation (default: true)
function
CoordinateSystemType getCoordinateSystemType()
Retrieve the coordinate system type.
function
CameraBoardSocket getTargetCameraSocket()
Retrieve the target camera socket (valid when coordSystemType == CAMERA_SOCKET).
function
HousingCoordinateSystem getTargetHousingCS()
Retrieve the target housing coordinate system (valid when coordSystemType == HOUSING).
function
bool getUseSpecTranslation()
Retrieve whether spec translation is used.
inline function
DatatypeEnum getDatatype()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(PointCloudConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, organized, transformationMatrix, lengthUnit, coordSystemType, targetCameraSocket, targetHousingCS, useSpecTranslation)
enum

uint8_t CoordinateSystemType

enumerator
DEFAULT
enumerator
CAMERA_SOCKET
enumerator
HOUSING

C++

class

dai::PointCloudConfig

#include PointCloudConfig.hpp
function
PointCloudConfig()
function
~PointCloudConfig()
function
bool getOrganized()
Retrieve whether the point cloud is organized (all width*height points kept).
Returns
true if all width*height points are output, false if only valid (z > 0) points are kept
function
std::array< std::array< float, 4 >, 4 > getTransformationMatrix()
Retrieve transformation matrix applied to every output point.
Returns
4x4 row-major transformation matrix (identity by default)
function
LengthUnit getLengthUnit()
Retrieve the length unit used for output point coordinates.
function
PointCloudConfig & setOrganized(bool enable)
Enable or disable organized point cloud output. When true all width*height points are kept; when false only points with z > 0 are emitted.
function
PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 4 >, 4 > & transformationMatrix)
Set a 4x4 transformation matrix applied to every output point. Default is the identity matrix.
function
PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 3 >, 3 > & transformationMatrix)
Convenience overload: set a 3x3 rotation matrix (translation set to zero).
function
PointCloudConfig & setLengthUnit(LengthUnit unit)
Set the length unit for output point coordinates.
function
PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera, bool useSpecTranslation)
Set target coordinate system to another camera socket.
Parameters
  • targetCamera: Target camera socket
  • useSpecTranslation: Use spec translation instead of calibration (default: false)
function
PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS, bool useSpecTranslation)
Set target coordinate system to housing coordinate system.
Parameters
  • housingCS: Target housing coordinate system
  • useSpecTranslation: Whether to use spec translation (default: true)
function
CoordinateSystemType getCoordinateSystemType()
Retrieve the coordinate system type.
function
CameraBoardSocket getTargetCameraSocket()
Retrieve the target camera socket (valid when coordSystemType == CAMERA_SOCKET).
function
HousingCoordinateSystem getTargetHousingCS()
Retrieve the target housing coordinate system (valid when coordSystemType == HOUSING).
function
bool getUseSpecTranslation()
Retrieve whether spec translation is used.
inline function
DatatypeEnum getDatatype()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(PointCloudConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, organized, transformationMatrix, lengthUnit, coordSystemType, targetCameraSocket, targetHousingCS, useSpecTranslation)
enum

uint8_t CoordinateSystemType

enumerator
DEFAULT
enumerator
CAMERA_SOCKET
enumerator
HOUSING

需要帮助?

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