PDA

View Full Version : Software with webcam viewer



Momergil
1st December 2012, 03:23
Hello!

I would like to know the steps to include a usb-webcam viewer inside a software.

I did some research already and I noticed that most guys who run with this end up using OpenCV, but I would like not to take this approach - to use an external library to do the job. Personally, I have some problems with external libraries ^^

But anyway, my question is how could I do this using Qt alone. You know, put a QWidget inside the mainwindow .ui and read the webcam's info and plot the video (its video, not simple images (photos)). I noticed the class QCamera and the camera example that comes with Qt, but I wasn't able to include QCamera inside my software as well as I wasn't able to run the example because some classes were missing. And I guess that thoose classes (as with QCamera) were made for mobile applications, while what I want is a webcam viewer for Windows-Desktop.

Please could somebody give me some light in this? If there is no other way, than I'll use OpenCV, but I would really love to avoid it. Besides, I must do this at best in one weak, so no much time to learn about new libraries :)

Thanks,

Momergil

ChrisW67
2nd December 2012, 21:33
But anyway, my question is how could I do this using Qt alone.
You cannot do this on a desktop machine with Qt alone, which is why people use external libraries (including QtMobility). QCamera's support is, AFAIK, still limited to mobile phone devices.

If you have to do this within a week then you will be using OpenCV or something similar.

Momergil
4th December 2012, 23:22
You cannot do this on a desktop machine with Qt alone, which is why people use external libraries (including QtMobility). QCamera's support is, AFAIK, still limited to mobile phone devices.

If you have to do this within a week then you will be using OpenCV or something similar.

Hmm, sad that Qt haven't got yet proper functioning with cameras :T

well, I'll see what I can do about OpenCV.

Thanks!

Momergil

Momergil
8th December 2012, 18:51
Well in that case, could you please redirect me to some link with a GOOD tutorial about how to use OpenCV + Qt? I found some videos on youtube etc.. but all of them don't show the process fully, i.e. either the library building is not shown, or else when its shown its not complete (just throwing some tips but actually never saying how exactly it should be done - e.g. in opencv's installation tutorial). And when I try different steps, always some kind of error appears.

ChrisW67
10th December 2012, 23:34
What is the point of a blow-by-blow tutorial that is almost 110% guaranteed to be wrong in some detail and have you back asking for a "GOOD" tutorial again?

The process is simple enough:

Download OpenCV (http://sourceforge.net/projects/opencvlibrary/files/)
Download any required dependencies as detailed in the Install Guide (http://opencv.willowgarage.com/wiki/InstallGuide)
Build OpenCV using the same tool chain as you intend to use for your Qt project.
Adapt your Qt project file INCLUDEPATH and LIBS variable to reference OpenCV as an external library (http://qt-project.org/doc/qt-4.8/qmake-project-files.html#declaring-other-libraries).
Build your Qt project


Sure, you need to know how to use your tools to fill in the blanks but:

You must know how to use your tools if you intend to do anything more serious than "Hello World"
Any attempt to fill the blanks by a third party will almost certainly be wrong in some detail and you will need to know your tools to work out how/what/why?

Invest in understanding and you will find doing much easier.