PDA

View Full Version : capture iamge form webcam



bibhukalyana
11th April 2011, 13:47
Hi everyone ,
I want to capture images form webcam.I have not any idea about this thing.
Can any one tell how i display video streaming and capturing image using QT.
thanks.

high_flyer
11th April 2011, 14:29
There are tow different tasks here:
1. Getting data form camera
2. Displaying the data.

With 1 we can't help you other than to say, that your Camera provider provides also a driver and a lib to which you can link, and operate the camera, and retrieve data from it.
We can help you with 2, once you have got 1 sorted out first.

bibhukalyana
11th April 2011, 14:42
Thanks for replay.
I am using logitech webcam 120.I have a software though which i am able to capture image.But how i know which libraries are required ?

high_flyer
11th April 2011, 15:25
But how i know which libraries are required ?
These libs are part of the software you mentioned.
Read the documentation you got with the camera, see if there is anything that talks about libs and headers to be used in apps that want to operate the camera.
Google can help you with it as well.
You need the Dlls, the corresponding lib files and the header files.

cincirin
12th April 2011, 11:50
For windows only, see http://www.quickcamteam.net/documentation/faq/can-i-use-logitech-webcams-for-my-own-application

For cross-platform you can use OpenCV (is slightly more difficult to use, but this effort is worth :)) http://opencv.willowgarage.com/wiki/

Also, you can check http://www.quickcamteam.net/documentation/

bibhukalyana
13th April 2011, 07:26
Now i am trying same thing in linux.I download camorama.Using this i am able to connect to webcam.Can you give some hints how i will add this things in my program.
Is phonon help me ?

cincirin
13th April 2011, 11:13
For linux only, you can use V4L (Video4Linux). Their headers and libraries are included in almost all linux distro. Documentation can be found here (http://linuxtv.org/downloads/v4l-dvb-apis/v4l2spec.html)

bibhukalyana
29th April 2011, 09:01
can any one tell me how to display the frame in qt ?
I am using opencv.

high_flyer
29th April 2011, 09:43
Load the frame data into a QImage and use QPainter::drawImage() to draw the frame.