Lines Matching refs:img
60 def scale_img(img, scale=1.0): argument
62 dim = (int(img.shape[1]*scale), int(img.shape[0]*scale))
63 return cv2.resize(img.copy(), dim, interpolation=cv2.INTER_AREA)
66 def gray_scale_img(img): argument
68 if len(img.shape) == 2:
69 img_gray = img.copy()
70 elif len(img.shape) == 3:
71 if img.shape[2] == 1:
72 img_gray = img[:, :, 0].copy()
74 img_gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
274 img = numpy.array(input_img, copy=True)
277 img *= 255
278 img = img.astype(numpy.uint8)
281 img, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 201, 2)