Getting Started with Kinect + OpenNI + C#

2,348 views
Skip to first unread message

Asanka Dissanayake

unread,
May 24, 2012, 3:20:38 AM5/24/12
to OpenNI
I am Engineering student, i am totally new to openNI framework. I am
going to do my final year project (Sign Language to Voice Convertor)
using OpenNI framework integrated with Kinect Sensor. I have no
experience with openNi before. I have installed OpenNi and NIViewer
works fine. But the frame rate is bit low.
I need a help to know about how to prepare the Development environment
for OpenNI+Kinect+C# in visual studio 2010.

Please help me.. I am bit strucked here....

Thank You

TcBoY

unread,
May 29, 2012, 12:49:37 AM5/29/12
to OpenNI
it is pretty simple
just install openni, nite, then avin2 sensor
there are some c# example in the sample folder in openni and nite
under c:\program files
but there are more c++ example compared to c#

if u prefer c# u can consider kinect sdk, the latest 1.5 version is
quite good, alot of features including sit mode and face tracking
it also provide alot of c# example so u can easily get started

ps: i am using openi with c#, not kinect sdk

Mari

unread,
May 29, 2012, 5:51:08 AM5/29/12
to OpenNI
If you have everything necessary installed (which it sounds like you
have -- if not, take a look at the ZigFu package, which installs
everything you need very easily), then it's really just a matter of
including the .Net wrapper into your project. The confusion is
understandable, though, as there is no clear guide, really.

Find the OpenNI.net.dll file in the OpenNI folder, and either copy it
to your project folder or simply leave it there, but remember where
you found it. Then you go to Solution Explorer in Visual Studio and
add it as a reference by right clicking -> Add Reference, and find the
file in the Browse tab (I don't have it in front of me right now, but
I think this should work). Make sure your code has "using OpenNI;" up
top, if not then you have to add it.

The second file you must keep in mind is the OpenNI config file, which
is called SamplesConfig.xml and can be found in the OpenNI folder as
well. The config file can be used to decide whether you want a mirror
image or not, and to decide things like whether you want to use a
depth map, IR map, change the frame rate and resolution and so on.

To get started, you can try something like this (this is not working
code, but it should give you a hint of how to go about it and what the
code might look like):

readonly string SAMPLE_XML_FILE = "path_to/SamplesConfig.xml";
Context context;
DepthGenerator depthGenerator;
UserGenerator userGenerator;

context = Context.CreateFromXmlFile(SAMPLE_XML_FILE, out scriptNode);

depthGenerator = context.FindExistingNode(NodeType.Depth) as
DepthGenerator;

userGenerator = new UserGenerator(context);
userGenerator.NewUser += userGenerator_NewUser; // New user event
userGenerator.LostUser += userGenerator_LostUser; // Lost user event
userGenerator.StartGenerating();

context.WaitOneUpdateAll(depthGenerator);

void userGenerator_NewUser(object sender, NewUserEventArgs e) {
// Do something when a new user is discovered
}

Hope that helps a little bit. Like TcBoY says, getting started with
the Kinect SDK should be easier as there is simpler documentation
available and you don't have to sort through what is outdated and what
is not to the same degree as you have to with OpenNI, but it depends
on what you want to do, I guess. We have used OpenNI with C# to make a
game, and it worked out fine, you just have to dig a bit more to find
out what to do.

Asanka Dissanayake

unread,
May 29, 2012, 6:21:15 AM5/29/12
to openn...@googlegroups.com
Thanks guyz.... appreciate your support



--
You received this message because you are subscribed to the Google Groups "OpenNI" group.
To post to this group, send email to openn...@googlegroups.com.
To unsubscribe from this group, send email to openni-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.




--
Best Regards.


Asanka Dissanayake
Faculty of Engineering,
University of Ruhuna,
Hapugala,
Galle

asankanuwanbandara@gmail,com

Reply all
Reply to author
Forward
0 new messages