This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
README
112 lines (67 loc) · 3.25 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
uWave and gestureRecognizer
About:
A gesture recognition system that works with accelerometer x/y/z axis data
based on uWave.
History:
I stumbled upon uWave, a gesture recognition system. While it worked fine it
was not very efficient and the implementation was lacking and hard to follow.
uWave did not support continuous gesture recognition which I need for a project
of mine. The implementation was certainly not suitable for continuous gesture
recognition due to excessive memory allocation/deallocation, intensive
recursive calculations and excessive i/o operations.
I thus decided to refactor a bit of uWave in order to understand it before
re-implementing it in C++.
The use of static filenames and buffers in the code is because the classes will
be further refactored and re-used on an embedded processor with limited ram and
no file based i/o.
Copyright:
The original uWave code (uWave.h and uWave.c) is copyright of the authors:
http://www.owlnet.rice.edu/~zw3/files/RICE/uWave/uWaveGestureLibraryReadme.html
They say I must include this statement: "Jiayang Liu, Zhen Wang, Lin Zhong,
Jehan Wickramasuriya, and Venu Vasudevan, "uWave: Accelerometer-based
personalized gesture recognition and its applications," in Proc. IEEE Int.
Conf. Pervasive Computing and Communication (PerCom), March 2009."
The re-factored code and my new implementation also require that the above
statement be included if it is re-used in addition to requiring the following
statement:
"This product includes components of gestureRecognizer by Dominic Clifton"
Other than that the GPL v3 applies (See LICENCE)
Setup:
Connect a MPU6050 to a raspberry pi's i2c bus. Use default MPU6050 address.
Raspberry Pi Model B v2.0 used for development. i2c device address is
hard-coded in the i2c library. "/dev/i2c-1"
Build:
To build both executables (uWave and gestureRecognizer) issue:
make
To build just uWave:
make uWave
To build just gestureRecognizer:
make gestureRecognizer
Usage:
Record gestures:
Gestures are always recorded in "record.ges". Gestures are always 1 second long.
sudo ./gestureRecognizer RECORD
mv record.ges 0.ges
sudo ./gestureRecognizer RECORD
mv record.ges 1.ges
sudo ./gestureRecognizer RECORD
mv record.ges 2.ges
.. and so on. Max supported gestures is currently 16. See config.h
Match a single gesture:
sudo ./gestureRecognizer
Continuously match gestures:
sudo ./gestureRecognizer CONTINUOUS
Replay gesture matching:
cp mygesture.ges replay.ges
./gestureRecognizer REPLAY
Notes:
The uWave executable does not have any specific timing, that is it runs as fast
as possible. This means that any gestures recorded (*.uwv) are not very useful
or re-usable on other machines/systems/etc.
Currently recorded gestures can be imported into gestureRecognizer via the
Gesture::import() method, you would also need to enable USE_QUANTIZER in
Config.h. The import method will probably be removed at a later date but it is
useful during development to compare results.
It seems that the uWave library mangles the data, see USE_QUANTIZER but the
method of data mangling doesn't lend itself well to the values provided by the
MPU6050. See the other uWave examples.