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
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
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.
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
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.
Thank for help.
I will research with OpenCV now.
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:
#include "cv.h" #include "highgui.h" #include <stdio.h> // A Simple Camera Capture Framework int main() { CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY ); if( !capture ) { fprintf( stderr, "ERROR: capture is NULL \n" ); getchar(); return -1; } // Create a window in which the captured images will be presented cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE ); // Show the image captured from the camera in the window and repeat while( 1 ) { // Get one frame IplImage* frame = cvQueryFrame( capture ); if( !frame ) { fprintf( stderr, "ERROR: frame is null...\n" ); getchar(); break; } cvShowImage( "mywindow", frame ); // Do not release the frame! //If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version), //remove higher bits using AND operator if( (cvWaitKey(10) & 255) == 27 ) break; } // Release the capture device housekeeping cvReleaseCapture( &capture ); cvDestroyWindow( "mywindow" ); return 0; }To copy to clipboard, switch view to plain text mode
Write some converter from IplImage to QImage.
It's nice to be important but it's more important to be nice.
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:
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![]()
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:
TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += "C:\Program Files\OpenCV\cv\include" INCLUDEPATH += "C:\Program Files\OpenCV\cxcore\include" INCLUDEPATH += "C:\Program Files\OpenCV\cvaux\include" INCLUDEPATH += "C:\Program Files\OpenCV\otherlibs\highgui" LIBS += "C:\Program Files\OpenCV\lib\cv.lib" LIBS += "C:\Program Files\OpenCV\lib\cxcore.lib" LIBS += "C:\Program Files\OpenCV\lib\cvaux.lib" LIBS += "C:\Program Files\OpenCV\lib\highgui.lib" SOURCES += main.cpp QOpenCVWidget.cpp MyCameraWindow.cpp HEADERS += QOpenCVWidget.cpp MyCameraWindow.hTo 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:
mingwm10.dll highgui.dll cxcore110.dll QtCored4.dll QtGuid4.dllTo 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
to just:
Carl
Last edited by carllooper; 19th August 2009 at 12:54. Reason: Added "firewire support" comment.
daebarkee (7th September 2009)
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
on windows os, u can do directshow or vfw programming.
http://www.codeguru.com/cpp/g-m/dire...cle.php/c6973/
to control logitech pan/tilt/zoom functions, take a look at this link
http://www.quickcamteam.net/document...gitech-cameras
Bookmarks