Changing the Settings on the WebCam

Completed Posted Nov 13, 2008 Paid on delivery
Completed Paid on delivery

We would like to be able to control the options on a Microsoft Life

Web Cam, VX-6000 or VX-3000.

We want (preferably) a C++ class that can control the settings, and a test program to show the commands work. We optionally would like a program that takes pictures camera.

## Deliverables

Description:

We would like to be able to control the options on a Microsoft Life

Web Cam, VX-6000 or VX-3000.

This project has 2 parts. We would like a solution to the first

Part. Part II is optional

==== PART I

We would like to programmatically query each parameter of

the Web-cam, get the range of possible values, get the current value

and set the value.

I have included a picture of a popup window that comes with a DirectShow object. I don't want to have the popup window, I just want to be ableto send commands to change the parameters.

If you can, we'd love to have a generic class that finds all the

properties of any camera, the type of each property, and the possible

values. You can then build a base class on top of that class that

sets/gets the appropriate values for the Microsoft Life Web Cam.

If you cannot have such a generic class, that is OK. Though, we still

want the resulting class that sets/gets certain values. Here is an

example class header you might write. Note that we begin by defining

some macros in order to make the header smaller:

to make the header smaller.

// Macro to make typing less tedious

#define GetBoolValueMacro(Name) \

HRESULT Set##NameOn();\

HERSULT Set##NameOff();\

HRESULT Get##Name(bool &value);

// Macro to make typing less tedios

#define GetValueMacro(Name, type) \

HRESULT Get##Name( type &Value); \

HRESULT Set##Name(const type &Value); \

HRESULT GetMin##Name(type &Min); \

HRESULT GetMax##Name(type &Max);

class MicrosoftWebCam : WebCam {

public:

// Description:

// Save/Restore/GetDafult properties of the camera.

void SetDefault();

void SetRestore();

void SetSave();

// Description:

// Set/Get the AutoUSBBandwidth

HRESULT SetAutoUSBBandwidthOn();

HERSULT SetAutoUSBBandwidthOff();

HRESULT GetAutoUSBBandwidth(bool &value);

// Description:

// Set/Get all the other boolean properties.

GetBoolValueMacro(AutoWhiteBalance);

GetBoolValueMacro(BacklightCompensation);

GetBoolValueMacro(BlackWhiteMode);

GetBoolValueMacro(MirrorImage);

GetBoolValueMacro(FlipImage);

GetBoolValueMacro(LowLight);

// Description:

// Get/Set Flicker

HRESULT GetFlicker(const int &Value)

HRESULT SetFlicker50Hz();

HRESULT SetFlicker60Hz();

// Description:

// Get/Set Indoor/outdoor

HRESULT GetIndoorOutdoor(const int &Value)

HRESULT SetIndoorOutdoor();

HRESULT SetIndoorOutdoor();

// Description:

// The Brightness.

HRESULT GetBrightness( int &Value);

HRESULT SetBrightness(const int &Value);

HRESULT GetMinBrightness(int &Min);

HRESULT GetMaxBrightness(int &Max);

// Description:

// Set/Get the other values. I don't know if these are int or something

// else. Use the macros to save typing

GetValuesMacro(Contrast, int);

GetValuesMacro(Hue, int);

GetValuesMacro(Saturation, int);

GetValuesMacro(Sharpness, int);

GetValuesMacro(USBBandwidth, int);

GetValuesMacro(Exposure, int);

GetValuesMacro(RedBalance, int);

GetValuesMacro(BlueBalance, int);

};

We would like the above classes.

==== PART II

This part is optional. Please indicate in your bid if you wish to include

it. We would like to be able to get images off the web-cam easily.

* We want to be able to quickly get a picture.

* When we are not grabbing pictures, we want to the camera to use

a small amount of CPU.

* We want to be able to select the Camera by name.

* If there are multiple cameras, we want to be select the n'th camera

You may solve the problem in the way you wish. We expect you would

use DirectShow. We expect you would end up with a class that look

something like:

class WebCam {

public:

// Description:

// Set the desired Camera Name, e.g. Microsoft

void SetDesiredCameraName(const char *CameraName);

// Description:

// If there are N cameras with the above name, get a particular camera.

// Goes from 0..N-1

void SetNthCamera(const int &num);

// Description:

// FindCamera. Returns Success if we found a camera with the proper name

// and number, as set above. This will run in the background and should use

// a small amount of CPU if at all possible.

HRESULT StartCamera();

// Description:

// Get Possible resolutions;

HRESULT FindResolutions(set<int> &xres, set<int> &yres);

// Description:

// Set the Resolution

HRESULT SetResolution(const int &xres, const int &yres);

// Description:

// Typically, we can query the camera for a friendly name

// Above, we set "Microsoft". Here we would get Microsoft Life Cam 3000

// or something like that.

HRESULT FindFriendlyName();

std::string() GetFriendlyName();

// Description:

// Take A Picture and cash the bytes somewhere in the class

// Then, get the bytes in an array, or a bitmap or something.

HRESULT TakePicture();

BYTE *GetBitmap();

protected:

// Description:

// These are some expected functions we will use

// You do not have to create these, we just figure you will use them.

HRESULT InitGraph();

HRESULT ClearGraph();

HRESULT BuildGraph();

HRESULT GetCaptureDevice(const char *CameraName, const int &num);

private:

// variables we figure you will use, but maybe not.

CComPtr< IGraphBuilder > m_pGraph;

CComPtr< ISampleGrabber > m_pGrabber;

CComPtr<ICaptureGraphBuilder2> m_pCaptureGraphBuilder2;

CComPtr< IBaseFilter > m_pCaptureDevice;

CComPtr<IBaseFilter> m_pRenderer;

};

Please include a test program with this part.

Notes:

(a) Visual Studio 2003 or 2008.

(b) You can use Windows XP and Windows Vista. We will test the code on both.

(c) We have some example code for Part II of the project.

But, it is very slow. That is, it effectively turns the camera

on/off each time it takes a picture so that it takes 30 seconds

just to grab a picture. We do not want that. We can send you what

we have, but we warn you it does not work the way we want.

(d) If you need a remote computer to log into with such a web cam on it,

we can probably provide it.

C Programming C# Programming Engineering Microsoft MySQL PHP Project Management Software Architecture Software Testing Windows Desktop

Project ID: #3388303

About the project

3 proposals Remote project Active Jan 17, 2009

Awarded to:

vw7052196vw

See private message.

$170 USD in 14 days
(1 Review)
3.0

3 freelancers are bidding on average $312 for this job

egyptsoft

See private message.

$255 USD in 14 days
(6 Reviews)
3.5
vw7087303vw

See private message.

$510 USD in 14 days
(1 Review)
0.0