Skip to content

Commit 8f9250a

Browse files
committed
update 2 examples to work with python3 and python2
1 parent 0117b29 commit 8f9250a

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

examples/cloud.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import cyni
22
import numpy as np
3-
import Image
3+
from PIL import Image
44

55
cyni.initialize()
66
device = cyni.getAnyDevice()
77
device.open()
8-
depthStream = device.createStream("depth", fps=30)
9-
colorStream = device.createStream("color", fps=30)
8+
depthStream = device.createStream(b"depth", fps=30)
9+
#colorStream = device.createStream(b"color", fps=30)
1010
depthStream.start()
11-
colorStream.start()
12-
colorFrame = colorStream.readFrame()
11+
#colorStream.start()
12+
#colorFrame = colorStream.readFrame()
1313
depthFrame = depthStream.readFrame()
14-
cloud = cyni.depthMapToPointCloud(depthFrame.data, depthStream, colorFrame.data)
15-
cyni.writePCD(cloud, "cloud.pcd")
16-
readCloud = cyni.readPCD("cloud.pcd")
17-
cyni.writePCD(readCloud, "cloud2.pcd", ascii=True)
14+
cloud = cyni.depthMapToPointCloud(depthFrame.data, depthStream)
15+
#cloud = cyni.depthMapToPointCloud(depthFrame.data, depthStream, colorFrame.data)
16+
cyni.writePCD(cloud, "cloud.pcd", ascii=True)
17+
#readCloud = cyni.readPCD("cloud.pcd")
18+
#cyni.writePCD(readCloud, "cloud2.pcd", ascii=True)

examples/simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import cyni
22
import numpy as np
3-
import Image
3+
from PIL import Image
44

55
cyni.initialize()
66
device = cyni.getAnyDevice()

0 commit comments

Comments
 (0)