Welcome! Log In Create A New Profile

Advanced

Motion detection with wiimote

Posted by I.R.on 
Motion detection with wiimote
June 28, 2009 10:57PM
I'm currently working on a rudimentary motion detection routine. I couldn't find any previous work about the subject, all people do currently reading buttons, using ir or the most advanced using the accelerometer readings to manipulate something on screen.

Is there such a work? Maybe I have overlooked.

Unlike motion detection used in games my aim is to create a motion detection routine that captures and recognizes gestures made with wiimote. Before doing that user will give samples of the gesture and hence train the program like simple speech recognition and handwriting recognition.

My current implementation works like this.

Sample collection
-------------------------
1. Capture g-force readings for each axis (x,y,z) for the period of the sample (I determine the sampling window with the press and release of a button)
2. Process the readings. I'm doing fourier transform on the collected data for each axis.
3. Store the processed data

Recognition
------------------------
1. Do 1,2 on the sample collection step
2. Compare the difference of the current sample with the collected samples for each axis and find the least differing (should be below some threshold) sample . Also check for the length of the actual data collected and ensure that it's not below or above some percentage of the current sample's length.


If enough gestures sampled it works quite nice detecting the gestures but of course sometimes two similar gestures are mixed by the routine due to various reasons...

So my questions are,

1. How many readings per second should I make to define a gesture? Currently reading for each frame of the video... 50 times a second for PAL.

2. Do you think g-force readings are enough to recognize such motion gestures?

Any suggestions regarding the routine?
Re: Motion detection with wiimote
June 29, 2009 12:33PM
It is not a matter of having enough samples, it is a matter about having too many samples. You need to figure out an algorithm to reduce the amount of data that has to match.
Re: Motion detection with wiimote
June 29, 2009 09:51PM
Quote
henke37
It is not a matter of having enough samples, it is a matter about having too many samples. You need to figure out an algorithm to reduce the amount of data that has to match.

Talking about gesture samples or a data collected for each gesture here?

There are quite a lot of effective ways to reduce the complexity of the matching algorithm, that's not a big problem actually...

at the worst case (all gesture samples collected have nearly same duration)

for N gestures each with 5 samples, each gesture having M points of data... (discarding fourier transform, that's done only once) complexity is N*M in which M is constant samples and N will be around at most 20-30... so say data collected for each gesture be 100, for 30 gestures each with 5 samples... it's 30 * 500 * 5 * 3(for each axis) = 45000 iterations which I think wii can handle in a reasonable time...

Timing check reduces the samples that are considered to be a match substantially and further a divide and conquer algorithm can be implemented which could reduce the worst case scenario logarithmically... (going from partial check to full check by the powers of 2 and discarding unmatching samples in the process)

Anyway, as I said... currently speed is not the main concern...

ps: here is a test version, one with fixed 10 sample gesture collection and one with 30.... say in the 30 samples version you can enter 6 gestures each with 5 samples...

[www.tepetaklak.com]



Edited 1 time(s). Last edit at 06/29/2009 11:23PM by I.R.on.
Re: Motion detection with wiimote
July 03, 2009 02:09PM
Also.... how about motion plus?

How could it make my above mentioned algorithm more accurate?

ps: just going to get buy one so...
Re: Motion detection with wiimote
July 03, 2009 03:07PM
I'm pretty sure all Motion Plus does is add an extra reference point so we can more accurately track motion. There's a fair bit of info about it here: [www.wiibrew.org]
Re: Motion detection with wiimote
July 12, 2009 12:04PM
I tried to hack and slash the wiiuse code in ogc with the existing information, failed... seems better suited to someone already did some work on wiiuse. it seems whole extension identification process changes if motion plus should be taken into account... hope devkitpro supports in the next version...
Re: Motion detection with wiimote
July 13, 2009 10:49PM
Makes sense if it changes the identification process and values that inputs are registered at. After all, external controllers now have to plug into the WiiMotion Plus device and no longer directly into the Wiimote.

The easiest way to rewrite Wiiuse would be to:
-First detect if WiiMotion Plus is connected (probably put this on a thread to tell if it is unplugged while an app is being run)
-Then set/change/reset the values of input devices (identifications) based on whether or not the device is connected

Someone's going to need to stare at a stream for a very long time to figure out all of the new values...



Edited 1 time(s). Last edit at 07/13/2009 10:50PM by Arikado.
Sorry, only registered users may post in this forum.

Click here to login