Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OpenCV-Hand-Gesture-Control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David
OpenCV-Hand-Gesture-Control
Commits
5707bf84
Commit
5707bf84
authored
3 years ago
by
David
Browse files
Options
Downloads
Patches
Plain Diff
Starting to work on debug of gesture recog
parent
3ccfc4d9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/GestureLibs/GestureDetector.py
+10
-8
10 additions, 8 deletions
modules/GestureLibs/GestureDetector.py
run.py
+1
-4
1 addition, 4 deletions
run.py
with
11 additions
and
12 deletions
modules/GestureLibs/GestureDetector.py
+
10
−
8
View file @
5707bf84
...
...
@@ -50,7 +50,7 @@ class GestureDetector:
def
start_detection
(
self
,
input_list
):
print
(
"
Called
"
)
from
run
import
l
ogging_l
ist
# imported on every call to have newest data
from
run
import
l
mL
ist
# imported on every call to have newest data
if
self
.
detection_start
==
False
:
print
(
"
Now here
"
)
...
...
@@ -58,7 +58,6 @@ class GestureDetector:
print
(
self
.
FingersList
)
for
finger
in
self
.
FingersList
:
print
(
"
Checking
"
)
finger_is_up
=
finger
.
is_up
(
input_list
)
if
finger_is_up
==
True
:
print
(
"
Up
"
)
...
...
@@ -68,19 +67,22 @@ class GestureDetector:
break
elif
finger_is_up
==
False
:
print
(
"
not up
"
)
if
len
(
fingers_up
)
==
5
:
print
(
f
"
Starting detection after
{
self
.
detection_wait
}
second
"
)
self
.
detection_start
=
True
time
.
sleep
(
self
.
detection_wait
)
#sleeps 1 seconds for the user to change to the actual gesture
elif
self
.
detection_start
==
True
:
if
len
(
fingers_up
)
==
5
:
print
(
f
"
Starting detection after
{
self
.
detection_wait
}
second
"
)
self
.
detection_start
=
True
time
.
sleep
(
self
.
detection_wait
)
#sleeps 1 seconds for the user to change to the actual gesture
print
(
fingers_up
)
if
self
.
detection_start
==
True
:
print
(
"
Detection started
"
)
if
self
.
start_time
==
None
:
self
.
start_time
=
int
(
time
.
time
())
if
self
.
end_time
==
None
:
self
.
end_time
=
time
.
time
()
+
self
.
detection_window
now
=
int
(
time
.
time
())
if
now
<=
self
.
end_time
:
self
.
detection_frames
.
append
(
l
ogging_list
[
-
1
]
)
self
.
detection_frames
.
append
(
l
mList
)
elif
now
>=
self
.
end_time
:
self
.
parse_list
(
self
.
detection_frames
)
return
self
.
reset
()
...
...
This diff is collapsed.
Click to expand it.
run.py
+
1
−
4
View file @
5707bf84
...
...
@@ -2,7 +2,6 @@ ErrorLog = []
arguments
=
{}
# This will contain all the coordinates from the frames
logging_list
=
[]
lmList
=
[]
# Other files will import this from run, not from FingersGenerator
processes
=
[]
...
...
@@ -88,7 +87,6 @@ class Run:
def
run
(
self
):
global
logging_list
global
lmList
capture
=
cv2
.
VideoCapture
(
self
.
camera_dir
)
...
...
@@ -112,10 +110,9 @@ class Run:
cv2
.
waitKey
(
1
)
lmList
=
detector
.
fdPositions
(
frame
)
logging_list
.
append
(
lmList
)
print
(
lmList
)
if
self
.
gesture_detector
.
start_detection
(
lmList
)
==
False
:
logging_list
=
[]
print
(
"
Detection not starting
"
)
if
__name__
==
"
__main__
"
:
arguments
=
get_arguments
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment