diff --git a/examples/cloud.py b/examples/cloud.py index 3d9e6b2..4243b8a 100644 --- a/examples/cloud.py +++ b/examples/cloud.py @@ -1,17 +1,18 @@ import cyni import numpy as np -import Image +from PIL import Image cyni.initialize() device = cyni.getAnyDevice() device.open() -depthStream = device.createStream("depth", fps=30) -colorStream = device.createStream("color", fps=30) +depthStream = device.createStream(b"depth", fps=30) +#colorStream = device.createStream(b"color", fps=30) depthStream.start() -colorStream.start() -colorFrame = colorStream.readFrame() +#colorStream.start() +#colorFrame = colorStream.readFrame() depthFrame = depthStream.readFrame() -cloud = cyni.depthMapToPointCloud(depthFrame.data, depthStream, colorFrame.data) -cyni.writePCD(cloud, "cloud.pcd") -readCloud = cyni.readPCD("cloud.pcd") -cyni.writePCD(readCloud, "cloud2.pcd", ascii=True) +cloud = cyni.depthMapToPointCloud(depthFrame.data, depthStream) +#cloud = cyni.depthMapToPointCloud(depthFrame.data, depthStream, colorFrame.data) +cyni.writePCD(cloud, "cloud.pcd", ascii=True) +#readCloud = cyni.readPCD("cloud.pcd") +#cyni.writePCD(readCloud, "cloud2.pcd", ascii=True) diff --git a/examples/simple.py b/examples/simple.py index 9cb2af4..3aa8c99 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -1,6 +1,6 @@ import cyni import numpy as np -import Image +from PIL import Image cyni.initialize() device = cyni.getAnyDevice()