Code :
import cv2 import time cam = cv2.VideoCapture(0) name = input("Enter Name : ") for i in range(20): ret, img = cam.read() count = 0 cv2.imshow("Face", img) resize = cv2.resize(img, (300, 250)) cv2.imwrite("Dataset/"+str(name)+str(i)+".jpg", resize) time.sleep(.5) if cv2.waitKey(1) == 27: break cv2.destroyAllWindows()
For further query refer :- https://github.com/amankamboj09/Image-Capturing
No comments:
Post a Comment