Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gesture-control
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ExplorViz
explorviz-github-archive
gesture-control
Commits
6df06c71
Commit
6df06c71
authored
May 18, 2015
by
Alexander Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for static fields
parent
e0739219
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
43 deletions
+38
-43
ExplorVizGestureControl/Gestures/ContinuousGestureDetector.cs
...orVizGestureControl/Gestures/ContinuousGestureDetector.cs
+14
-15
ExplorVizGestureControl/Gestures/DiscreteGestureDetector.cs
ExplorVizGestureControl/Gestures/DiscreteGestureDetector.cs
+2
-2
ExplorVizGestureControl/MainWindow.xaml.cs
ExplorVizGestureControl/MainWindow.xaml.cs
+6
-8
ExplorVizGestureControl/Streams and Drawing/BodyDrawing.cs
ExplorVizGestureControl/Streams and Drawing/BodyDrawing.cs
+16
-18
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.exe
...orVizGestureControl/bin/Debug/ExplorVizGestureControl.exe
+0
-0
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.pdb
...orVizGestureControl/bin/Debug/ExplorVizGestureControl.pdb
+0
-0
ExplorVizGestureControl/obj/Debug/ExplorVizGestureControl.exe
...orVizGestureControl/obj/Debug/ExplorVizGestureControl.exe
+0
-0
No files found.
ExplorVizGestureControl/Gestures/ContinuousGestureDetector.cs
View file @
6df06c71
...
@@ -18,8 +18,7 @@ namespace ExplorVizGestureControl.Gestures
...
@@ -18,8 +18,7 @@ namespace ExplorVizGestureControl.Gestures
public
class
ContinuousGestureDetector
public
class
ContinuousGestureDetector
{
{
#
region
Variables
#
region
Variables
private
CoordinateMapper
coordinateMapper
=
null
;
private
CoordinateMapper
coordinateMapper
=
null
;
private
GestureDatabase
gestureDatabase
=
null
;
[
DllImport
(
"user32.dll"
,
CharSet
=
CharSet
.
Auto
,
CallingConvention
=
CallingConvention
.
StdCall
)]
[
DllImport
(
"user32.dll"
,
CharSet
=
CharSet
.
Auto
,
CallingConvention
=
CallingConvention
.
StdCall
)]
private
static
extern
void
mouse_event
(
int
dwFlags
,
int
dx
,
int
dy
,
int
cButtons
,
int
dwExtraInfo
);
private
static
extern
void
mouse_event
(
int
dwFlags
,
int
dx
,
int
dy
,
int
cButtons
,
int
dwExtraInfo
);
...
@@ -68,14 +67,14 @@ namespace ExplorVizGestureControl.Gestures
...
@@ -68,14 +67,14 @@ namespace ExplorVizGestureControl.Gestures
#
endregion
#
endregion
public
void
DetectContinousGestures
(
GestureDatabase
database
)
public
void
DetectContinousGestures
()
{
{
if
(
delayTimer
.
busy
)
return
;
if
(
delayTimer
.
busy
)
return
;
gestureDatabase
=
database
;
handRight
=
g
estureDatabase
.
handRight
;
handRight
=
G
estureDatabase
.
handRight
;
handLeft
=
g
estureDatabase
.
handLeft
;
handLeft
=
G
estureDatabase
.
handLeft
;
phiz
=
g
estureDatabase
.
phiz
;
phiz
=
G
estureDatabase
.
phiz
;
// Detect and handle continuous gestures
// Detect and handle continuous gestures
...
@@ -108,11 +107,11 @@ namespace ExplorVizGestureControl.Gestures
...
@@ -108,11 +107,11 @@ namespace ExplorVizGestureControl.Gestures
{
{
if
(
gripActive
)
return
;
if
(
gripActive
)
return
;
if
(
gestureDatabase
.
BothHandsParallel
(
2
)
&&
if
(
GestureDatabase
.
BothHandsParallel
(
2
)
&&
gestureDatabase
.
BothHandsAboveSpineBase
()
&&
GestureDatabase
.
BothHandsAboveSpineBase
()
&&
g
estureDatabase
.
RightHandBelowRightShoulder
()
&&
G
estureDatabase
.
RightHandBelowRightShoulder
()
&&
gestureDatabase
.
LeftHandBelowLeftShoulder
()
&&
GestureDatabase
.
LeftHandBelowLeftShoulder
()
&&
g
estureDatabase
.
BothHandsOpen
())
G
estureDatabase
.
BothHandsOpen
())
{
{
if
(!
rotationActive
)
if
(!
rotationActive
)
{
{
...
@@ -161,8 +160,8 @@ namespace ExplorVizGestureControl.Gestures
...
@@ -161,8 +160,8 @@ namespace ExplorVizGestureControl.Gestures
{
{
if
(
gripActive
)
return
;
if
(
gripActive
)
return
;
int
scrollValue
=
0
;
int
scrollValue
=
0
;
double
distance
=
gestureDatabase
.
spineBase
.
Z
-
g
estureDatabase
.
oldSpineBase
.
Z
;
double
distance
=
GestureDatabase
.
spineBase
.
Z
-
G
estureDatabase
.
oldSpineBase
.
Z
;
//if (distance > dynamicValues["scrollForwardFactor"] ||
//if (distance > dynamicValues["scrollForwardFactor"] ||
// distance < dynamicValues["scrollBackwardFactor"])
// distance < dynamicValues["scrollBackwardFactor"])
...
@@ -182,7 +181,7 @@ namespace ExplorVizGestureControl.Gestures
...
@@ -182,7 +181,7 @@ namespace ExplorVizGestureControl.Gestures
private
void
HandleGripAndSelection
()
private
void
HandleGripAndSelection
()
{
{
if
(
g
estureDatabase
.
DragObject
())
if
(
G
estureDatabase
.
DragObject
())
{
{
if
(!
gripActive
)
if
(!
gripActive
)
{
{
...
...
ExplorVizGestureControl/Gestures/DiscreteGestureDetector.cs
View file @
6df06c71
...
@@ -40,9 +40,9 @@ namespace ExplorVizGestureControl.Gestures
...
@@ -40,9 +40,9 @@ namespace ExplorVizGestureControl.Gestures
#
endregion
#
endregion
#
region
Gesture
recognition
#
region
Gesture
recognition
public
void
gestureRecognition
(
GestureDatabase
gestureDatabase
)
public
void
gestureRecognition
()
{
{
foreach
(
KeyValuePair
<
string
,
Func
<
bool
>>
entry
in
g
estureDatabase
.
GestureDictionary
)
foreach
(
KeyValuePair
<
string
,
Func
<
bool
>>
entry
in
G
estureDatabase
.
GestureDictionary
)
{
{
if
(
entry
.
Value
.
Invoke
()
&&
!
this
.
timerForNextGesture
.
busy
)
if
(
entry
.
Value
.
Invoke
()
&&
!
this
.
timerForNextGesture
.
busy
)
...
...
ExplorVizGestureControl/MainWindow.xaml.cs
View file @
6df06c71
...
@@ -30,8 +30,7 @@ namespace ExplorVizGestureControl
...
@@ -30,8 +30,7 @@ namespace ExplorVizGestureControl
private
Body
[]
bodies
;
private
Body
[]
bodies
;
private
BodyFrameReader
bodyReader
;
private
BodyFrameReader
bodyReader
;
private
ContinuousGestureDetector
continuousGestureDetector
;
private
ContinuousGestureDetector
continuousGestureDetector
;
private
GestureDatabase
gestureDatabase
;
private
DiscreteGestureDetector
discreteGestureDetector
;
private
DiscreteGestureDetector
discreteGestureDetector
;
private
KinectJointFilter
filter
=
new
KinectJointFilter
();
private
KinectJointFilter
filter
=
new
KinectJointFilter
();
...
@@ -69,8 +68,7 @@ namespace ExplorVizGestureControl
...
@@ -69,8 +68,7 @@ namespace ExplorVizGestureControl
FrameworkElement
xamlElement
=
new
FrameworkElement
();
FrameworkElement
xamlElement
=
new
FrameworkElement
();
xamlElement
.
Style
=
(
Style
)
this
.
FindResource
(
"Stream"
);
xamlElement
.
Style
=
(
Style
)
this
.
FindResource
(
"Stream"
);
continuousGestureDetector
=
new
ContinuousGestureDetector
();
continuousGestureDetector
=
new
ContinuousGestureDetector
();
gestureDatabase
=
new
GestureDatabase
();
discreteGestureDetector
=
new
DiscreteGestureDetector
(
continuousGestureDetector
);
discreteGestureDetector
=
new
DiscreteGestureDetector
(
continuousGestureDetector
);
filter
.
Init
();
filter
.
Init
();
...
@@ -124,16 +122,16 @@ namespace ExplorVizGestureControl
...
@@ -124,16 +122,16 @@ namespace ExplorVizGestureControl
filter
.
UpdateFilter
(
body
);
filter
.
UpdateFilter
(
body
);
CameraSpacePoint
[]
filteredJoints
=
filter
.
GetFilteredJoints
();
CameraSpacePoint
[]
filteredJoints
=
filter
.
GetFilteredJoints
();
Vector3D
[]
accumulatedJoints
=
jointAccumulator
.
accumulateJoints
(
filteredJoints
);
Vector3D
[]
accumulatedJoints
=
jointAccumulator
.
accumulateJoints
(
filteredJoints
);
g
estureDatabase
.
refreshJoints
(
filteredJoints
,
accumulatedJoints
,
body
.
HandRightState
,
body
.
HandLeftState
);
G
estureDatabase
.
refreshJoints
(
filteredJoints
,
accumulatedJoints
,
body
.
HandRightState
,
body
.
HandLeftState
);
discreteGestureDetector
.
gestureRecognition
(
gestureDatabase
);
discreteGestureDetector
.
gestureRecognition
();
if
(
drawBody
)
if
(
drawBody
)
{
{
bodyStream
.
DrawBodies
(
gestureDatabase
);
bodyStream
.
DrawBodies
();
cleanBitmap
=
false
;
cleanBitmap
=
false
;
}
}
if
(
discreteGestureDetector
.
detectContinousGestures
)
if
(
discreteGestureDetector
.
detectContinousGestures
)
continuousGestureDetector
.
DetectContinousGestures
(
gestureDatabase
);
continuousGestureDetector
.
DetectContinousGestures
();
}
}
}
}
if
((!
AnyBodyTracked
()
&&
!
cleanBitmap
)
||
!
drawBody
)
if
((!
AnyBodyTracked
()
&&
!
cleanBitmap
)
||
!
drawBody
)
...
...
ExplorVizGestureControl/Streams and Drawing/BodyDrawing.cs
View file @
6df06c71
...
@@ -35,7 +35,6 @@ namespace ExplorVizGestureControl.StreamsAndDrawing
...
@@ -35,7 +35,6 @@ namespace ExplorVizGestureControl.StreamsAndDrawing
private
int
displayWidth
=
480
;
private
int
displayWidth
=
480
;
private
int
displayHeight
=
270
;
private
int
displayHeight
=
270
;
private
List
<
Pen
>
bodyColors
;
private
List
<
Pen
>
bodyColors
;
private
GestureDatabase
database
;
#
endregion
#
endregion
#
region
Constructor
#
region
Constructor
...
@@ -105,10 +104,9 @@ namespace ExplorVizGestureControl.StreamsAndDrawing
...
@@ -105,10 +104,9 @@ namespace ExplorVizGestureControl.StreamsAndDrawing
}
}
public
void
DrawBodies
(
GestureDatabase
gestureDatabase
)
public
void
DrawBodies
()
{
{
database
=
gestureDatabase
;
CameraSpacePoint
[]
filteredJoints
=
GestureDatabase
.
filteredJoints
;
CameraSpacePoint
[]
filteredJoints
=
database
.
filteredJoints
;
using
(
DrawingContext
dc
=
this
.
drawingGroup
.
Open
())
using
(
DrawingContext
dc
=
this
.
drawingGroup
.
Open
())
{
{
...
@@ -162,28 +160,28 @@ namespace ExplorVizGestureControl.StreamsAndDrawing
...
@@ -162,28 +160,28 @@ namespace ExplorVizGestureControl.StreamsAndDrawing
ColorSpacePoint
phizColorSpacePoint
=
new
ColorSpacePoint
();
ColorSpacePoint
phizColorSpacePoint
=
new
ColorSpacePoint
();
CameraSpacePoint
phizCameraSpacePoint
=
new
CameraSpacePoint
();
CameraSpacePoint
phizCameraSpacePoint
=
new
CameraSpacePoint
();
List
<
Point
>
phizLines
=
new
List
<
Point
>();
List
<
Point
>
phizLines
=
new
List
<
Point
>();
phizCameraSpacePoint
.
X
=
(
float
)
d
atabase
.
phiz
.
topRightCorner
.
X
;
phizCameraSpacePoint
.
X
=
(
float
)
GestureD
atabase
.
phiz
.
topRightCorner
.
X
;
phizCameraSpacePoint
.
Y
=
(
float
)
d
atabase
.
phiz
.
topRightCorner
.
Y
;
phizCameraSpacePoint
.
Y
=
(
float
)
GestureD
atabase
.
phiz
.
topRightCorner
.
Y
;
phizCameraSpacePoint
.
Z
=
(
float
)
d
atabase
.
phiz
.
z
;
phizCameraSpacePoint
.
Z
=
(
float
)
GestureD
atabase
.
phiz
.
z
;
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizCameraSpacePoint
.
X
=
(
float
)
d
atabase
.
phiz
.
botRightCorner
.
X
;
phizCameraSpacePoint
.
X
=
(
float
)
GestureD
atabase
.
phiz
.
botRightCorner
.
X
;
phizCameraSpacePoint
.
Y
=
(
float
)
d
atabase
.
phiz
.
botRightCorner
.
Y
;
phizCameraSpacePoint
.
Y
=
(
float
)
GestureD
atabase
.
phiz
.
botRightCorner
.
Y
;
phizCameraSpacePoint
.
Z
=
(
float
)
d
atabase
.
phiz
.
z
;
phizCameraSpacePoint
.
Z
=
(
float
)
GestureD
atabase
.
phiz
.
z
;
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizCameraSpacePoint
.
X
=
(
float
)
d
atabase
.
phiz
.
topLeftCorner
.
X
;
phizCameraSpacePoint
.
X
=
(
float
)
GestureD
atabase
.
phiz
.
topLeftCorner
.
X
;
phizCameraSpacePoint
.
Y
=
(
float
)
d
atabase
.
phiz
.
topLeftCorner
.
Y
;
phizCameraSpacePoint
.
Y
=
(
float
)
GestureD
atabase
.
phiz
.
topLeftCorner
.
Y
;
phizCameraSpacePoint
.
Z
=
(
float
)
d
atabase
.
phiz
.
z
;
phizCameraSpacePoint
.
Z
=
(
float
)
GestureD
atabase
.
phiz
.
z
;
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizCameraSpacePoint
.
X
=
(
float
)
d
atabase
.
phiz
.
botLeftCorner
.
X
;
phizCameraSpacePoint
.
X
=
(
float
)
GestureD
atabase
.
phiz
.
botLeftCorner
.
X
;
phizCameraSpacePoint
.
Y
=
(
float
)
d
atabase
.
phiz
.
botLeftCorner
.
Y
;
phizCameraSpacePoint
.
Y
=
(
float
)
GestureD
atabase
.
phiz
.
botLeftCorner
.
Y
;
phizCameraSpacePoint
.
Z
=
(
float
)
d
atabase
.
phiz
.
z
;
phizCameraSpacePoint
.
Z
=
(
float
)
GestureD
atabase
.
phiz
.
z
;
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizColorSpacePoint
=
coordinateMapper
.
MapCameraPointToColorSpace
(
phizCameraSpacePoint
);
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
phizLines
.
Add
(
new
Point
(
phizColorSpacePoint
.
X
/
4
,
phizColorSpacePoint
.
Y
/
4
));
...
...
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.exe
View file @
6df06c71
No preview for this file type
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.pdb
View file @
6df06c71
No preview for this file type
ExplorVizGestureControl/obj/Debug/ExplorVizGestureControl.exe
View file @
6df06c71
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment