Lines Matching refs:cv2
10 import cv2
18 img = cv2.GaussianBlur(img, (5, 5), 0)
20 for gray in cv2.split(img):
23 bin = cv2.Canny(gray, 0, 50, apertureSize=5)
24 bin = cv2.dilate(bin, None)
26 retval, bin = cv2.threshold(gray, thrs, 255, cv2.THRESH_BINARY)
27 bin, contours, hierarchy = cv2.findContours(bin, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
29 cnt_len = cv2.arcLength(cnt, True)
30 cnt = cv2.approxPolyDP(cnt, 0.02*cnt_len, True)
31 if len(cnt) == 4 and cv2.contourArea(cnt) > 1000 and cv2.isContourConvex(cnt):
41 img = cv2.imread(fn)
43 cv2.drawContours( img, squares, -1, (0, 255, 0), 3 )
44 cv2.imshow('squares', img)
45 ch = 0xFF & cv2.waitKey()
48 cv2.destroyAllWindows()