Kent
Kent

Reputation: 115

Getting Webcam to work in OpenCV

I'm trying to get my webcam to capture video in OpenCV, version 2.2 in Windows 7 64 bit. However, I'm having some difficulties. None of the sample binaries that come with OpenCV can detect my webcam. Recently I came across this posting which suggested that the answer lies in recompiling a file, opencv_highgui with the property HAVE_VIDEOINPUT HAVE_DSHOW in the property page.

Can't access webcam with OpenCV

However, I'm unsure about procedurally how to do this. Can someone recommend as to how to go about this? Thanks.

Upvotes: 2

Views: 1818

Answers (1)

Jong Bor Lee
Jong Bor Lee

Reputation: 3855

Roughly, these are the important steps:

  1. Download the OpenCV 2.2 source code,
  2. set up a project to compile it, according to the InstallGuide,
  3. make any changes you need to make in the code,
  4. build the opencv_highgui library (dll and lib files, probably), and
  5. replace these in your original project.

If you can configure the project to generate the highgui files only (and not every library in OpenCV), do so, since the change you need to do shouldn't affect other modules. This saves some time.

The detailed instructions to build OpenCV are in: http://opencv.willowgarage.com/wiki/InstallGuide. You should follow this guide.

Upvotes: 1

Related Questions