Results 1 to 12 of 12

Thread: QT connect Logitech webcam

  1. #1
    Join Date
    May 2009
    Posts
    28
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Thumbs down QT connect Logitech webcam

    Hi all.
    I am start using QT to develop a project in Processing webcam, it is Logitech webcam.
    I really dont know QT can help me solve this problem.
    If you have any experience with same happen. Please help me.

    Thanks in advance.
    Diego

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: QT connect Logitech webcam

    First,, its Qt , not QT

    Well I dont think Qt has any classes for webcam, You can have a look at opencv. It can be combined with Qt. Search the forum, there are many threads on this topic I guess.

  3. #3
    Join Date
    May 2009
    Posts
    28
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT connect Logitech webcam

    I have not any experience to process webcam device with QT.
    so, it was very strange when i met this problem.
    Please help me.
    Thanks.
    Diego

  4. #4
    Join Date
    Sep 2008
    Posts
    25
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 5 Times in 5 Posts

    Default Re: QT connect Logitech webcam

    Hi diego!

    By "Processing webcam" I suppose you want to capture frames from the webcam and then do some image processing on those frames. The current version of Qt can't help you with this. It's planned that the future versions of Phonon will support capturing frames from webcams,tvcards etc.
    I strongly suggest you to use OpenCV. It's an image processing library full of features, and it supports capturing frames from webcams. If you want to integrate it with Qt, for example to display the processed video, just search the forum. There are plenty of topics about Qt+OpenCV.

  5. #5
    Join Date
    May 2009
    Posts
    28
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT connect Logitech webcam

    Thank for help.
    I will research with OpenCV now.

  6. #6
    Join Date
    Aug 2009
    Location
    Melbourne Australia
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: QT connect Logitech webcam

    I found the following code on the OpenCV site. It recognised my IEEE 1394 ("firewire") camcorder displaying live video in a window. Now I compiled this with Visual C++ Express 2008 but it should be adaptable to work with Qt.

    Qt Code:
    1. #include "cv.h"
    2. #include "highgui.h"
    3. #include <stdio.h>
    4.  
    5. // A Simple Camera Capture Framework
    6.  
    7. int main()
    8. {
    9.  
    10. CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
    11.  
    12. if( !capture )
    13. {
    14. fprintf( stderr, "ERROR: capture is NULL \n" );
    15. getchar();
    16. return -1;
    17. }
    18.  
    19. // Create a window in which the captured images will be presented
    20. cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE );
    21.  
    22. // Show the image captured from the camera in the window and repeat
    23. while( 1 )
    24. {
    25.  
    26. // Get one frame
    27. IplImage* frame = cvQueryFrame( capture );
    28.  
    29. if( !frame )
    30. {
    31. fprintf( stderr, "ERROR: frame is null...\n" );
    32. getchar();
    33. break;
    34. }
    35.  
    36. cvShowImage( "mywindow", frame );
    37. // Do not release the frame!
    38.  
    39. //If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version),
    40. //remove higher bits using AND operator
    41. if( (cvWaitKey(10) & 255) == 27 ) break;
    42. }
    43.  
    44. // Release the capture device housekeeping
    45. cvReleaseCapture( &capture );
    46. cvDestroyWindow( "mywindow" );
    47.  
    48. return 0;
    49. }
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Platforms
    MacOS X Unix/X11
    Thanks
    1
    Thanked 52 Times in 52 Posts

    Default Re: QT connect Logitech webcam

    Write some converter from IplImage to QImage.
    It's nice to be important but it's more important to be nice.

  8. #8
    Join Date
    Jun 2009
    Location
    AKL | New Zealand
    Posts
    62
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    21
    Thanked 3 Times in 3 Posts

    Default Re: QT connect Logitech webcam

    hi diego,

    i am using webcam in my current project to capture 2D barcode in Qt.
    you can take a look "fswebcam". it is simple and very powerful webcam app.

    here is the website link: http://www.firestorm.cx/fswebcam/

    download the fswebcam.tar package, install it.
    in Qt, you can use the following command to capture a photo
    Qt Code:
    1. system("fswebcam -F 15 -r 352x288 --no-banner --save /mnt/cdrive/C++/mypro/DMB.jpg");
    To copy to clipboard, switch view to plain text mode 

    in order to improve quality of your picture, increase the value of -F

    good luck

  9. #9
    Join Date
    Aug 2009
    Location
    Melbourne Australia
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: QT connect Logitech webcam

    I found this on the Qt Apps site:

    http://www.qt-apps.org/content/show....?content=89995

    I got it to work eventually.

    Not only does it work with webcams (USB) but works with camcorders attached through IEEE 1394("firewire"). Nice.

    This is what I did:

    1. Downloaded and installed OpenCV:

    http://sourceforge.net/projects/opencvlibrary/

    2. I edited the pro file to be more specific to the opencv installation on my system:

    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4.  
    5. INCLUDEPATH += "C:\Program Files\OpenCV\cv\include"
    6. INCLUDEPATH += "C:\Program Files\OpenCV\cxcore\include"
    7. INCLUDEPATH += "C:\Program Files\OpenCV\cvaux\include"
    8. INCLUDEPATH += "C:\Program Files\OpenCV\otherlibs\highgui"
    9.  
    10. LIBS += "C:\Program Files\OpenCV\lib\cv.lib"
    11. LIBS += "C:\Program Files\OpenCV\lib\cxcore.lib"
    12. LIBS += "C:\Program Files\OpenCV\lib\cvaux.lib"
    13. LIBS += "C:\Program Files\OpenCV\lib\highgui.lib"
    14.  
    15. SOURCES += main.cpp QOpenCVWidget.cpp MyCameraWindow.cpp
    16. HEADERS += QOpenCVWidget.cpp MyCameraWindow.h
    To copy to clipboard, switch view to plain text mode 

    3. I also had to look for and copy these dlls, to the same folder as my app:

    Qt Code:
    1. mingwm10.dll
    2. highgui.dll
    3. cxcore110.dll
    4. QtCored4.dll
    5. QtGuid4.dll
    To copy to clipboard, switch view to plain text mode 

    4. And with respect to the pro file I rewrote the opencv includes, so that they directly reference the required header files, for instance:

    from
    Qt Code:
    1. #include <opencv/cv.h>
    To copy to clipboard, switch view to plain text mode 

    to just:
    Qt Code:
    1. #include <cv.h>
    To copy to clipboard, switch view to plain text mode 

    Carl
    Last edited by carllooper; 19th August 2009 at 12:54. Reason: Added "firewire support" comment.

  10. The following user says thank you to carllooper for this useful post:

    daebarkee (7th September 2009)

  11. #10
    Join Date
    Aug 2009
    Location
    Melbourne Australia
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: QT connect Logitech webcam

    And here is me glancing at my DV camcorder.

    Last edited by carllooper; 19th August 2009 at 22:27. Reason: removed attachment as image is in main body

  12. #11
    Join Date
    Feb 2006
    Posts
    31

    Default Re: QT connect Logitech webcam

    on windows os, u can do directshow or vfw programming.
    http://www.codeguru.com/cpp/g-m/dire...cle.php/c6973/

  13. #12
    Join Date
    Feb 2006
    Posts
    31

    Default Re: QT connect Logitech webcam

    to control logitech pan/tilt/zoom functions, take a look at this link

    http://www.quickcamteam.net/document...gitech-cameras

Similar Threads

  1. QT connect Logitech webcam
    By diego in forum General Programming
    Replies: 2
    Last Post: 2nd July 2009, 18:13
  2. Application only 'animates' once
    By arkain in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2009, 09:09
  3. using a DirectShow enabled webcam to take still images in QT
    By Jason Hamilton in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2008, 00:25
  4. ¿How to stop thread that is capturing from a webcam?
    By JoseTlaseca in forum Qt Programming
    Replies: 8
    Last Post: 28th August 2008, 05:45
  5. Qthreads and webcam app
    By Schizo in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2007, 10:17

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.