PointCloudConfig
PointCloudConfig
is a configuration class used to adjust settings for point cloud generation within the DepthAI ecosystem. It allows users to configure properties such as sparsity and transformation matrices, which are crucial for tailoring the point cloud data to specific application requirements.Configuration Options
- Sparsity: Determines whether the generated point cloud should be sparse. Sparse point clouds may omit points based on certain criteria, such as depth value thresholds, to reduce data volume and processing requirements.
- Transformation Matrix: Applies a transformation matrix to the point cloud data, enabling rotations, translations, and scaling to align the point cloud with a world or application-specific coordinate system.
Usage
ConfiguringPointCloudConfig
allows for precise control over the generation of point cloud data. Here's an example of how to configure and apply PointCloudConfig
in a DepthAI application:Python
C++
Python
Python
1import depthai as dai
2
3# Create pipeline
4pipeline = dai.Pipeline()
5
6# Create PointCloud node
7pointCloud = pipeline.create(dai.node.PointCloud)
8
9pointCloud.initialConfig.setSparse(True) # Enable sparse point cloud generation
10
11# Define a transformation matrix
12transformationMatrix = [
13 [1.0, 0.0, 0.0, 0.0],
14 [0.0, 1.0, 0.0, 0.0],
15 [0.0, 0.0, 1.0, 0.0],
16 [0.0, 0.0, 0.0, 1.0]
17]
18pointCloud.initialConfig.setTransformationMatrix(transformationMatrix) # Apply transformation matrix
19
20# Further pipeline setup and execution...
PointCloudConfig
, setting it to generate sparse point clouds, and applying a transformation matrix. This configuration is then applied to a PointCloud
node within the DepthAI pipeline.Examples of Functionality
- 3D Object Localization: Adjusting the transformation matrix to align point clouds with a known coordinate system for precise object placement.
- Scene Optimization: Utilizing sparse point clouds for efficient processing in large-scale or complex scenes.
- Data Alignment: Applying transformation matrices for seamless integration of point cloud data with other sensor data or pre-existing 3D models.
Reference
Python
C++
Python
class
depthai.PointCloudConfig(depthai.Buffer)
method
method
get(self) -> RawPointCloudConfig: RawPointCloudConfig
Retrieve configuration data for SpatialLocationCalculator. Returns: config for SpatialLocationCalculator
method
getSparse(self) -> bool: bool
Retrieve sparse point cloud calculation status. Returns: true if sparse point cloud calculation is enabled, false otherwise
method
getTransformationMatrix(self) -> typing.Annotated[list[typing.Annotated[list[float], pybind11_stubgen.typing_ext.FixedSize(4)]], pybind11_stubgen.typing_ext.FixedSize(4)]: typing.Annotated[list[typing.Annotated[list[float], pybind11_stubgen.typing_ext.FixedSize(4)]], pybind11_stubgen.typing_ext.FixedSize(4)]
Retrieve transformation matrix for point cloud calculation. Returns: 4x4 transformation matrix
method
set(self, config: RawPointCloudConfig) -> PointCloudConfig: PointCloudConfig
Set explicit configuration. Parameter ``config``: Explicit configuration
method
setSparse(self, arg0: bool) -> PointCloudConfig: PointCloudConfig
Enable or disable sparse point cloud calculation. Parameter ``enable``:
method
Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.