Skip to content
Permalink
Browse files

#2 NeXtasge Projects- Processing Features

  • Loading branch information...
Shachindra committed Feb 27, 2017
1 parent fce7891 commit 16fe209fd06bcff2e30df8284bec0d68515379e9
Showing with 3 additions and 2 deletions.
  1. +3 −2 DigitsRecognition/digitRecognition/performRecognition.py
@@ -18,7 +18,8 @@
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, hier = cv2.findContours(im_th.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
(_, cnts, _) = 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]
@@ -42,4 +43,4 @@
cv2.putText(im, str(int(nbr[0])), (rect[0], rect[1]),cv2.FONT_HERSHEY_DUPLEX, 2, (0, 255, 255), 3)

cv2.imshow("Resulting Image with Rectangular ROIs", im)
cv2.waitKey()
cv2.waitKey()

0 comments on commit 16fe209

Please sign in to comment.
You can’t perform that action at this time.