Capture image Windows
imejiato opened this issue · comments
I got this error, need hel´p
error Traceback (most recent call last)
Cell In[16], line 9
7 ret, frame = cap.read()
8 imgname = os.path.join(IMAGES_PATH,label,label+'.'+'{}.jpg'.format(str(uuid.uuid1())))
----> 9 cv2.imwrite(imgname, frame)
10 cv2.imshow('frame', frame)
11 time.sleep(2)
error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:783: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite'
try:
python -m pip install jupyter
I have now solved the issue for me:
I had my webcam software (LogiCapture) running while using my webcam for the project as well.
Sometimes it didn't save any images at all, sometimes only for first class.
worked for me,
cheers.