Multiple kinects in simpleopenni 0.27 and simpleopenni 1.96

edited October 2015 in Kinect

Hi.

I have a problem with simpleopenni 0.27, it doesn't start multicam.pde, it marks that can't open the depth map, that maybe the camera is not connected, but when I use simpleopenni 1.96, multicam.pde runs without problems, and I was wondering, why? I run them in a laptop, and after checking the code of both codes, the only thing that comes to my mind is that 1.96 is the newer version and comes with new things, like multithread (I assume this allows both kinects running in the same usb hub, but i'm not sure). Does somebody had the same issues with simpleopenni 0.27? how do you fixed it?

Thanks in advance.

Greetings.

Answers

  • Well, now I found out that SimpleOpenNI 0.27 has a trick. You have to put first the second camera then the first ...

    import SimpleOpenNI.*;
    
    SimpleOpenNI  cam1;
    SimpleOpenNI  cam2;
    
    void setup()
    {
      size(640 * 2 + 10,480 * 2 + 10); 
    
      // start OpenNI, loads the library
      SimpleOpenNI.start();
    
      // print all the cams 
      StrVector strList = new StrVector();
      SimpleOpenNI.deviceNames(strList);
      for(int i=0;i<strList.size();i++)
        println(i + ":" + strList.get(i));
    
      // init the cameras
      cam1 = new SimpleOpenNI(0,this);
      cam2 = new SimpleOpenNI(1,this);
    
      // enable depthMap generation 
      if(cam2.enableDepth() == false)
      {
         println("Camara 2");
         println("Can't open the depthMap, maybe the camera is not connected!"); 
         exit();
         return;
      }
      cam2.enableIR();
    
      // set the camera generators
      // enable depthMap generation 
      if(cam1.enableDepth() == false)
      {
         println("Camara 1");
         println("Can't open the depthMap, maybe the camera is not connected!"); 
         exit();
         return;
      }
      cam1.enableIR();
    
    
    
      background(10,200,20);
    }
    
    void draw()
    {
      // update the cam
      //SimpleOpenNI.updateAll();
      cam1.update();
      cam2.update();
    
      // draw depthImageMap
      image(cam1.depthImage(),0,0);
      image(cam1.irImage(),0,480 + 10);
    
      image(cam2.depthImage(),640 + 10,0);
      image(cam2.irImage(),640 + 10,480 + 10);
    
    }
    
Sign In or Register to comment.