View Full Version : How to interface with WebCam ? ( configurating acquisition parameters )

20th August 2011, 23:33
Dear friends,

I´m already working with a Webcam, acquiring images in QT, using OpenCV library.
It´s working fine.

However, my doubt regard to setup the internal camera parameters ( contrast, hue, disable automatic gain, optimize speed, etc... ).
I know that is possible to do by DLL access, but I have no idea about.

Does anybody could provide some reference ?
I heard about DirectShow, avicap32.dll, but have no idea abot how to start to research.

Thanks in advance.


21st August 2011, 00:35
Do you have a reference manual for your webcam? Does it tell you how to set these parameters?

21st August 2011, 02:19
hi squidge,

I´m using a WINXP compatible one, wich doesn´t requires some particular driver instalation.
The Webcam, even doesn´t bring a CD included.
I guess it implies in some standardization, and access must be done by some API of Windows, at some system DLL.

I´m wrong ?


21st August 2011, 05:19
andre you can send me your webcam code? and explain how you configure opencv with qt

22nd August 2011, 15:42
I´m using a WINXP compatible one, wich doesn´t requires some particular driver instalation.
Never the less you are using some lib to access the camera.
Have a look if this lib is offering such functionality and try calling them and see if it has influence on the image you get.

I guess it implies in some standardization,
Not necessarily.
It can just as well imply that this camera does not allow settings these parameters.

24th August 2011, 02:49

I reveived a sugestion of a friend to use function :
cv::VideoCapture::set ( http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html ).

However, I´m facing with a big problem.
I,m using the image handler type CvCapture instead VideoCapture.

Even if I instantiate a function to set that parameters, those changes does not persists on the Webcam.
What could I doing wrong ?


24th August 2011, 09:50
What do you mean with "not persists"?
Does it mean that the camera does set the parameters, but when you start it again, it has lost the settings?
If so, first make sure the camera actually does have persistent settings, maybe it doesn't, in which case you are not doing anything wrong.
If it does, maybe you can find in the camera documentation what is needed to be done to make the settings persistent.

27th August 2011, 14:27
What do you mean with "not persists"?

Dear high_flyer,

Sorry for not clear problem description.

That is not possible even to set those values on camera.
After I execute the cvSetCaptureProperty, I read it by cvGetCaptureProperty.
However returned values are every time zero ("0").

I performed all tests with different cameras :
- Windows Legacy : No proprietary driver required to install
- Others : Working only if specific drivers were instaled

Unnaforunatelly, the driver for the target camera, despite be excelent - with a lot of features - I can´t find its documentation on the web ( SG310 - SIGma ).
Also, I noticed on Google thousands of occurences of similar problem ( keyword : "cvSetCaptureProperty not working" )

Do you have some sugestion to workaround ?


29th August 2011, 10:00
Well, this is off topic here.
However, with out proper documentation it can be anything.
Most likely, the driver is not implementing the standard calls of the windows driver.
Maybe it has its own user domain lib for that, which you need to interface too.
But all this is guess work, with out documentation.
You will probably be more helped in forums where this camera is discussed.

24th July 2013, 00:05
Hi friends,

Despite original problem regarding this (old) thread had been resolved using DirectShow, now I´m facing to a similar issue.
I need perform access to those Webcam parameters ( also under QT ), but now on LINUX operational system.

Could anybody provide some guidelines ?