Windows Kinect Driver/SDK - CL NUI Platform Release v1.0.0.1210
Posted: 09 December 2010 01:16 AM   [ Ignore ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

We are proud to present the first official release of the new CL NUI Platform which consists of an SDK, API and a stable driver for Microsoft’s new Kinect Hardware (Xbox NUI Audio, NUI Camera, NUI Motor and Accelerometer) devices on Windows machines.

The new CL NUI Platform now supports multiple Kinect devices!
You can download the latest copy here: http://codelaboratories.com/get/nui
NOTE: Before installing the CL NUI SDK, please make sure you uninstall any older drivers including the previous preview version of CL NUI Driver and/or libusb drivers.

Features in this release:
- Support for Windows XP/Vista/Win7 both x86 and x64
- Support multiple Kinect cameras
- Device serial number retrieval
- RAW, RGB24 and RGB32 Color frame data
- RAW, Corrected8, Corrected12 and RGB32 Depth frame data
- Full 30fps camera data streaming
- Reading of built-in Accelerometer x, y, z data
- Camera motor control
- Camera LED control
- Fully signed driver
- To get you started we have included sample source code written in C# as well as C/C++ SDK lib and header files

The CL NUI SDK Platform 1.0 Overview:

CL_NUI_PLATFORM_OVERVIEW.png

The CL NUI SDK API:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// This library is part of CL NUI SDK
// It allows the use of Microsoft Kinect cameras in your own applications
//
// For updates and file downloads go to: http://codelaboratories.com/get/kinect
//
// Copyright 2010 (c) Code Laboratories, Inc.  All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <windows.h>

#define IMPORT(type) extern "C" __declspec(dllimport)## type __cdecl

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NUIDevice  API
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Device enumeration
IMPORT(int) GetNUIDeviceCount();
IMPORT(PCHARGetNUIDeviceSerial(int index);

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CLNUIMotor  API
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Motor instance type
typedef void *CLNUIMotor;

// Library initialization
IMPORT(CLNUIMotorCreateNUIMotor(PCHAR serial);
IMPORT(bool) DestroyNUIMotor(CLNUIMotor mot);

// Motor control
IMPORT(bool) SetNUIMotorPosition(CLNUIMotor motSHORT position);

// Get accelerometer data
IMPORT(bool) GetNUIMotorAccelerometer(CLNUIMotor motSHORT &xSHORT &ySHORT &z);

IMPORT(bool) SetNUIMotorLED(CLNUIMotor motBYTE value);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CLNUICamera API
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Camera instance type
typedef void *CLNUICamera;

// Library initialization
IMPORT(CLNUICameraCreateNUICamera(PCHAR serial);
IMPORT(bool) DestroyNUICamera(CLNUICamera cam);

// Camera capture control
IMPORT(bool) StartNUICamera(CLNUICamera cam);
IMPORT(bool) StopNUICamera(CLNUICamera cam);

// Camera video frame image data retrieval
IMPORT(bool) GetNUICameraColorFrameRAW(CLNUICamera camPBYTE pDataint waitTimeout 2000);
IMPORT(bool) GetNUICameraColorFrameRGB24(CLNUICamera camPBYTE pDataint waitTimeout 2000);
IMPORT(bool) GetNUICameraColorFrameRGB32(CLNUICamera camPDWORD pDataint waitTimeout 2000);

// Camera depth frame image data retrieval
IMPORT(bool) GetNUICameraDepthFrameRAW(CLNUICamera camPUSHORT pDataint waitTimeout 2000);
IMPORT(bool) GetNUICameraDepthFrameCorrected12(CLNUICamera camPUSHORT pDataint waitTimeout 2000);
IMPORT(bool) GetNUICameraDepthFrameCorrected8(CLNUICamera camPBYTE pDataint waitTimeout 2000);
IMPORT(bool) GetNUICameraDepthFrameRGB32(CLNUICamera camPDWORD pDataint waitTimeout 2000);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 

We are currently working on the upcoming CL NUI Audio component, although there are some potential issues related to DMCA so we will keep you updated. Thanks again and please feel free to share any code and/or videos of your projects build on CL NUI Platform. Also to make the CL NUI SDK better, we appreciate any feedback you might have while getting started.

Update:
-Fixed crashing issues on some systems
-Improved image stability

AlexP

Profile
 
 
Posted: 09 December 2010 05:43 AM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  4
Joined  2010-12-09

Nice to see a new version.

What is Corrected12 and Corrected8 and what is the timeout argument for?

I tried the preview release and it works.

Now the depth32 and color32 image looks damaged in my application also in the sample

http://img2.imagebanana.com/img/a5h4vso0/1.png

http://img2.imagebanana.com/img/uu7ibecs/2.png

http://img2.imagebanana.com/img/sd9p30qv/3.png


I deinstalled the preview release before installing this one

Any idea?

Profile
 
 
Posted: 09 December 2010 06:23 AM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  2
Joined  2010-12-09

Hey tnx great work, but I’m not sure I can find under what licence is this code distributed? Can you please tell me?

Regards..

V

Profile
 
 
Posted: 09 December 2010 12:32 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
T-Bone - 09 December 2010 05:43 AM

Nice to see a new version.

What is Corrected12 and Corrected8 and what is the timeout argument for?

I tried the preview release and it works.

Now the depth32 and color32 image looks damaged in my application also in the sample

http://img2.imagebanana.com/img/a5h4vso0/1.png

http://img2.imagebanana.com/img/uu7ibecs/2.png

http://img2.imagebanana.com/img/sd9p30qv/3.png


I deinstalled the preview release before installing this one

Any idea?

We are currently working on fixing the documentation to reflect all of this details. In the mean time here it is:
The Corrected12 and Corrected8 the output the data from the depth sensor that is transformed to properly represent the distance from the camera (closer distance means smaller value).

The formulas used are:
depthCorrected12 = (2048*2048) / (2048-depthRaw), range [0, 2047]
depthCorrected8 = (256*2048) / (2048-depthRaw), range [0,255]

As far as corrupted data you are seeing, it seems that your machine is dropping some USB packets. Could you share the specs of your machine (CPU, RAM, OS type, etc)?

Profile
 
 
Posted: 09 December 2010 01:01 PM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  4
Joined  2010-12-09

Thanks.

I think I found the problem.

When I call the StopNUICamera function there is a error.

http://pastebin.com/BTmv8XPJ

When I start my computer and use my or the sample application it works
the first time.
When I restart the program the pictures are bad.

After calling StopNUICamera the camera turn off but the app crash.

That is my code. I´m using opencv to show the images.
http://pastebin.com/U8HFW0yS


Windows 7 Ultimate 64x

AMD Athlon 64 X2 5200+
4GB RAM

ATI HD 4870

Profile
 
 
Posted: 09 December 2010 03:34 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

Does the sample app crash when exiting?
One thing I noticed in your code is that you are not calling DestroyNUICamera(cam). Is this correct?

Profile
 
 
Posted: 09 December 2010 09:52 PM   [ Ignore ]   [ # 6 ]
New Member
Rank
Total Posts:  6
Joined  2010-11-27

I’m also experiencing dropped frames in this version; last one worked fine.

Specs: MacBook Pro Unibody 2009, GeForce 9600M GT, Win7 Ultimate x64, 4GB RAM, Core2Duo @ 2.13GHz

Profile
 
 
Posted: 10 December 2010 12:01 AM   [ Ignore ]   [ # 7 ]
New Member
Rank
Total Posts:  23
Joined  2010-03-20

I can still see the depthmap is missing a couple of lines on the right side. Would be nice if you could fix that from the incoming depthbuffer.

I will try the rest of the features (specially multi kinects) and if there is any problems i will report back..
thanks for another release!

Profile
 
 
Posted: 10 December 2010 12:07 AM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  4
Joined  2010-12-09
AlexP - 09 December 2010 03:34 PM

Does the sample app crash when exiting?
One thing I noticed in your code is that you are not calling DestroyNUICamera(cam). Is this correct?

Yes , it crashes when exiting.

Thats correct.

I make the line as comment after StopNUICamera.

It changes nothing because it alway crash at StopNUICamera.

Profile
 
 
Posted: 10 December 2010 08:57 AM   [ Ignore ]   [ # 9 ]
New Member
Rank
Total Posts:  23
Joined  2010-03-20

It crashes for me when calling Stop and Destroy camera.
i’m on windows7 64bit and VS2008.

I had no luck running 2 kinects too. They load correctly but one of them doesn’t give me any data (all is zero).
Only the first one (in this case, index = 0) works.


EDIT! I’ve just tried the Sample applications and they also only show one of the kinects. the other is all blank (black screen)

EDIT2! I’ve tried the motors and they work fine! Only the images do not.
Not even on the sample applications.


EDIT3! Another interesting fact.
in Sample CLNUIDeviceTest.exe one of the kinects shows no image, but here is the interesting part. When i move the motor from kinect0, kinect1 is the one that moves =) and vice-versa.. this is very strange.
Switching the USB ports it seems to fix this problem. hmmm.

Profile
 
 
Posted: 10 December 2010 12:17 PM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
pixelnerve - 10 December 2010 08:57 AM

It crashes for me when calling Stop and Destroy camera.
i’m on windows7 64bit and VS2008.

I had no luck running 2 kinects too. They load correctly but one of them doesn’t give me any data (all is zero).
Only the first one (in this case, index = 0) works.


EDIT! I’ve just tried the Sample applications and they also only show one of the kinects. the other is all blank (black screen)

EDIT2! I’ve tried the motors and they work fine! Only the images do not.
Not even on the sample applications.


EDIT3! Another interesting fact.
in Sample CLNUIDeviceTest.exe one of the kinects shows no image, but here is the interesting part. When i move the motor from kinect0, kinect1 is the one that moves =) and vice-versa.. this is very strange.
Switching the USB ports it seems to fix this problem. hmmm.

The reason why you only see one Kinect device running is because you are exceeding the USB bus bandwidth. You should check the return value of StartNUICamera.
To fix this problem, make sure you connect those two devices to separate USB controllers. Both of them cannot run on a single USB host controller.

AlexP

Profile
 
 
Posted: 10 December 2010 01:07 PM   [ Ignore ]   [ # 11 ]
New Member
Rank
Total Posts:  2
Joined  2010-12-10

I’ve had quite a bit of difficulty getting the driver to work under Windows XP 32-bit.  Using the first released driver, the program refuses to run.  No error, no pop or anything.  With the newest release the demo program pops up, and everything other than the image is work, led, motor, accelerometer.  I tried downloading visual C# 2010 and compiling it from source but ended up having a XAML parsing error if that helps. 

I’ve had it working with the libfreenect drivers, but I needed a driver across all platoforms of Windows for a project.  I’ve made sure all libusb drivers are uninstalled, searched through the setup log, and currently three CL (audio,motor,camera) devices are present when the camera is plugged in.  I even tried it on a laptop that never had a kinect attached to it with the same results.  Other than a fresh install of XP do you have any suggestions?  And if I go the fresh install route, are there any minimum requirements I need to get it to work?  SP3 .NET 4 etc…

Thanks,

~Santiago

Profile
 
 
Posted: 10 December 2010 01:16 PM   [ Ignore ]   [ # 12 ]
New Member
Rank
Total Posts:  2
Joined  2010-12-09

AlexP how about my question? Under what licence is the driver distributed?

Profile
 
 
Posted: 10 December 2010 05:32 PM   [ Ignore ]   [ # 13 ]
New Member
Rank
Total Posts:  23
Joined  2010-03-20

Alex good explanation. Thats probably it as it was actually running on same usb controller.
What about the depthmap black bar problem? What exactly is wrong with it.. It probably isn’t normal.
Thanks

Profile
 
 
Posted: 11 December 2010 01:31 AM   [ Ignore ]   [ # 14 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  162
Joined  2009-09-17

@mitrovicvladimir Sorry about delay been traveling for holidays, The license is display on the installer first page… please read that for more details. We will have more updates on this over the weekend but basically we are making it free for development and personal use and we will ask for a small fee for commercial usage as we do with our CL Eye Platform. Thanks and please let us know if you have any more questions.

CL Support

Profile
 
 
Posted: 11 December 2010 01:34 AM   [ Ignore ]   [ # 15 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17
pixelnerve - 10 December 2010 05:32 PM

Alex good explanation. Thats probably it as it was actually running on same usb controller.
What about the depthmap black bar problem? What exactly is wrong with it.. It probably isn’t normal.
Thanks

The black bar on the right of the depth image is a part of the video stream and it is normal.

Profile
 
 
1 of 3
1
 


RSS 2.0     Atom Feed