【问题标题】:Kinect infra image not showing - why?Kinect 基础图像未显示 - 为什么?
【发布时间】:2014-02-14 23:02:36
【问题描述】:

我已经安装了 openni2.2、nite2.2 和 kinect SDK 1.6 以及用于处理的 Simpleopenni 库。除了红外图像外,一切正常 - 它根本不存在。这真的很奇怪,因为同时我可以清楚地看到深度图像(并且深度图像在逻辑上需要红外摄像机和投影仪才能运行)。所以我认为驱动程序或软件有问题?我想将kinect用作红外相机。请帮忙,下面附上我的测试代码:

/* --------------------------------------------------------------------------
 * SimpleOpenNI IR Test
 * --------------------------------------------------------------------------
 * Processing Wrapper for the OpenNI/Kinect library
 * http://code.google.com/p/simple-openni
 * --------------------------------------------------------------------------
 * prog:  Max Rheiner / Interaction Design / zhdk / http://iad.zhdk.ch/
 * date:  02/16/2011 (m/d/y)
 * ----------------------------------------------------------------------------
 */

import SimpleOpenNI.*;


SimpleOpenNI  context;

void setup()
{
  context = new SimpleOpenNI(this);

  // enable depthMap generation 
  if(context.enableDepth() == false)
  {
     println("Can't open the depthMap, maybe the camera is not connected!"); 
     exit();
     return;
  }

  // enable ir generation
  if(context.enableIR() == false)
  {
     println("Can't open the depthMap, maybe the camera is not connected!"); 
     exit();
     return;
  }

  background(200,0,0);
  size(context.depthWidth() + context.irWidth() + 10, context.depthHeight()); 
}

void draw()
{
  // update the cam
  context.update();

  // draw depthImageMap
  image(context.depthImage(),0,0);

  // draw irImageMap
  image(context.irImage(),context.depthWidth() + 10,0);
}

【问题讨论】:

标签: processing openni kinect-sdk infrared simple-openni


【解决方案1】:

这样就可以了:

context.enableIR(1,1,1);

【讨论】:

  • Holey moley -> 他是对的(为什么是-1?)这是我的完整代码,仅供参考:
【解决方案2】:

我也有同样的问题。 这不是一个解决方案,但我能从 kinect 获取红外图像的最接近方法是从深度图像中获取点云 解决方案就在这里

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 );
  }

}

【讨论】:

  • 谢谢,但问题是我想查看和跟踪红外线 - LED 在深度视图中显示为黑色间隙,但一旦我覆盖 kinect 红外线发射器,它就会消失......
【解决方案3】:

您是否能够捕获红外流,但您只是看不到它?

那么问题可能是RANGE(应该在 [0, 255] 中)。

我在 Python 和 C++ 中遇到过这个问题;我通过将数组除以范围(max-min)然后将所有条目乘以 255 来解决它。

【讨论】:

    【解决方案4】:

    user3550091 是对的! 这里是我完整的工作代码(Processing+OpenNI)供参考:

    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);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-22
      • 2015-12-08
      • 2014-07-15
      相关资源
      最近更新 更多