Great Work

More
10 years 1 month ago #10 by Nick Hadjiminas
Hello,

I think I know what the problem is. I am using some math functions of XNA game studio, which make it necessary to have XNA on you pc. I forgot to mention it in the requirements sorry about that :( . Here is link from where you can download it www.microsoft.com/download/en/details.aspx?id=23714
Thank you for reporting that.
Nick
The following user(s) said Thank You: Yellow

Please Log in to join the conversation.

More
10 years 1 month ago #13 by Yellow
Thank you Nick!
I can use your file after install XNA.

This program is awesome!

But I meet some problems, I can't use your function with Kinect sample at the same time(I use WPF).
It's means I can't watch my self(by the color video or depth video).
and I can't run your function in my project(WPF) :side:
I will try again later!

Another problem is about the PoseAndGestureGenerator file. This file can't capture pose twice?
Because after I capture pose, the color video and skeleton screen will stop.

my English is very poor...sorry :(

Thanks! :lol:

Please Log in to join the conversation.

More
10 years 1 month ago - 10 years 1 month ago #14 by Nick Hadjiminas
Thank you for the feedback. Here is the solution I suggest :
1.You can't use the library with other source because I believe you try to create new NUI instance rather than using the one the Library has. Here is how you should do it
Instead Runtime nui = new Runtime(); Use :

a)declare :
Runtime nui;
BTCRunTime BTC = new BTCRunTime();

b) In the initialization function of your program (most time the constructor of the main class eg. public MainWindow())

Start the Internal NUI of the library
try
{
BTC.Start();
}
catch (InvalidOperationException)
{
System.Console.Write("Runtime initialization failed. Please make sure Kinect device is plugged in.");
}

c) And then you can get the instance of the NUI with the command BTC.GetKinectNui()

nui= BTC.GetKinectNui();
and set the call back function of the NUI
nui.VideoFrameReady += new EventHandler<ImageFrameReadyEventArgs>(nui_ColorFrameReady);
nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

d) On the Exit Function of your application you can release the NUI by calling BTC.Stop();

2. The PoseAndGestureGenerator capture poses when you say “Capture Now” and the video and skeleton will stop. After you finish setting and save your pose you have to say “Play” to continue. Have a look at Pose and Gesture Generator Step By Step section of Programming Guide for : Be The Conroller Project and will understand how it works. Note: Some time you have to repeat the voice command (not recognize with the 1rst time).
When the command “Play” is recognized the two frames will start displaying video and skeleton again.

Let me know if you have more problems. Thank you again for not giving up :)

Nick
Last edit: 10 years 1 month ago by Nick Hadjiminas.

Please Log in to join the conversation.

More
10 years 1 month ago #15 by Abhishek
Hello Nick,
I tried the above code but still it is showing the following error "Failed to open the stream.Please make sure to specify the correct image type and resolution." Before, with normal nui intialization there were no problems.I have attahced my code,can you please post solution for this problem,if possible.
Regards
Abhishek
Attachments:

Please Log in to join the conversation.

More
10 years 1 month ago #16 by Nick Hadjiminas
Hello Abhishek

The reason cause this problem is that the video and depth stream are already opened by the library when it initialized the kinect NUI. I check your code and I open the streams with the same settings you want so in your case just remove this lines from your code :
try
{
nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);
nui.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex);
}
catch (InvalidOperationException)
{
System.Windows.MessageBox.Show("Failed to open stream. Please make sure to specify a supported image type and resolution.");
return;
}
Furthermore, I update the library (you have to download the new version of the dll under the download section) so you can initialize externally the kinect nui and give a reference of its instance to the library (in some cases people may need different settings rather than the one I use to initialize the nui )here is a sample of use : instead of BTC.Start()

nui = new Runtime();
try
{
nui.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);
}
catch (InvalidOperationException)
{
System.Windows.MessageBox.Show("Runtime initialization failed. Please make sure Kinect device is plugged in.");
return;
}


try
{
nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);
nui.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex);
}
catch (InvalidOperationException)
{

System.Windows.MessageBox.Show("Failed to open stream. Please make sure to specify a supported image type and resolution.");
return;
}
BTC.Start(nui);
}

PS. If you don’t care about the settings of the NUI then you can just use BTC.Start() :)

Please let me know if it will fix the problem

Nick

Please Log in to join the conversation.

More
10 years 1 month ago #17 by Abhishek
Hello Nick,
Thanks for quick reply.I am still getting some errors after following your suggestion and i used the default BTC.Start().I have attached my code and error,can you please give me suggestions regarding this.
Regards
Abhishek
Attachments:

Please Log in to join the conversation.

Time to create page: 0.077 seconds