Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to interface with WebCam ? ( configurating acquisition parameters )

Status
Not open for further replies.

andre_luis

Super Moderator
Staff member
Advanced Member level 7
Joined
Nov 7, 2006
Messages
9,643
Helped
1,191
Reputation
2,401
Reaction score
1,218
Trophy points
1,403
Location
Brazil
Activity points
55,939
Dear friends,


I´m already working fine with a Webcam, acquiring images in C++, using OpenCV library and that´s not the question.
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 ?
Thanks in advance.

+++
 

Hi Andre,

I believe that depends on the camera and its provided interface via DLL. I have seen examples of controlling various aspects and properties of a USB Camera, however it was very device dependent and not portable to other devices.

What is the camera model you are working with and I'll help in researching the issue?

BigDog
 
Hi friend,

We buyead a lot of Webcams, and the one worked better to target application was the above :
Webcam PC Camera products, buy Webcam PC Camera products from alibaba.com

That model was designed to operate with nighvision, and maybe works fine with wavelengh applyed, IR.
We will disassemble from case and use just operational parts - electronic and optics.

However, there are not restrictions to others models.
The big issue at this moment is how to interface with that.

+++
 

Are the IR LEDs controlled separately via their software app? Or do they power up when the webcam powers up?

I trying to determine if that particular unit has its own dll installed.

Most of the available webcams, use software processing to change features like exposure, zoom, etc, rather than actual hardware control.

BigDog

---------- Post added at 19:49 ---------- Previous post was at 19:47 ----------

Most webcams use the avicap32 DLL for image capture. Are you familiar with these DLL calls?
 
Are the IR LEDs controlled separately via their software app? Or do they power up when the webcam powers up?
I trying to determine if that particular unit has its own dll installed.
Most of the available webcams, use software processing to change features like exposure, zoom, etc, rather than actual hardware control.
BigDog

Hi,

All LEDs of that Webcam will not be used.
That´s because the LED illuminator will be placed on oposide side of target object, acting as backlight.

thanks too much about note on "avicap32 DLL" file.
I will investigate.


+++
 
Last edited:

Hi,

Here are the three main ways of accessing and capturing an image from a webcam:

DirectX

Capture Sample with DirectX and .NET

DirectShow.NET

Webcam using DirectShow.NET

avicap32.dll

Accessing WebCam in Visual Basic 6

Capture video from a video device such as a Webcam with VB .NET

CAviCap and CFrameGrabber - wrappers for AVICap Window

The following programming examples show how to capture AVI files and JPEG images using IC Imaging Control simultaneously:

Library Of Source Code Samples


I'm just glad I could help.

BigDog
 
Hi friend,

Helped too much.
I will research appliance to the compiler I´m using :
QT, from Nokia.

Thanks...


+++
 

Are you acquainted with Open Source Computer Vision library

OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision.

OpenCV is released under a BSD license, it is free for both academic and commercial use.
It has C++, C, Python and soon Java interfaces running on Windows, Linux, Android and Mac.
The library has >2500 optimized algorithms.
It is used around the world, has >2.5M downloads and >40K people in the user group.
Uses range from interactive art, to mine inspection, stitching maps on the web on through advanced robotics.

**broken link removed**
 

Hi KAK,

Yes, I´m using OpenCV2.3, the last revision.
However, even there, I could not find some answer.

I guess that kind of configurations are hardware specific, and maybe require to work on system device driver or even DLLs.

+++
 

Sorry my negligent reading , 1. post 1. line you told about OpenCV

maybe require to work on system device driver or even DLLs.

I agree with this opinion.
 
The "mechanisms" to link a DLL is relativelly well-known in programming on QT with OpenCV, due must be used specific executables and linkeables libraryes to perform each task related to image processing. It library is very well documented.

However, regarding Webcam WIN legacy driver, there are some issues :
>> I don´t know exacltly if "avicap32.dll" really meets feaure what is needed to configurate Webcam ( Instead, DirectShow ).
>> Event matching requirements, I don´t know the functions inside it, in order to access Webcam registers.

+++
 

>> I don´t know exacltly if "avicap32.dll" really meets feaure what is needed to configurate Webcam ( Instead, DirectShow ).
>> Event matching requirements, I don´t know the functions inside it, in order to access Webcam registers.

Hi,

I believe you are correct. Some of the features and control you have specified may require a more sophisticated webcam, like the following:

18372.png


Logitech Webcam Pro 9000

The following features are available in Version 1.0 of the Logitech Public Property Set:

•Control the digital pan position
•Control the digital tilt position
•Control the digital zoom factor
•Control the digital pan and tilt positions and digital zoom factor
•Control the exposure time and automatic exposure mode
•Enable or disable single and multiple face tracking
•Control the LED behavior
•Control centering of the face for widescreen videos

**broken link removed**

**broken link removed**

**broken link removed**

Now you are talking real powerful control of a webcam. And an API is provided.

BigDog
 
Hi,


It´s better take a different approach, and use a non generic camera, like the one you sugested.
I will loose hardware portability, but get handleability.

Thanks.


+++
 

Hi,

There maybe other alternates, beside the Logitech WebCam I posted above. However, I do know they have a rather large following of developers which maybe a rather large asset concerning APIs and support.

BigDog
 

Hi,

I reveived a sugestion of a friend to use function :
cv::VideoCapture::set ( **broken link removed** ).

It´s amazing, but pehaps some configurations must be standardized.
I will do a test in some types of cameras, and feedback result.

Thanks.
 

Yes, I had forgotten all about the function call. Good suggestion by your friend. I had used it in a project sometime ago.

BigDog
 

My friend,


I must ask for your help again.
Since yesterday, I spent a lot of time with no results.
The reason is because my program is structured using the CvCapture type handler, while most examples on the Web use VideoCapture type handler.

Do you remember if it was the case when you used this library ?

+++
 
Last edited:

[SOLVED]Re: How to interface with WebCam ? ( configurating acquisition parameters )

Just to share the solution :


I Installed DirectShow-SDK and Windows-SDK.
There, exists a set of examples.
At Amcap demo, refers to method IAMVideoProcAmp, wich contains a set of properties :
Code:
[b] KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION[/b]
[b] KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS[/b]
 KSPROPERTY_VIDEOPROCAMP_COLORENABLE
[b] KSPROPERTY_VIDEOPROCAMP_CONTRAST[/b]
 KSPROPERTY_VIDEOPROCAMP_GAMMA
 KSPROPERTY_VIDEOPROCAMP_HUE
 KSPROPERTY_VIDEOPROCAMP_SATURATION
 KSPROPERTY_VIDEOPROCAMP_SHARPNESS
 KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE
 KSPROPERTY_VIDEOPROCAMP_GAIN

I will compile it in hidden mode, remove unnused functions and generate a DLL, having those interested parameters as entry point.

+++
 

Re: [SOLVED]Re: How to interface with WebCam ? ( configurating acquisition parameters

Hi BigDog,


The suffering continue...

I tested above solution, and, in fact, works at some Webcam´s.
However, the camera wich capured better the image with a clean result at edge detector ( a cheap chinese one ), doesn´t accept those commands.

Probably, the chipset and driver manufacturer ( Sigma - SG310 ) did´t provide standardized compatibility, and maybe this explains part of the the product extreme low cost.

+++
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top