From fefe71f10715888990a64b1d2dbe934214615504 Mon Sep 17 00:00:00 2001 From: ayushmankumar7 Date: Mon, 5 Aug 2019 20:25:41 +0530 Subject: [PATCH] Valued Error Solved --- recognize.py | 4 ++-- segment.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recognize.py b/recognize.py index 1d1e7ee..f7ae8b2 100644 --- a/recognize.py +++ b/recognize.py @@ -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: @@ -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 diff --git a/segment.py b/segment.py index ade4319..0b08b1d 100644 --- a/segment.py +++ b/segment.py @@ -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: