PointCloud
PointCloud
如何放置
Python
Python
1pipeline = dai.Pipeline()
2pointCloud = pipeline.create(dai.node.PointCloud)输入和输出
使用 Open3D 进行示例可视化
Python
Python
1import open3d as o3d
2import numpy as np
3import depthai as dai
4
5pcd = o3d.geometry.PointCloud()
6vis = o3d.visualization.VisualizerWithKeyCallback()
7vis.create_window()
8
9with dai.Device(pipeline) as device:
10 coordinateFrame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=1000, origin=[0,0,0])
11 vis.add_geometry(coordinateFrame)
12
13 while device.isPipelineRunning():
14 inMessage = q.get()
15 inColor = inMessage["rgb"]
16 inPointCloud = inMessage["pcl"]
17 cvColorFrame = inColor.getCvFrame()
18
19 if inPointCloud:
20 points = inPointCloud.getPoints().astype(np.float64)
21 pcd.points = o3d.utility.Vector3dVector(points)
22 colors = (cvRGBFrame.reshape(-1, 3) / 255.0).astype(np.float64)
23 pcd.colors = o3d.utility.Vector3dVector(colors)
24 vis.update_geometry(pcd)
25
26 vis.poll_events()
27 vis.update_renderer()
28
29 vis.destroy_window()使用 PointCloud 的示例
参考
Python
class
depthai.node.PointCloud(depthai.Node)
method
setNumFramesPool(self, arg0: typing.SupportsInt)Specify number of frames in pool. Parameter ``numFramesPool``: How many frames should the pool have
property
initialConfig
Initial config to use when computing the point cloud.
property
inputConfig
Input PointCloudConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
property
inputDepth
Input message with depth data used to create the point cloud. Default queue is non-blocking with size 4.
property
outputPointCloud
Outputs PointCloudData message
property
passthroughDepth
Passthrough depth from which the point cloud was calculated. Suitable for when input queue is set to non-blocking behavior.
需要帮助?
请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。