Forum

You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

how to run Bespoke.GestureClassifier.wpf

No Tags
UserPost

2:24 am
July 27, 2010


blue baby

Guest

DEar Paul,

 

         may i know how to run Bespoke.GestureClassifier.wpf ? i got an

" XamlParseException was unhandled" error when i debug it in V.Studio 2008.

10:05 am
July 27, 2010


Paul

Admin

posts 49

That error is caused when no Wiimotes are connected to your computer. It's a pretty lousy error message, in that it appears as if there's an error in the XAML — hence the XamlParseException. There is no error in the XAML, and you can see that the window does render in the XAML designer (just double click on the XAML file within the solution explorer).

The XamlParseException is generated, because the error occurs within the MainWindow constructor — specifically, line 66 with the call to instantiate a Wiimote object. That code could be better written, so that it doesn't throw an exception when no Wiimotes are found — but that's how it works at the moment.

So, the long and short of it is — you need at least one Wiimote connected to your PC, or you'll need to rewrite the code to connect Wiimotes on the fly.

 

Paul

10:02 pm
July 27, 2010


blue baby

Guest

Dear Paul ,

          So if i have a wiimote, i can use the program function well ?

          Thank you so much !! Thanks for the help. I am lost in Bespoke. but i have to do an application on gesture recognition.

          I wish to know some info about the Bespoke from you, Paul. I saw there is a file "trained_gestures.trn" under resources folder. Is it already have trained_gesture inside the program? May i know that if i wish to make my own gesture, how the effort should i have ??

          I am glad and proud to learn from you, Paul,  hope that u can reply me. I am so appreciate your help ! =)

          

Best Regards,

Blue Baby

 

10:18 am
July 28, 2010


Paul

Admin

posts 49

Yes, if you connect a Wiimote to your PC the program will function. The application in question (the WPF GestureClassifier) is a 3D gesture recognition system that uses the Nintendo Wiimote as the 3D input device. Without the Wiimote, the application is fairly useless (and, as you noticed, crashes on startup).

The trained_gestures.trn file included with that application contains a set of pre-trained gestures. You can see how I perform most of these gestures through a video at http://www.youtube.com/bespoke…..bixTpKJH4g. Note, the software being shown in that video is different than the WPF GestureClassifier, but the gestures are the same. To create your own set of gestures, click the Add button, name a new gesture, and then add training samples by pressing the Wiimote's B button to begin a sample, and then releasing the button to end. You can commit the sample to the gesture with the Commit Sample button. I recommend at least 10 samples per gesture.

To retrain the machine learning system with your updated "trained" samples, click the Classification tab. The software will prompt you to retrain the system, and then you'll be able to perform the gesture and see the results of the classifier. You perform the gesture the same way you train it — holding the B button during the gesture and releasing the button to end the gesture and begin classifying.

 

Paul

9:52 pm
July 28, 2010


blue baby

Guest

Dear Paul,

         Thanks for ur information, i have learned a lot from you. Just wish to be double confirm with u the unhandled exception from the Gesture classifier program is whether due to  no wiimote connected or have other mistakes that i have.

          Below is the message pop out :

 

 

System.Windows.Markup.XamlParseException was unhandled
  Message="Cannot create instance of 'MainWindow' defined in assembly 'Bespoke.GestureClassifier.WPF, Version=4.3.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'MainWindow.xaml' Line 1 Position 9."
  Source="PresentationFramework"
  LineNumber=1
  LinePosition=9
  StackTrace:
       at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
       at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
       at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
       at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
       at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
       at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
       at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
       at System.Windows.Markup.TreeBuilder.Parse()
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
       at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
       at System.Windows.Application.DoStartup()
       at System.Windows.Application.<.ctor>b__0(Object unused)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, 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)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       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 Bespoke.GestureClassifier.WPF.App.Main() in C:Program Files (x86)Bespoke Software4.4.160Source CodeSamplesBespoke.GestureClassifier.WPFobjx86DebugApp.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly 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)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Reflection.TargetInvocationException
       Message="Exception has been thrown by the target of an invocation."
       Source="mscorlib"
       StackTrace:
            at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
            at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
            at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
            at System.Activator.CreateInstance(Type type, Boolean nonPublic)
            at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
       InnerException: System.TypeInitializationException
            Message="The type initializer for 'Bespoke.Common.Wiimote.Wiimote' threw an exception."
            Source="Bespoke.Common"
            TypeName="Bespoke.Common.Wiimote.Wiimote"
            StackTrace:
                 at Bespoke.Common.Wiimote.Wiimote..ctor()
                 at Bespoke.GestureClassifier.WPF.MainWindow..ctor() in C:Program Files (x86)Bespoke Software4.4.160Source CodeSamplesBespoke.GestureClassifier.WPFMainWindow.xaml.cs:line 66
            InnerException: Bespoke.Common.Wiimote.WiimoteNotFoundException
                 Message="No Wiimotes found in HID device list."
                 Source="Bespoke.Common"
                 StackTrace:
                      at Bespoke.Common.Wiimote.Wiimote.FindWiimote(WiimoteFoundDelegate wiimoteFound)
                      at Bespoke.Common.Wiimote.WiimoteCollection.FindAllWiimotes()
                      at Bespoke.Common.Wiimote.Wiimote..cctor()
                 InnerException:

 

 

** Anyway, thanks a lot, Paul . I will get wiimotes to try it on after this !

9:11 am
July 29, 2010


Paul

Admin

posts 49

Yes, this error is caused by no Wiimote(s) being connected to your PC. You need at least one Wiimote connected in order to run this program.

 

Paul

9:28 am
August 1, 2010


blue baby

Guest

Dear Paul,

 

thank you so much. I am succes to run the program now. It looks such interesting !

Well, do u have any good reference for me especially the new baby to C# and Bespoke software. i wish to do something on this program too.

 

Thanks !!

 

 

1:09 am
August 2, 2010


blue baby

Guest

Dear Paul,

         I have face a problem that when i LOAD my new gesture (.trn) and it success and has updated the gesture name in the TRAINING tab. But, if i classify it, it fail to recognise, seem like does not update my new gesture. Do u face such problem?

10:07 am
August 2, 2010


Paul

Admin

posts 49

Make sure that you have at least 10 training samples per gesture — 20 is better. Then, be certain that when you classify, that you perform the gesture in the same way that you train it. Also, your gestures need to be moving — meaning that they cannot be static poses. The gesture recognizer has no way to disambiguate gestures that are static (e.g. a non-moving gesture that has the Wiimote facing forward, buttons upward, cannot be disambiguated from the Wiimote facing to the left, buttons upward). Finally, be sure that the gestures within your set are somewhat different from each other. Two gestures that are nearly identical are going to be difficult to correctly classify.

To your previous post, there are dozens of C# books out there. Just head to the book store and find one to your liking.

 

Paul

11:17 pm
August 2, 2010


blue baby

Guest

Dear Paul,

 

        Thanks so much!

        I think u have missunderstood my sentence. I would like to describe again my condition. I have added new gestures and SAVE it as another sheet of gesture.trn. After that, i LOAD the lastest sheet of gesture . But i fail to CLASSIFY the new gesture that i have added before.

 

8:29 am
August 3, 2010


Paul

Admin

posts 49

When you initially added the gesture, at that point, before your saved and re-loaded the associated .trn file, did you attempt to classify your new gesture? If so, did it successfully classify at that point — but then didn't classify after you saved and re-loaded the file?

 

Paul

No Tags

About the Bespoke Software forum



No Comment

Comments are closed.