Config generation takes long

16 views
Skip to first unread message

Daniel

unread,
May 31, 2012, 6:20:28 AM5/31/12
to openn...@googlegroups.com
Hi Group,

i've set up a VideoFrameGrabber class according to the examples in Dr. Andrew Davison: Kinect Open Source Programming Secrets

Now my Context-Generating takes up to 6 seconds. Any Ideas, before i let a profiler run over it?

Here's some source:

private VideoFrameGrabber()
    {
System.out.println(System.currentTimeMillis());
        configOpenNI();
System.out.println(System.currentTimeMillis());

}

gives me the following output:


1338455441777
Started context generating...
1338455447421
Image dimensions (640, 480)


configOpenNI is as follows:

private void configOpenNI()
    // create context, depth generator, image generator
    {
        try {
            context = new Context();

            // add the NITE Licence
            License licence = new License("PrimeSense", "0KOIk2JeIBYClPWVnMoRKn5cdY4=");   // vendor, key
            context.addLicense(licence);

            depthGen = DepthGenerator.create(context);
            imageGen = ImageGenerator.create(context);

            // if possible, set the viewpoint of the DepthGenerator to match the ImageGenerator
//            depthGen.getAlternativeViewpointCapability().setViewpoint(imageGen);

           
            MapOutputMode mapMode = new MapOutputMode(640, 480, 30);   // xRes, yRes, FPS
            depthGen.setMapOutputMode(mapMode);
            imageGen.setMapOutputMode(mapMode);
            imageGen.setPixelFormat(PixelFormat.RGB24);

            // set Mirror mode for all
            context.setGlobalMirror(false);

            context.startGeneratingAll();
            System.out.println("Started context generating...");

            depthMD = depthGen.getMetaData();
            // use depth metadata to access depth info (avoids bug with DepthGenerator)
        }
        catch (Exception e) {
            System.out.println(e);
            System.exit(1);
        }
    }  // end of configOpenNI()


Any ideas greatly appreciated.

Daniel


Reply all
Reply to author
Forward
0 new messages