The PointCloud node can re-express output points in different coordinate frames using three primary methods:
1. Camera Board Socket
Uses extrinsic calibration between cameras. This is the preferred method for using calibrated translations between specific sockets.
Available sockets: CAM_A through CAM_J.
// Example: Transform to CAM_A coordinate system
pc->setTargetCoordinateSystem(dai::CameraBoardSocket::CAM_A);
Note: The legacy setTargetCoordinateSystem(socket, useSpecTranslation) overload is deprecated.
2. Housing Coordinate System
Uses housing calibration stored on the device. This is useful for aligning point clouds with the physical device housing or IMU.
Available targets include:
CAM_A through CAM_JFRONT_CAM_A through FRONT_CAM_JVESA_A through VESA_JIMU
// Example: Transform to VESA_A coordinate system
pc->setTargetCoordinateSystem(dai::HousingCoordinateSystem::VESA_A);
3. Custom 4×4 Matrix
Apply any homogeneous transform via initialConfig or the runtime inputConfig queue. If a custom matrix is used in conjunction with a Camera Board Socket or Housing Coordinate System, the custom matrix is applied after the calibration-derived transform.
std::array<std::array<float, 4>, 4> mat = {{
{{ 0.f, -1.f, 0.f, 0.f }},
{{ 1.f, 0.f, 0.f, 0.f }},
{{ 0.f, 0.f, 1.f, 0.f }},
{{ 0.f, 0.f, 0.f, 1.f }},
}};
pc->initialConfig->setTransformationMatrix(mat);
// Example of applying a custom 4x4 transformation matrix
std::array<std::array<float, 4>, 4> mat = {{
{{ 0.f, -1.f, 0.f, 0.f }},
{{ 1.f, 0.f, 0.f, 0.f }},
{{ 0.f, 0.f, 1.f, 0.f }},
{{ 0.f, 0.f, 0.f, 1.f }},
}};
pc->initialConfig->setTransformationMatrix(mat);