Skip to content

Instantly share code, notes, and snippets.

@mikebridge
Last active January 20, 2017 00:14
Show Gist options
  • Select an option

  • Save mikebridge/385e085895e5ef490ee53178995dba6d to your computer and use it in GitHub Desktop.

Select an option

Save mikebridge/385e085895e5ef490ee53178995dba6d to your computer and use it in GitHub Desktop.
// Adapted from https://github.com/ThomasLengeling/KinectPV2/blob/master/KinectPV2/examples/PointCloudDepth/PointCloudDepth.pde
KinectPV2 kinect;
int maxD = 4500; // 4.5m
int minD = 0; // 50cm
void setup() {
size(1024, 424, P3D);
kinect = new KinectPV2(this);
kinect.enableDepthImg(true);
kinect.enablePointCloud(true);
kinect.init();
}
void draw() {
background(0);
image(kinect.getDepthImage(), 0, 0);
image(kinect.getPointCloudDepthImage(), 512, 0);
kinect.setLowThresholdPC(minD);
kinect.setHighThresholdPC(maxD);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment