Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting webcam to work in OpenCV 2.3 with Cygwin

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?

like image 265
chembrad Avatar asked Nov 05 '22 14:11

chembrad


1 Answers

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.

like image 125
Andrey Kamaev Avatar answered Nov 22 '22 10:11

Andrey Kamaev