C# 向远程用户发送Kinect V2点云数据
我目前正在使用Kinect V2将深度图像数据从一个位置传输到另一个远程位置。我能够使用C#从Kinect V2中提取深度图像。现在,我希望能够将这些数据发送给远程用户,以便远程用户可以查看远程用户的三维视图。有人有任何教程或有用的指针吗 谢谢您可以使用库来管理和创建实时流媒体。您可以从Kinectv2保留帧(或直接生成)视频。通过使用OpenCV库方法,您可以从Kinectv2输出帧生成视频文件。OpenKinect for Processing是一个用户友好且易于使用的库,可在浏览器上运行。对于快速教程,您可以查看此内容并浏览这个小youtube 现在,您可以开始编辑此代码示例:C# 向远程用户发送Kinect V2点云数据,c#,kinect,kinect-v2,C#,Kinect,Kinect V2,我目前正在使用Kinect V2将深度图像数据从一个位置传输到另一个远程位置。我能够使用C#从Kinect V2中提取深度图像。现在,我希望能够将这些数据发送给远程用户,以便远程用户可以查看远程用户的三维视图。有人有任何教程或有用的指针吗 谢谢您可以使用库来管理和创建实时流媒体。您可以从Kinectv2保留帧(或直接生成)视频。通过使用OpenCV库方法,您可以从Kinectv2输出帧生成视频文件。OpenKinect for Processing是一个用户友好且易于使用的库,可在浏览器上运行。
// Daniel Shiffman
// Kinect Point Cloud example
// https://github.com/shiffman/OpenKinect-for-Processing
// http://shiffman.net/p5/kinect/
import org.openkinect.freenect.*;
import org.openkinect.processing.*;
// Kinect Library object
Kinect kinect;
// Angle for rotation
float a = 0;
// We'll use a lookup table so that we don't have to repeat the math over and over
float[] depthLookUp = new float[2048];
void setup() {
// Rendering in P3D
size(800, 600, P3D);
kinect = new Kinect(this);
kinect.initDepth();
// Lookup table for all possible depth values (0 - 2047)
for (int i = 0; i < depthLookUp.length; i++) {
depthLookUp[i] = rawDepthToMeters(i);
}
}
void draw() {
background(0);
// Get the raw depth as array of integers
int[] depth = kinect.getRawDepth();
// We're just going to calculate and draw every 4th pixel (equivalent of 160x120)
int skip = 4;
// Translate and rotate
translate(width/2, height/2, -50);
//rotateY(a);
// Nested for loop that initializes x and y pixels and, for those less than the
// maximum threshold and at every skiping point, the offset is caculated to map
// them on a plane instead of just a line
for (int x = 0; x < kinect.width; x += skip) {
for (int y = 0; y < kinect.height; y += skip) {
int offset = x + y*kinect.width;
// Convert kinect data to world xyz coordinate
int rawDepth = depth[offset];
PVector v = depthToWorld(x, y, rawDepth);
stroke(255);
pushMatrix();
// Scale up by 200
float factor = 200;
translate(v.x*factor, v.y*factor, factor-v.z*factor);
// Draw a point
point(0, 0);
popMatrix();
}
}
// Rotate
a += 0.015f;
}
// These functions come from: http://graphics.stanford.edu/~mdfisher/Kinect.html
float rawDepthToMeters(int depthValue) {
if (depthValue < 2047) {
return (float)(1.0 / ((double)(depthValue) * -0.0030711016 + 3.3309495161));
}
return 0.0f;
}
// Only needed to make sense of the ouput depth values from the kinect
PVector depthToWorld(int x, int y, int depthValue) {
final double fx_d = 1.0 / 5.9421434211923247e+02;
final double fy_d = 1.0 / 5.9104053696870778e+02;
final double cx_d = 3.3930780975300314e+02;
final double cy_d = 2.4273913761751615e+02;
// Drawing the result vector to give each point its three-dimensional space
PVector result = new PVector();
double depth = depthLookUp[depthValue];//rawDepthToMeters(depthValue);
result.x = (float)((x - cx_d) * depth * fx_d);
result.y = (float)((y - cy_d) * depth * fy_d);
result.z = (float)(depth);
return result;
}
//丹尼尔·希夫曼
//Kinect点云示例
// https://github.com/shiffman/OpenKinect-for-Processing
// http://shiffman.net/p5/kinect/
导入org.openkinect.freenect.*;
导入org.openkinect.processing.*;
//Kinect库对象
Kinect-Kinect;
//旋转角度
浮点数a=0;
//我们将使用一个查找表,这样我们就不必一遍又一遍地重复计算
float[]depthLookUp=新的float[2048];
无效设置(){
//P3D渲染
尺寸(800600,P3D);
kinect=新的kinect(本);
kinect.initDepth();
//所有可能深度值的查找表(0-2047)
for(int i=0;i
是否要发送3D环境的点云?我要发送环境中人员的3D视频(带有深度数据)。这样远程用户就可以看到这个3D视频(带有深度数据),谢谢。处理是一个基于Java的环境。我目前正在使用C#的Unity3D上工作。我想我无法将其与Unity3D集成。您认为呢?您可以将处理代码的输出保留在某个位置,然后将其作为C#代码的输入进行处理。