-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update 2 examples to work with python3 and python2
- Loading branch information
Showing
2 changed files
with
11 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters