Processing (3.5) with kinectV2 on depth value

Hello,
I am working on using Processing 3.0 to get depth value of KinectV2 sensor. The data can show in the Console, but I just do not know how to save the depth data into a csv or txt file (preferred csv). Can someone help a bit? Below is my code.

import KinectPV2.*;
KinectPV2 kinect;

void setup() {
  //size(1024, 848, P3D);
  size(512, 424, P3D);
  kinect = new KinectPV2(this);
  kinect.enableDepthImg(true);
  //kinect.enableInfraredImg(true);
  //kinect.enableInfraredLongExposureImg(true);
  kinect.init();
}

void draw() {
  background(0);
  
  image(kinect.getDepthImage(), 0, 0);
  //raw Data int values from [0 - 4500]
  int [] rawData = kinect.getRawDepthData(); 
  println(rawData);
   
  delay(1000);
  println("haha it is saved!!!!!!!!!!!!!!!!!!!!!!!!!");

}
1 Like

Check out the Table class, if you can find a way to format the data into a table it’s super easy to save as a csv. Here’s a video by Dan Shiffman about the Table class. It’s more about loading data however it covers the structure of the table class.

2 Likes