Пример #1
0
 def detect(array, gesture_id):
     peaks = list()
     count = 0
     start = 0
     for i, v in enumerate(array):
         if v < CONFIG.get_threshold(gesture_id):
             print("peak found")
             start = start + count
             count += 1
         if count == CONFIG.get_size_dim(gesture_id) - 1:
             peaks.append(Gesture(start, count, array[start:count]))
             count = 0
             start = 0
     return peaks
Пример #2
0
 def detect_old(array, gesture_id):
     starting_point = CONFIG.get_size_dim(gesture_id) - 1
     for i, v in enumerate(array[starting_point:]):
         if all(j < CONFIG.get_threshold(gesture_id) for j in v):
             print("i maybe found a gesture from index " + i.__str__() +
                   "to index " + (i + 150).__str__())