0

The webcam lights up but I get an error message saying "Failed to retrieve feed from webcam". I tried writing a C# program using Affdex SDK, the webcam lights up but nothing happens (it is supposed to write on the console if it finds a face). I noticed that the onImageCapture and onImageResults methods are never invoked.

I made sure that my webcam works by writing a Python OpenCV app. Could anyone please help?

Halaby
  • 49
  • 4
  • 1
    by any chance, does it actually say "failed to retrieve frame from webcam"? – Andy Dennie Feb 16 '18 at 16:37
  • @AndyDennie The AffdexMe app says that, yes. – Halaby Feb 16 '18 at 19:35
  • 1
    That message "failed to retrieve frame from webcam" arises due to opencv's VideoCapture::read method returning false. I don't have a great guess as to why that might be happening, especially since you said that a python opencv app is working, but I did find someone saying that sometimes a webcam will return false on the first call but then succeed. Hard to say if that's happening in your case without writing a little C++ opencv app. https://stackoverflow.com/questions/22019064/unable-to-read-frames-from-videocapture-from-secondary-webcam-with-opencv – Andy Dennie Feb 16 '18 at 22:42
  • @AndyDennie The "failed to retrieve frame from webcam" message appears every time I run the app, not just once. I even downloaded the standalone version of the app, the same scenario happens. I ran the project under VS debugger with no errors, however, the only strange message the debugger gives me is "'ConsoleApplication32.vshost.exe' (CLR v4.0.30319: ConsoleApplication32.vshost.exe): Loaded 'C:\Users\Halaby\Documents\Visual Studio 2013\Projects\ConsoleApplication32\ConsoleApplication32\bin\x86\Release\Affdex.dll'. Cannot find or open the PDB file.". I don't believe this is an error. – Halaby Feb 16 '18 at 23:40
  • In https://stackoverflow.com/questions/22019064/unable-to-read-frames-from-videocapture-from-secondary-webcam-with-opencv, what they're saying is that the first cal to VideoCapture::read may fail, but subsequent ones may succeed. Running the AffdexMe app multiple times just fails on the first call each time, it doesn't retry. That being said, I can't be sure this is the issue in your case. Have you tried running on a different computer, or with a different webcam? – Andy Dennie Feb 17 '18 at 04:17

0 Answers0