Skip to content
Open
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
4 changes: 2 additions & 2 deletions recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def segment(image, threshold=25):
thresholded = cv2.threshold(diff, threshold, 255, cv2.THRESH_BINARY)[1]

# get the contours in the thresholded image
(_, cnts, _) = cv2.findContours(thresholded.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
cnts, _ = cv2.findContours(thresholded.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

# return None, if no contours detected
if len(cnts) == 0:
Expand Down Expand Up @@ -86,7 +86,7 @@ def count(thresholded, segmented):
circular_roi = cv2.bitwise_and(thresholded, thresholded, mask=circular_roi)

# compute the contours in the circular ROI
(_, cnts, _) = cv2.findContours(circular_roi.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
(cnts, _) = cv2.findContours(circular_roi.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)

# initalize the finger count
count = 0
Expand Down
2 changes: 1 addition & 1 deletion segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def segment(image, threshold=25):
thresholded = cv2.threshold(diff, threshold, 255, cv2.THRESH_BINARY)[1]

# get the contours in the thresholded image
(_, cnts, _) = cv2.findContours(thresholded.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
cnts, _ = cv2.findContours(thresholded.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

# return None, if no contours detected
if len(cnts) == 0:
Expand Down