Getting Started

Mar 8, 2011 at 3:07 PM

Thank you for sharing this framework.

I just downloaded the source code and was not able to run HandTesting successfully. I believe I've already installed all necessary requirements and I'm catching an error in ImageProcessor class on this line

Factory = new DirectCanvasFactory();

it's an SEHException was unhandled error.

  at D3DCompile(Void* , UInt32 , SByte* , _D3D_SHADER_MACRO* , ID3DInclude* , SByte* , SByte* , UInt32 , UInt32 , ID3D10Blob** , ID3D10Blob** )
   at SlimDX.D3DCompiler.ShaderBytecode.Compile(Byte[] shaderSource, String entryPoint, String profile, ShaderFlags shaderFlags, EffectFlags effectFlags, ShaderMacro[] defines, Include include, String sourceName, String& compilationErrors)
   at SlimDX.D3DCompiler.ShaderBytecode.Compile(String shaderSource, String entryPoint, String profile, ShaderFlags shaderFlags, EffectFlags effectFlags)
   at DirectCanvas.Rendering.Shaders.ShaderBase..ctor(String embeddedSourceResourceName, Assembly resourceAssembly, String entryPoint, ShaderVersion shaderVersion, ShaderFlags shaderFlags, EffectFlags effectFlags)
   at DirectCanvas.Rendering.Shaders.VertexShader10..ctor(Device device, String embeddedSourceResourceName, Assembly resourceAssembly, String entryPoint, ShaderVersion shaderVersion, ShaderFlags shaderFlags, EffectFlags effectFlags)
   at DirectCanvas.Rendering.Sprites.SpriteRenderer..ctor(Device device, Int32 maxSpriteInstances)
   at DirectCanvas.Composer..ctor(DeviceContext10_1 deviceContext)
   at DirectCanvas.DirectCanvasFactory.InitializeDeviceResources()
   at DirectCanvas.DirectCanvasFactory..ctor()
   at InfoStrat.MotionFx.ImageProcessing.ImageProcessor..ctor(Size ImageSize, Dispatcher dispatcher) in C:\Projects\Samples\InfoStrat.MotionFx.v0.1\InfoStrat-MotionFx-17324ca\InfoStrat.MotionFx\ImageProcessing\ImageProcessing.cs:line 26
   at InfoStrat.MotionFx.HandPointGenerator.StartGenerating(Dispatcher dispatcher) in C:\Projects\Samples\InfoStrat.MotionFx.v0.1\InfoStrat-MotionFx-17324ca\InfoStrat.MotionFx\HandPointGenerator.cs:line 235
   at InfoStrat.MotionFx.MotionTracking.SubscribeToEvents(Window window) in C:\Projects\Samples\InfoStrat.MotionFx.v0.1\InfoStrat-MotionFx-17324ca\InfoStrat.MotionFx\MotionTracking.cs:line 157
   at InfoStrat.MotionFx.MotionTracking.<>c__DisplayClass2.<RegisterEvents>b__0(Object s, RoutedEventArgs e) in C:\Projects\Samples\InfoStrat.MotionFx.v0.1\InfoStrat-MotionFx-17324ca\InfoStrat.MotionFx\MotionTracking.cs:line 133
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at HandTesting.App.Main() in C:\Projects\Samples\InfoStrat.MotionFx.v0.1\InfoStrat-MotionFx-17324ca\HandTesting\obj\x86\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

does anybody know how to fix this?

Thanks for your help.

Coordinator
Mar 10, 2011 at 2:02 AM

agc99,

Thanks for trying the framework.

I saw this error before on one machine I tried and another user has also reported it. I believe it is caused by a graphics card/graphics card drivers that is either underpowered or does not fully implement DirectX 10. I'm looking into this to see if there is a way to fix it but in the meantime, try running it on another machine that has a decent mid-range graphics card from NVIDIA or ATI if you can.

Thanks,

Josh

Coordinator
Mar 10, 2011 at 2:03 AM

I forgot another option. Please make sure you have the latest DirectX runtime installed (June 2010):

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3b170b25-abab-4bc3-ae91-50ceb6d8fa8d

 

Coordinator
Mar 10, 2011 at 6:16 PM

Another user reported this exception and found updating the DirectX runtimes fixed it. Please let me know if it works for you as well.

Thanks,

Josh

Mar 10, 2011 at 7:59 PM

Josh, thanks for responding... installing the directX did fix the error. I was able to run the sample app successfully. I'm kinda surprise that I was not able to make it recognize the motion on a laptop that has Integrated GPU with 1Gig of RAM.

Quick question for the HandVisualization control does it really intend to show your other body parts? I thought it will just only show both hands.

 

Thanks,

-agc99

Coordinator
Mar 21, 2011 at 9:46 PM

The HandVisualization control intends to only show the hands, but it does this using a naive thresholding around the hand position. If other parts of your body are within the a particular bounding box then it will show them as well. This will improve with better hand models, which is something I'm working on.