second webcam isn't found

Help
2011-04-29
2013-05-09
  • Stephan Kreutz
    Stephan Kreutz
    2011-04-29

    Hi,
    I try to run the example of Chapter 12 in "Computer vision - Das Praxisbuch", but I have no luck! I tried several cams in several applications (trackingapp, calibrationapp, camera app) but IVT only found one Webcam (no matter which combination). Other programms like videograbbers, Skype are able to  show  the second one. What can I do?

     
  • Pedram Azad
    Pedram Azad
    2011-05-05

    Hello,

    sorry for the late answer. It depends on the kind of camera and camera module you are using. For Windows those applications per default use the module CVFWCapture (Video for Windows), which currently doesn't support multiple cameras. You would have to modify that class. But be aware that the cameras won't be synchronized over the USB bus in general.

    CLinux1394Capture supports multiple cameras, as does CDragonflyCapture.

    A simple workaround is if you want to make some experiments: Take a static scene, use the CaptureApp to store a snapshot of the left and right camera (while not moving the camera), and then use the class CBitmapCapture to load the stereo image pair. In the examples, you can just replace the line in which the constructor of CVFWCapture is called.

    If you want to use the CCalibrationApp the same way you have to modify it accordingly and remove the "% 20" condition in OpenCVCalibrationAlgorithm so that each image is accepted (and not only every 20th).

    Pedram

     
  • Stephan Kreutz
    Stephan Kreutz
    2011-05-05

    Hello,

    I have done several experiments in the last days:

    First I wrote I little programm in OpenCV. It displays two cameras simultanious. So I guess it is no hardware/driver problem.

    Then I read through VFCapture.h (*.cpp). I found no indication, that a second Cam is supported. So I looked at the other capture moduls. OpenGLCapture seems zu suppot two camers. But I was not able to implement it in the CalibrationApp.

    the third idea: I tryed to implement my OpenCV capture in the IVT Calibration. But at this point my knowledge is too small.

     
  • Stephan Kreutz
    Stephan Kreutz
    2011-05-05

    So…
    I trying to so implement CDragonFlycapture. but I have two problems:

    the file pgrflycapture.h is missing. I downloaded it on:
    http://nuicode.com/projects/tbeta/repository/revisions/214/entry/branches/tbeta/ccv_ofx_0061/Windows/addons/ofxFFMV/src/pgrflycapture.h?format=raw
    is this the right one?

    Second problem is to call the CDragonFlyCapture.

    I tried this way

    int COrganizer::Run(CVideoCaptureInterface::VideoMode mode)
    {
        CDragonFlyCapture capture(1,0,2);
        if (!capture.OpenCamera())
        {
            printf("error: could not open camera1\n");
        }
    and so on...
    

    The first parameter of CDragonFlyCapture is 1 (according to CVideoCaptureInterface it means e640x480 for the VideoMode) But it is not accepted! Why?

     
  • Stephan Kreutz
    Stephan Kreutz
    2011-05-13

    the problem is solved.
    I wrote a new OpenCVCapture. Now I am able to use two USB-Webcams

     
  • Pedram Azad
    Pedram Azad
    2011-05-16

    Hello,

    first of all: You can use the CDragonFlyCapture module only if you own a Dragonfly camera (or similar) from PointGrey. The file pgrflycapture.h is part of their driver API.

    Happy to hear that you solved the problem by writing a new COpenCVCapture. Would you want to contribute it to the IVT?

    Pedram