Lines Matching refs:cv2
4 import cv2
33 gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
36 … bin = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, 31, 10)
37 bin = cv2.medianBlur(bin, 3)
38 _, contours, heirs = cv2.findContours( bin.copy(), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)
48 x, y, w, h = cv2.boundingRect(cnt)
53 cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0))
70 m = cv2.moments(bin_roi)
77 … bin_norm = cv2.warpAffine(bin_roi, A, (SZ, SZ), flags=cv2.WARP_INVERSE_MAP | cv2.INTER_LINEAR)
84 … cv2.putText(frame, '%d'%digit, (x, y), cv2.FONT_HERSHEY_PLAIN, 1.0, (200, 0, 0), thickness = 1)
87 cv2.imshow('frame', frame)
88 cv2.imshow('bin', bin)
89 ch = cv2.waitKey(1) & 0xFF