Skip to content

Commit

Permalink
update 2 examples to work with python3 and python2
Browse files Browse the repository at this point in the history
  • Loading branch information
oroulet committed Jul 20, 2016
1 parent 0117b29 commit 8f9250a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions examples/cloud.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion examples/simple.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cyni
import numpy as np
import Image
from PIL import Image

cyni.initialize()
device = cyni.getAnyDevice()
Expand Down

0 comments on commit 8f9250a

Please sign in to comment.