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.
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)