MARCONet
MARCONet copied to clipboard
error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
i am unable to load screen. this is the code i used
import cv2
cap = cv2.VideoCapture('rtsp://admin:[email protected]:554/1') facedetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
while True: ret, frame = cap.read() gray=cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces=facedetect.detectMultiScale(gray, 1.3 ,5) for (x,y,w,h) in faces: cv2.rectangle(frame, (x,y), (x+w, y+h),(50,50,255), 1) cv2.imshow("Frame", frame) k=cv2.waitKey(1) if k==ord('q'): break cap.release() cv2.destroyAllWindows()
i am unable to load screen. this is the code i used
import cv2
cap = cv2.VideoCapture('rtsp://admin:[email protected]:554/1') facedetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
while True: ret, frame = cap.read() gray=cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces=facedetect.detectMultiScale(gray, 1.3 ,5) for (x,y,w,h) in faces: cv2.rectangle(frame, (x,y), (x+w, y+h),(50,50,255), 1) cv2.imshow("Frame", frame) k=cv2.waitKey(1) if k==ord('q'): break cap.release() cv2.destroyAllWindows()
Our code did not contain the VideoCapture. Did you comment on the wrong places?