AttributeError: 'NoneType' object has no attribute 'copy'

asked 2018-08-25 00:57:58 -0600

Mohsin gravatar image

AttributeError: 'NoneType' object has no attribute 'copy'

edit retag flag offensive close merge delete

Comments

and we have to guess the code ?

berak gravatar imageberak ( 2018-08-25 01:09:53 -0600 )edit


from imutils.video import VideoStream
import argparse
import imutils
import time
import cv2
import os
detector = cv2.CascadeClassifier(args["cascade"])

while True:
        # grab the frame from the threaded video stream, clone it, (just
        # in case we want to write it to disk), and then resize the frame
        # so we can apply face detection faster
        frame = vs.read()
        orig = frame.copy()
        frame = imutils.resize(frame, width=400)
this is the code snippet.
Mohsin gravatar imageMohsin ( 2018-08-25 01:39:57 -0600 )edit

it means, you frame is invalid.

your code is also incomplete. what is vs ? did you check, if it opened correctly ?

berak gravatar imageberak ( 2018-08-25 09:40:35 -0600 )edit