def main (num): while True : ret, image = cap.read() if ret == True: a, b, c, d = coordinate(image) num = display(a, b, c, d, wdnm, image, num, face_path) sys.exit(0) if cv2.waitKey(1) == 113 else None else: break
def main(): num = 0 while True: ret, image = cap.read() image = cv2.flip(image, 1) #翻转 gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) a, b, c, d, dlibed = coordinate(gray) #翻转的单通道灰度图 num = display(a, b, c, d, wdnm, image, num, face_path) #翻转的原图 sys.exit(0) if cv2.waitKey(1) == 113 else None #q == 113
def main(num): while True: ret, image = cap.read() if ret == True: gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) a, b, c, d, dlibed = coordinate(gray) num = display(a, b, c, d, wdnm, image, num, face_path) sys.exit(0) if cv2.waitKey(1) == 113 else None #sys.exit(0) if keyboard.is_pressed('q') == 113 else None else: break
def main(num): for (path, dirnames, filenames) in os.walk(in_path): for filename in filenames: if filename.endswith('.tif'): img_path = path + '/' + filename img = cv2.imread(img_path) a, b, c, d = coordinate(img) num = display(a, b, c, d, wdnm, img, num, out_path) sys.exit(0) if cv2.waitKey(1) == 113 else None