diff --git a/generateClassifier.py b/generateClassifier.py index 2ae0a95..4efd3a2 100755 --- a/generateClassifier.py +++ b/generateClassifier.py @@ -27,7 +27,7 @@ pp = preprocessing.StandardScaler().fit(hog_features) hog_features = pp.transform(hog_features) -print "Count of digits in dataset", Counter(labels) +print("Count of digits in dataset", Counter(labels)) # Create an linear SVM object clf = LinearSVC() diff --git a/performRecognition.py b/performRecognition.py index c7d02c2..c2dedd1 100755 --- a/performRecognition.py +++ b/performRecognition.py @@ -27,7 +27,7 @@ ret, im_th = cv2.threshold(im_gray, 90, 255, cv2.THRESH_BINARY_INV) # Find contours in the image -ctrs, hier = cv2.findContours(im_th.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) +_, ctrs, _ = cv2.findContours(im_th.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) # Get rectangles contains each contour rects = [cv2.boundingRect(ctr) for ctr in ctrs]