This Python code defines a function to capture images from a webcam and save them to a folder. The function takes a person's name and number of images as parameters, initializes the webcam, detects faces in each frame, saves face images to a folder, and closes the webcam when complete.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views
Code 1
This Python code defines a function to capture images from a webcam and save them to a folder. The function takes a person's name and number of images as parameters, initializes the webcam, detects faces in each frame, saves face images to a folder, and closes the webcam when complete.
if __name__ == "__main__": person_name = input("Enter the person's name: ") image_count = int(input("Enter the number of images to capture: ")) capture_images(person_name, image_count)