csxmli2016 / MARCONet

Learning Generative Structure Prior for Blind Text Image Super-resolution [CVPR 2023]
Other
185 stars 14 forks source link

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' #13

Open opencv64 opened 8 months ago

opencv64 commented 8 months ago

i am unable to load screen. this is the code i used

import cv2

cap = cv2.VideoCapture('rtsp://admin:admin@192.168.1.168: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()

csxmli2016 commented 6 months ago

i am unable to load screen. this is the code i used

import cv2

cap = cv2.VideoCapture('rtsp://admin:admin@192.168.1.168: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?