0
votes

Yes, this is yet another OpenCV question. I'm using OpenSUSE 12.1 and have some problems working with a webcam. In a word, it doesn't work.

OpenCV cmake output:

--   Video I/O:
--     DC1394 1.x:                 NO
--     DC1394 2.x:                 YES
--     FFMPEG:                     YES
--       codec:                    YES
--       format:                   YES
--       util:                     YES
--       swscale:                  YES
--       gentoo-style:             YES
--     GStreamer:                  NO
--     UniCap:                     NO
--     PvAPI:                      NO
--     V4L/V4L2:                   /1
--     Xine:                       NO

lsusb | grep Camera
Bus 001 Device 002: ID 0ac8:c302 Z-Star Microelectronics Corp. Vega USB 2.0 Camera

commands' sequence
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .
make && make install

So, OpenCV seems to be properly installed with all ffmpeg dependencies. But nope:


    IplImage *img;
    char ch;

    int c;

    CvCapture* capture = NULL;
    if ((capture = cvCaptureFromCAM(CV_CAP_ANY)) == NULL)
    {
        printf("Cannot init camera\n");
        return 0;
    }

"Cannot init camera" message.

I'm quite new to Linux programming, so I'm sure there's something I've missed. btw I've tried all the instructions I could find with no results.

2
If this question has been successfully answered, consider selecting the official answer by clicking on the checkbox near it. If not, consider adding your own answer.karlphillip

2 Answers

1
votes

opencv 2.3.1 from source in opensuse 12.1 64 bit. webcam problem:

use Yast to install libv4l-devel

0
votes

There's a chance that your webcam is not supported.

Here is the list of the supported cameras.