Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fingerTrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def draw(self, canvas, disappr=True):
for i in range(len(self.clearpath)):
if len(self.clearpath) < 1:
break
elif i<(len(self.clearpath)-1)<21 and not disappr:
elif i<(len(self.clearpath)-1)<21:
cv2.line(canvas.new_canvas, self.clearpath[i], self.clearpath[i+1], self.colors[i], 3)
elif 20 < i < (len(self.clearpath)-1) and disappr:
canvas.clear()
elif 20 < i < (len(self.clearpath)-1):
canvas.new_canvas = np.zeros((canvas.height, canvas.width, 3), np.uint8)
for j in range(20):
cv2.line(canvas.new_canvas, self.clearpath[-(j+1)], self.clearpath[-(j+2)], self.colors[-(j+2)], 3)
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ def main():
if cv2.waitKey(1) & 0xFF == ord('s'):
newCanvas.save_drawing()
break
elif cv2.waitKey(1) & 0xFF == ord('q'):
if cv2.waitKey(1) & 0xFF == ord('q'):
break
elif cv2.waitKey(1) & 0xFF == ord('d'):
if cv2.waitKey(1) & 0xFF == ord('d'):
disappr = ~disappr
elif cv2.waitKey(1) & 0xFF == ord('c'):
if cv2.waitKey(1) & 0xFF == ord('c'):
newCanvas.clear()

cap.release()
cv2.destroyAllWindows()

if __name__ == "__main__":
Expand Down