Skip to content
Snippets Groups Projects
Commit 5707bf84 authored by David's avatar David
Browse files

Starting to work on debug of gesture recog

parent 3ccfc4d9
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ class GestureDetector:
def start_detection(self, input_list):
print("Called")
from run import logging_list # imported on every call to have newest data
from run import lmList# 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(logging_list[-1])
self.detection_frames.append(lmList)
elif now >= self.end_time:
self.parse_list(self.detection_frames)
return self.reset()
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment