5

I have a problem trying to get a webcam in OpenCV 2.3 to work with Cygwin. I have a Windows 7 64-bit system and I use Notepad++ and cygwin compilers to do my C++ programming. I have seen other posts with similar problems:

Getting Webcam to work in OpenCV

Can't access webcam with OpenCV

I first tried installing OpenCV via the Cygwin Ports. This is rather easy to install, but alas I run into the webcam problem (always returns false when trying to find a device). I have also attempted to build OpenCV and install manually using the command line flavor of CMake. I tried adding the HAVE_VIDEOINPUT and HAVE_DSHOW flags, but no dice. All my programs compile nicely and I have all the functionality of OpenCV aside for this webcam thing.

Has anyone successfully built OpenCV 2.3 on Cygwin with webcam working?

Community
  • 1
  • 1
chembrad
  • 887
  • 3
  • 19
  • 33

1 Answers1

2

It is unlikely that cygwin build of OpenCV will be able to access a webcam. At least it is not possible without hacking OpenCV cmake scripts. Under cygwin OpenCV build always follows the UNIX branch and videoinput/directshow is excluded from build.

Andrey Kamaev
  • 29,582
  • 6
  • 94
  • 88
  • I am going to accept this. I ended up doing a work-around. I built OpenCV in VS2010 and ported over my module for capturing webcam frames to a new project in VS. Once I got that working I grabbed the resulting Visual Studio App executable and put it near my project in the cygwin folders (for easy access). Now, when I need to capture the webcam I can use this App and output the frame data down the line to my other OpenCV tools. – chembrad Sep 16 '11 at 22:15