# PointCloudConfig

PointCloudConfig 携带用于 [点云](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/pointcloud.md)
节点的配置。可在管道启动前通过 initialConfig 设置，或在运行时通过 inputConfig 队列发送。

## 配置选项

 * setOrganized(bool) — 当为 true 时，输出保留所有 width × height 点（包括无效的 z ≤ 0 点）。当为 false（默认）时，仅输出有效点。
 * setLengthUnit(LengthUnit) — 输出坐标单位：METER、CENTIMETER、MILLIMETER（默认）、INCH、FOOT。
 * 设置坐标系
   * setTransformationMatrix(matrix) — 对每个输出点应用自定义的 4×4（或仅旋转的 3×3）变换。默认：单位矩阵。仅当坐标系类型为 DEFAULT 时使用。
   * setTargetCoordinateSystem(CameraBoardSocket) — 通过设备标定将点变换到另一个摄像头插座的坐标系中。
   * setTargetCoordinateSystem(HousingCoordinateSystem) — 将点变换到外壳坐标系中。

### 输出坐标系选择

三种坐标系模式互斥：

 * DEFAULT — 使用单位矩阵或自定义变换矩阵（若已设置），并组合帧外参。
 * CAMERA_SOCKET — 通过标定将点变换到目标摄像头的坐标系中。
 * HOUSING — 通过标定将点变换到外壳坐标系中。

## 参考

#### Python

### dai::PointCloudConfig

Kind: class

PointCloudConfig message. Carries point cloud output settings.

#### uint8_t CoordinateSystemType

Kind: enum

##### DEFAULT

Kind: enum_value

Default (camera coordinates, no additional transformation)

##### CAMERA_SOCKET

Kind: enum_value

Transform to another camera.

##### HOUSING

Kind: enum_value

Transform to housing coordinate system.

#### PointCloudConfig()

Kind: function

#### ~PointCloudConfig()

Kind: function

#### bool getOrganized()

Kind: function

Retrieve whether the point cloud is organized (all width*height points kept). return: true if all width*height points are output,
false if only valid (z > 0) points are kept

#### std::array< std::array< float, 4 >, 4 > getTransformationMatrix()

Kind: function

Retrieve transformation matrix applied to every output point. return: 4x4 row-major transformation matrix (identity by default)

#### LengthUnit getLengthUnit()

Kind: function

Retrieve the length unit used for output point coordinates.

#### PointCloudConfig & setOrganized(bool enable)

Kind: function

Enable or disable organized point cloud output. When true all width*height points are kept; when false only points with z > 0 are
emitted.

#### PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 4 >, 4 > & transformationMatrix)

Kind: function

Set a 4x4 transformation matrix applied to every output point. Default is the identity matrix.

#### PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 3 >, 3 > & transformationMatrix)

Kind: function

Convenience overload: set a 3x3 rotation matrix (translation set to zero).

#### PointCloudConfig & setLengthUnit(LengthUnit unit)

Kind: function

Set the length unit for output point coordinates.

#### PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera)

Kind: function

Set target coordinate system to another camera socket. parameters: targetCamera: Target camera socket

#### PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS)

Kind: function

Set target coordinate system to housing coordinate system. parameters: housingCS: Target housing coordinate system

#### PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera, bool useSpecTranslation)

Kind: function

Deprecated: use setTargetCoordinateSystem(targetCamera) instead.

#### PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS, bool useSpecTranslation)

Kind: function

Deprecated: use setTargetCoordinateSystem(housingCS) instead.

#### CoordinateSystemType getCoordinateSystemType()

Kind: function

Retrieve the coordinate system type.

#### CameraBoardSocket getTargetCameraSocket()

Kind: function

Retrieve the target camera socket (valid when coordSystemType == CAMERA_SOCKET).

#### HousingCoordinateSystem getTargetHousingCS()

Kind: function

Retrieve the target housing coordinate system (valid when coordSystemType == HOUSING).

#### bool getUseSpecTranslation()

Kind: function

Retrieve whether spec translation is used.

#### DatatypeEnum getDatatype()

Kind: function

Get the datatype of this specific message.

return: DatatypeEnum

#### void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)

Kind: function

#### DEPTHAI_SERIALIZE(PointCloudConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, organized,
transformationMatrix, lengthUnit, coordSystemType, targetCameraSocket, targetHousingCS, useSpecTranslation)

Kind: function

#### C++

### dai::PointCloudConfig

Kind: class

PointCloudConfig message. Carries point cloud output settings.

#### uint8_t CoordinateSystemType

Kind: enum

##### DEFAULT

Kind: enum_value

Default (camera coordinates, no additional transformation)

##### CAMERA_SOCKET

Kind: enum_value

Transform to another camera.

##### HOUSING

Kind: enum_value

Transform to housing coordinate system.

#### PointCloudConfig()

Kind: function

#### ~PointCloudConfig()

Kind: function

#### bool getOrganized()

Kind: function

Retrieve whether the point cloud is organized (all width*height points kept). return: true if all width*height points are output,
false if only valid (z > 0) points are kept

#### std::array< std::array< float, 4 >, 4 > getTransformationMatrix()

Kind: function

Retrieve transformation matrix applied to every output point. return: 4x4 row-major transformation matrix (identity by default)

#### LengthUnit getLengthUnit()

Kind: function

Retrieve the length unit used for output point coordinates.

#### PointCloudConfig & setOrganized(bool enable)

Kind: function

Enable or disable organized point cloud output. When true all width*height points are kept; when false only points with z > 0 are
emitted.

#### PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 4 >, 4 > & transformationMatrix)

Kind: function

Set a 4x4 transformation matrix applied to every output point. Default is the identity matrix.

#### PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 3 >, 3 > & transformationMatrix)

Kind: function

Convenience overload: set a 3x3 rotation matrix (translation set to zero).

#### PointCloudConfig & setLengthUnit(LengthUnit unit)

Kind: function

Set the length unit for output point coordinates.

#### PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera)

Kind: function

Set target coordinate system to another camera socket. parameters: targetCamera: Target camera socket

#### PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS)

Kind: function

Set target coordinate system to housing coordinate system. parameters: housingCS: Target housing coordinate system

#### PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera, bool useSpecTranslation)

Kind: function

Deprecated: use setTargetCoordinateSystem(targetCamera) instead.

#### PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS, bool useSpecTranslation)

Kind: function

Deprecated: use setTargetCoordinateSystem(housingCS) instead.

#### CoordinateSystemType getCoordinateSystemType()

Kind: function

Retrieve the coordinate system type.

#### CameraBoardSocket getTargetCameraSocket()

Kind: function

Retrieve the target camera socket (valid when coordSystemType == CAMERA_SOCKET).

#### HousingCoordinateSystem getTargetHousingCS()

Kind: function

Retrieve the target housing coordinate system (valid when coordSystemType == HOUSING).

#### bool getUseSpecTranslation()

Kind: function

Retrieve whether spec translation is used.

#### DatatypeEnum getDatatype()

Kind: function

Get the datatype of this specific message.

return: DatatypeEnum

#### void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)

Kind: function

#### DEPTHAI_SERIALIZE(PointCloudConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, organized,
transformationMatrix, lengthUnit, coordSystemType, targetCameraSocket, targetHousingCS, useSpecTranslation)

Kind: function

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
