You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for your solution which does exactly what I need. I have noticed a slightly latency in the display of video on the UI during the recording, which I suppose could be solved by multi-thread. I have tried to use Backgroundworker Class to put the recording on a different thread than the UI, but got a error when I call bw.RunWorkerAsync(e); I will briefly explain my current solution below:
bw.RunWorkerAsync(e);
//System.Console.WriteLine(" frame");
using (var frame = e.OpenColorImageFrame())
{
if (frame != null)
{
// if (recorder != null)
// recorder.Record(frame);
UpdateColorFrame(frame);
}
}
using (var frame = e.OpenDepthImageFrame())
{
if (frame != null)
{
if (recorder != null)
recorder.Record(frame);
}
}
using (var frame = e.OpenSkeletonFrame())
{
if (frame != null)
{
if (recorder != null)
recorder.Record(frame);
UpdateSkeletons(frame);
}
}
}
During the initialization, I declared a Backgroundworker object bw, and attached the eventhandler bw_DoWork o it, so it will record in another thread rather than the UI thread.
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
var arg = (AllFramesReadyEventArgs)e.Argument;
var frame = (ColorImageFrame)arg.OpenColorImageFrame();
if (frame != null)
{
if (recorder != null)
recorder.Record(frame);
}
}
However, it will lead to "This BackgroundWorker is currently busy and cannot run multiple tasks concurrently." Which I suppose a new BackgroundWorker Object is needed for every frame?
Would be great if you could provide me some hints on how to put the recording on a separate thread so the color image display on the UI won't lag while recording, thanks.
Regards,
Wenxuan
The text was updated successfully, but these errors were encountered:
I'll try to look at this over the weekend.
Assuming you have decent enough hardware to run this on, It's been my experience that sometimes the kinect data can get sluggish, and just unplugging and reinserting the kinect usb cable usually seems to fix it.
Hi Latish,
Thanks a lot for your solution which does exactly what I need. I have noticed a slightly latency in the display of video on the UI during the recording, which I suppose could be solved by multi-thread. I have tried to use Backgroundworker Class to put the recording on a different thread than the UI, but got a error when I call bw.RunWorkerAsync(e); I will briefly explain my current solution below:
void KinectSensorAllFramesReady(object sender, AllFramesReadyEventArgs e)
{
During the initialization, I declared a Backgroundworker object bw, and attached the eventhandler bw_DoWork o it, so it will record in another thread rather than the UI thread.
However, it will lead to "This BackgroundWorker is currently busy and cannot run multiple tasks concurrently." Which I suppose a new BackgroundWorker Object is needed for every frame?
Would be great if you could provide me some hints on how to put the recording on a separate thread so the color image display on the UI won't lag while recording, thanks.
Regards,
Wenxuan
The text was updated successfully, but these errors were encountered: