I have clone the depthai-python repo into my local pc. My goal as of right now is to visualize the pointcloud by using one of the scripts from the github repo. However the script does open the open3d window but it stays white, the top left corner says "open3d not responding". Here is the script that I am running: import open3d as o3d
import numpy as np
import depthai as dai
import queue
q = queue.Queue()
pipeline = dai.Pipeline()
PointCloud = pipeline.create(dai.node.PointCloud)
pcd = o3d.geometry.PointCloud()
vis = o3d.visualization.VisualizerWithKeyCallback()
vis.create_window()
with dai.Device(pipeline) as device:
coordinateFrame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=1000, origin=[0,0,0])
vis.add_geometry(coordinateFrame)
while device.isPipelineRunning():
inMessage = q.get()
inColor = inMessage["rgb"]
inPointCloud = inMessage["pcl"]
cvColorFrame = inColor.getCvFrame()
if inPointCloud:
points = inPointCloud.getPoints().astype(np.float64)
pcd.points = o3d.utility.Vector3dVector(points)
colors = (cvRGBFrame.reshape(-1, 3) / 255.0).astype(np.float64)
pcd.colors = o3d.utility.Vector3dVector(colors)
vis.update_geometry(pcd)
vis.poll_events()
vis.update_renderer()
vis.destroy_window()
Another issue I am encountering is: inMessage=q.get() whenever I am running the script pointcloudcontrol.py and visualize_pointcloud.py.
PS C:\Users\deg6fni\Desktop\depthai-python> & C:/Users/deg6fni/.conda/envs/camera/python.exe c:/Users/deg6fni/Desktop/depthai-python/examples/PointCloud/visualize_pointcloud.py
[14442C10E133B3CF00] [169.254.1.222] [7.075] [StereoDepth(3)] [error] Disparity/depth width must be multiple of 16, but RGB camera width is 427. Set output size explicitly using 'setOutputSize(width, height)'.
[14442C10E133B3CF00] [169.254.1.222] [1719577860.597] [host] [warning] Monitor thread (device: 14442C10E133B3CF00 [169.254.1.222]) - ping was missed, closing the device connection
[14442C10E133B3CF00] [169.254.1.222] [1719577869.977] [host] [warning] Device crashed, but no crash dump could be extracted.
Traceback (most recent call last):
File "c:\Users\deg6fni\Desktop\depthai-python\examples\PointCloud\visualize_pointcloud.py", line 87, in <module>
inMessage = q.get()
^^^^^^^
RuntimeError: Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'out' (X_LINK_ERROR)'