paul-pias / Object-Detection-and-Distance-Measurement

Using yolov3 & yolov4 weights objects are being detected from live video frame along with the measurement of the object from the camera without the support of any extra hardware device.
348 stars 118 forks source link

issues reg opencv accessing webcam on windows 10 #43

Open Harshavardhan-PR opened 2 years ago

Harshavardhan-PR commented 2 years ago

[ WARN:2@21.373] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1752) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -1072875772

hello , i am trying to run the file object_detection.py and i am getting this same error over and over , it worked perfectly fine before 2 months, but i had to delete all the files , when i tried to reinstall all the requirements and run i am getting these , i searched the stack overflow couldnt find anything helpful , i set the id val=0 to run on webcam locally . Can you please tell me why i am getting this error . Thanks in advance.

Harshavardhan-PR commented 2 years ago

2022-01-03 (2)

pradoz commented 2 years ago

I fixed this error by following the suggestions made by @Roggu92 in https://github.com/paul-pias/Object-Detection-and-Distance-Measurement/issues/42#issuecomment-983405853 - The TL;DR is that I needed the weight files and I was essentially able to remove all version from YOLOv4/requirements.txt

I also had the error return temporarily due to poor lighting.

HassanBinHaroon commented 2 years ago

Check out the following relevant and easiest implementation.

https://github.com/HassanBinHaroon/object_detection-PLUS-distance_estimation-v1