Results 1 to 8 of 8

Thread: How to Display Multi Webcam with QT + OpenCV + Eclipse?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    33
    Thanks
    56
    Qt products
    Qt4
    Platforms
    Windows

    Default How to Display Multi Webcam with QT + OpenCV + Eclipse?

    hi everybody
    I am using two Logitech Webcam. But at my first stage I am unable to view image from 2 webcam

    i used QT as my platform

    I used the openCv function as follows:

    Qt Code:
    1. CvCapture *cam1;//structure where camera link is stored
    2. CvCapture *cam2;
    3. cam1 = cvCaptureFromCAM(2);
    4. cam2 = cvCaptureFromCAM(1);
    5.  
    6. cvSetCaptureProperty(cam1, CV_CAP_PROP_FRAME_WIDTH, 640);
    7. cvSetCaptureProperty(cam1, CV_CAP_PROP_FRAME_HEIGHT, 480);
    8.  
    9. cvSetCaptureProperty(cam2, CV_CAP_PROP_FRAME_WIDTH, 640);
    10. cvSetCaptureProperty(cam2, CV_CAP_PROP_FRAME_HEIGHT, 480);
    11.  
    12. cvSetCaptureProperty(cam1, CV_CAP_PROP_FPS, 8);
    13. cvSetCaptureProperty(cam2, CV_CAP_PROP_FPS, 8);
    14.  
    15. IplImage *frame1, *frame2;
    16.  
    17. while(1)
    18. {
    19.  
    20. frame1 = cvQueryFrame(cam1);
    21. frame2 = cvQueryFrame(cam2);
    22.  
    23. cvShowImage("Left", frame1);
    24. cvShowImage("Right",frame2);
    25. char k;
    26. if(k==27)
    27. break;
    28. }
    29. cvReleaseCapture(&cam1);
    30. cvReleaseCapture(&cam2);
    31. cvDestroyAllWindows();
    To copy to clipboard, switch view to plain text mode 
    WHY when I Run Program It show Dialog tell me choose 1 in 2 Webcam?????
    a.png

    But here I get image frames from one camera only.
    how can I solve the problem.....Is it the bandwidth problem??
    I am using windows 7. Please help me.
    Thanks.
    Last edited by thaihoangluu; 28th December 2011 at 02:21.

Similar Threads

  1. OpenCV Record Webcam And Audio ???
    By Thành Viên Mới in forum Qt Programming
    Replies: 0
    Last Post: 25th December 2011, 04:18
  2. Display webcam stream with phonon and the qt
    By nyquist82 in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2011, 08:03
  3. Replies: 4
    Last Post: 22nd July 2011, 06:40
  4. Replies: 8
    Last Post: 18th March 2011, 11:27
  5. Replies: 2
    Last Post: 15th November 2010, 17:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.