2014-02-14 10 views
1

나는 처리를 위해 SimplePenni 라이브러리와 함께 openni2.2, nite2.2 및 kinect SDK 1.6을 설치했습니다. 적외선 이미지를 제외하고는 모두 잘 작동합니다. 단순히 존재하지 않습니다. 동시에 심도있는 이미지를 볼 수 있기 때문에 (그리고 깊이 이미지는 인프라 카메라와 프로젝터 작동을 논리적으로 필요로하기 때문에) 정말 이상합니다. 그래서 드라이버 나 소프트웨어에 문제가 있다고 가정합니까? 적외선 카메라로 kinect를 사용하고 싶습니다. 제발 도와주세요, 내 테스트 코드를 첨부하십시오 :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); 
} 
+0

이미지 오류 표시 : http://i.imgur.com/jzdqbXN.jpg?1 – doku

답변

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

} 
+0

감사하지만 문제는 내가 원하는입니다 보시고 추적하세요 - led가 심도에서 검은 색 틈으로 보입니다.하지만 kinect Infra 이미 터를 덮으면 곧 사라집니다 ... – doku

0

여기에 있습니다 :

context.enableIR(1,1,1); 
+0

Holey moley -> 그는 맞습니다 (왜 -1일까요?) 참조 용 코드 완성 : –

0

적외선 스트림을 캡처 할 수 있지만 볼 수 없습니까?

그런 다음 문제는 RANGE 일 수 있습니다 ([0, 255] 임).

이 문제는 Python 및 C++에서 발생했습니다. 배열을 범위 (최대 - 최소)로 나눈 값을 구한 다음 모든 항목에 255를 곱합니다.

0

user3550091가 맞습니다! 여기에 참고로 내 전체 작업 코드 (처리 + 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); 
}