# PointCloudConfig

`PointCloudConfig` carries configuration for the
[PointCloud](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/pointcloud.md) node. It can be set via
`initialConfig` before pipeline start or sent at runtime through the `inputConfig` queue.

## Configuration options

 * `setOrganized(bool)` — When `true`, output keeps all `width × height` points (including invalid z ≤ 0). When `false` (default),
   only valid points are emitted.
 * `setLengthUnit(LengthUnit)` — Output coordinate unit: `METER`, `CENTIMETER`, `MILLIMETER` (default), `INCH`, `FOOT`.
 * Setting the coordinate system * `setTransformationMatrix(matrix)` — Apply a custom 4×4 (or 3×3 rotation-only) transformation to
   every output point. Default: identity. Only used when coordinate system type is `DEFAULT`.
    * `setTargetCoordinateSystem(CameraBoardSocket)` — Transform points into the frame of another camera socket using device
      calibration.
    * `setTargetCoordinateSystem(HousingCoordinateSystem)` — Transform points into a housing coordinate system.

### Output coordinate system selection

The three coordinate system modes are mutually exclusive:

 * `DEFAULT` — Uses the identity or custom transformation matrix (if set) composed with frame extrinsics.
 * `CAMERA_SOCKET` — Transforms into the target camera's coordinate frame via calibration.
 * `HOUSING` — Transforms into a housing coordinate system via calibration.

## Reference

#### 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, bool useSpecTranslation)

Kind: function

Set target coordinate system to another camera socket. parameters: targetCamera: Target camera socket; useSpecTranslation: Use
spec translation instead of calibration (default: false)

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

Kind: function

Set target coordinate system to housing coordinate system. parameters: housingCS: Target housing coordinate system;
useSpecTranslation: Whether to use spec translation (default: true)

#### 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, 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, bool useSpecTranslation)

Kind: function

Set target coordinate system to another camera socket. parameters: targetCamera: Target camera socket; useSpecTranslation: Use
spec translation instead of calibration (default: false)

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

Kind: function

Set target coordinate system to housing coordinate system. parameters: housingCS: Target housing coordinate system;
useSpecTranslation: Whether to use spec translation (default: true)

#### 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, organized, transformationMatrix, lengthUnit, coordSystemType, targetCameraSocket, targetHousingCS, useSpecTranslation)

Kind: function

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
