Processing Kinect红外图像未显示-为什么?
我已经安装了openni2.2、nite2.2和kinect SDK 1.6以及SimplePenni库以进行处理。除了红外图像,一切都很好——根本不存在。这真的很奇怪,因为在同一时间,我可以清楚地看到深度图像(和深度图像逻辑上需要红外线相机和投影仪的工作运行)。所以我假设驱动程序或软件有问题?我想使用kinect作为红外摄像机。请帮助,下面我附上我的测试代码:Processing Kinect红外图像未显示-为什么?,processing,openni,kinect-sdk,infrared,simple-openni,Processing,Openni,Kinect Sdk,Infrared,Simple Openni,我已经安装了openni2.2、nite2.2和kinect SDK 1.6以及SimplePenni库以进行处理。除了红外图像,一切都很好——根本不存在。这真的很奇怪,因为在同一时间,我可以清楚地看到深度图像(和深度图像逻辑上需要红外线相机和投影仪的工作运行)。所以我假设驱动程序或软件有问题?我想使用kinect作为红外摄像机。请帮助,下面我附上我的测试代码: /*-----------------------------------------------------------------
/*--------------------------------------------------------------------------
*SimplePenni IR试验
* --------------------------------------------------------------------------
*处理OpenNI/Kinect库的包装器
* http://code.google.com/p/simple-openni
* --------------------------------------------------------------------------
*项目:Max Rheiner/交互设计/zhdk/http://iad.zhdk.ch/
*日期:2011年2月16日(年月日)
* ----------------------------------------------------------------------------
*/
导入SimplePenni。*;
simplepenni语境;
无效设置()
{
上下文=新的SimplePenni(此);
//启用深度映射生成
if(context.enableDepth()==false)
{
println(“无法打开深度图,可能相机未连接!”);
退出();
返回;
}
//启用ir生成
if(context.enableIR()==false)
{
println(“无法打开深度图,可能相机未连接!”);
退出();
返回;
}
背景(200,0,0);
大小(context.depthWidth()+context.irWidth()+10,context.depthHeight());
}
作废提款()
{
//更新cam
update();
//绘制深度图像图
图像(context.depthImage(),0,0);
//画虹膜图
图像(context.irImage(),context.depthWidth()+10,0);
}
我也有同样的问题。
这不是一个解决方案,但我能从kinect获取的最接近红外图像是从深度图像获取点云
那个soltuion在这里
import SimpleOpenNI.*;
import processing.opengl.*;
SimpleOpenNI kinect;
void setup()
{
size( 1024, 768, OPENGL);
kinect = new SimpleOpenNI( this );
kinect.enableDepth();
}
void draw()
{
background( 0);
kinect.update();
image(kinect.depthImage(),0,0,160,120);//check depth image
translate( width/2, height/2, -1000);
rotateX( radians(180));
stroke(255);
PVector[] depthPoints = kinect.depthMapRealWorld();
//the program get stucked in the for loop it loops 307200 times and I don't have any points output
for( int i = 0; i < depthPoints.length ; i+=4)//draw point for every 4th pixel
{
PVector currentPoint = depthPoints[i];
if(i == 0) println(currentPoint);
point(currentPoint.x, currentPoint.y, currentPoint.z );
}
}
导入SimplePenni.*;
导入处理;
simplepenni-kinect;
无效设置()
{
大小(1024768,OPENGL);
kinect=新的SimplePenni(本);
kinect.enableDepth();
}
作废提款()
{
背景(0);
kinect.update();
图像(kinect.depthImage(),0,0160120);//检查深度图像
平移(宽度/2,高度/2,-1000);
旋转度(弧度(180));
中风(255);
PVector[]depthPoints=kinect.depthMapRealWorld();
//程序在for循环中被卡住了,它循环307200次,我没有任何点输出
对于(int i=0;i
这就是工作:
context.enableIR(1,1,1);
你能捕捉到红外线流,但你就是看不见吗 那么问题可能是
范围(应该在[0255]中)
我在Python和C++中有这个问题;我通过将数组除以范围(max-min),然后将所有条目乘以255来解决这个问题。
user3550091是正确的!
以下是我的完整工作代码(Processing+OpenNI)供参考:
显示错误的图像:谢谢,但问题是我想看到和跟踪红外led-led在深度视图中显示为黑色间隙,但一旦我覆盖kinect红外发射器,它就会消失…Holey moley->他是对的(为什么-1?)这是我的完整代码,仅供参考:
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup(){
size(640 * 2 + 10, 480);
context = new SimpleOpenNI(this);
if(context.isInit() == false){
println("fail");
exit();
return;
}
context.enableDepth();
// enable ir generation
//context.enableIR(); old line
context.enableIR(1,1,1); //new line
background(200,0,0);
}
void draw(){
context.update();
image(context.depthImage(),context.depthWidth() + 10,0);
image(context.irImage(),0,0);
}