I my kinect application I have main thread which is resposible for comunication between UI thread and other threads. I am no able to make a copy of WriteableBitmap generated from kinect and pass this WriteableBitmap image to separated thread with EmguCV processing. I was trying everything: Clone, CloneCurrentValue, BlockingCollection, but there are alwas some problems like:
The Calling thread cannot access this object because a different thread owns
Or processing data is wrong. This is main loop in my app;
WritableBitmap color; WritableBitmap depth; while (true) { kinect.updateFrames(); ctrlMainWindow.Dispatcher.BeginInvoke(new Action(() => { color = kinect.video.getBitmapColor(); depth = kinect.video.getBitmapDepth(); })); updateDetectors(color,depth); // Other thread }