@@ -0,0 +1,1152 @@
+#!/usr/bin/env python3%0A# coding: utf-8%0A%0Aimport cv2%0Aimport sys%0A%0A%0Adef main():%0A    print(len(sys.argv))%0A    if len(sys.argv) %3E 1:%0A        cascPath = sys.argv%5B1%5D%0A    else:%0A        cascPath = %22/usr/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml%22  # Path on fedora 25%0A%0A    faceCascade = cv2.CascadeClassifier(cascPath)%0A%0A    video_capture = cv2.VideoCapture(0)%0A    min_face_dim = (50, 50)%0A%0A    while True:%0A        # Capture frame-by-frame%0A        ret, frame = video_capture.read()%0A%0A        gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)%0A%0A        faces = faceCascade.detectMultiScale(%0A            gray,%0A            scaleFactor=1.1,%0A            minNeighbors=5,%0A            minSize=(min_face_dim)%0A        )%0A%0A        # Draw a rectangle around the faces%0A        for (x, y, w, h) in faces:%0A            cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)%0A%0A        # Display the resulting frame%0A        cv2.imshow('Video', frame)%0A%0A        if cv2.waitKey(1) & 0xFF == ord('q'):%0A            break%0A%0A    # When everything is done, release the capture%0A    video_capture.release()%0A    cv2.destroyAllWindows()%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

add face detection using haarcascade