TwiceAsNice  2019-02-18
Public Member Functions | Private Attributes | List of all members
PwcWrapper Class Reference

Class PwcWrapper
More...

#include <pwc-wrapper.h>

Collaboration diagram for PwcWrapper:
Collaboration graph

Public Member Functions

 PwcWrapper (CvCapture *camera_device)
 Constructor. More...
 
 ~PwcWrapper ()
 Deconstructor. More...
 
int GetFrameRate ()
 Get frame rate (should be between 5 and 30). More...
 
void SetFrameRate (int fps)
 Set frame rate (should be between 5 and 30). More...
 
void SaveUserSettingsToEEPROM ()
 Save settings to camera interal memory (Attention: works only about 10.000x). More...
 
void RestoreUserSettingsFromEEPROM ()
 Restore settings from camera interal memory. More...
 
void ResetEEPROM ()
 Reset EEPROM to default values. More...
 
int GetCompressionMode ()
 Get compression ratio of the videostream transported by USB. More...
 
void SetCompressionMode (int newmode)
 Set compression ratio of the videostream transported by USB. More...
 
int GetAutomaticGainControl ()
 Get the value which once was set by PwcWrapper::SetAutomaticGainControl. More...
 
void SetAutomaticGainControl (int newagc)
 Philips webcams have features like auto-exposure and some additional circuitry to accomodate for changing light conditions. More...
 
void SetShutterSpeed (int speed)
 Set the shutter speed of a Philips capturing device. More...
 
void SetWhitebalance (int mode, int red, int blue)
 The white balance is the ability to correct for different lighting conditions (outdoor, indoor, artificial lighting, etc), by adjusting the gains for the red and blue pixels (green is never affected). More...
 
void SetAutomaticWhiteBalanceSpeed (int speed, int delay)
 Sets speed and delay which determine how fast the camera reacts to changes in lighting when it is in automatic mode. More...
 
void SetCameraLED (int on_time, int off_time)
 Controlling the leds is only supported by the ToUCam series. More...
 
void SetElectronicSharpness (int newvalue)
 You can electronically blur or sharpen frames coming from the web cam a little bit. More...
 
void SetBacklightCompensationMode (int newmode)
 Compensate for a very bright background (where the object in the foreground is too dark). More...
 
void SetAntiFlickerMode (int newmode)
 Due to the different frequencies of the webcam, monitor refresh rate and the electrical power supply, the intensity of the image may 'pulsate' which is quite annoying to watch. More...
 
void SetDynamicNoiseReductionMode (int newmode)
 0 means no noise reduction filtering, 3 means highest noise reduction filtering switched on. More...
 
void PrintRealImageSize ()
 Plots the real frame size to the console to check if frame size has been changed correctly, etc... More...
 

Private Attributes

CvCaptureCAM_V4Lcam
 The capturing device (must be set on class construction). More...
 

Detailed Description

Class PwcWrapper

Implements functions to enhance the OpenCV camera driver
by the Philips Web Camera specific functions.

Author
Andreas Geiger
Karlsruhe Institute of Technology
Version
1.0
Date
25.10.2007

Constructor & Destructor Documentation

◆ PwcWrapper()

PwcWrapper::PwcWrapper ( CvCapture *  camera_device)
inline

Constructor.

The opened OpenCV capturing device (where an attached Philips SPC 900 NC is assumed) has to be passed.

◆ ~PwcWrapper()

PwcWrapper::~PwcWrapper ( )
inline

Deconstructor.

Member Function Documentation

◆ GetAutomaticGainControl()

int PwcWrapper::GetAutomaticGainControl ( )

Get the value which once was set by PwcWrapper::SetAutomaticGainControl.

◆ GetCompressionMode()

int PwcWrapper::GetCompressionMode ( )

Get compression ratio of the videostream transported by USB.

0 means no compression, 3 means high compression. Each value in between is valid, too.

◆ GetFrameRate()

int PwcWrapper::GetFrameRate ( )

Get frame rate (should be between 5 and 30).

◆ PrintRealImageSize()

void PwcWrapper::PrintRealImageSize ( )

Plots the real frame size to the console to check if frame size has been changed correctly, etc...

◆ ResetEEPROM()

void PwcWrapper::ResetEEPROM ( )

Reset EEPROM to default values.

(Attention: works only about 10.000x).

◆ RestoreUserSettingsFromEEPROM()

void PwcWrapper::RestoreUserSettingsFromEEPROM ( )

Restore settings from camera interal memory.

◆ SaveUserSettingsToEEPROM()

void PwcWrapper::SaveUserSettingsToEEPROM ( )

Save settings to camera interal memory (Attention: works only about 10.000x).

When the camera is plugged off and in again the parameters will be those which have been saved during this process. Note that not all parameters will be stored!

◆ SetAntiFlickerMode()

void PwcWrapper::SetAntiFlickerMode ( int  newmode)

Due to the different frequencies of the webcam, monitor refresh rate and the electrical power supply, the intensity of the image may 'pulsate' which is quite annoying to watch.

The Philips cams have a way to suppress this. This function turns that feature on or off. A value of 0 turns if off, any other value means that it is switched on.

◆ SetAutomaticGainControl()

void PwcWrapper::SetAutomaticGainControl ( int  newagc)

Philips webcams have features like auto-exposure and some additional circuitry to accomodate for changing light conditions.

One of these features is an AGC circuit that amplifies or attenuates the signal that comes from the CCD/CMOS sensor. Normally this circuit is in auto mode, but you can set it to a fixed value if you like. The range is 0..65535. 0 means low gain, and 65535 sets it to highest gain possible. If you supply a negative number (i.e. -1), the AGC is set to automatic mode.

◆ SetAutomaticWhiteBalanceSpeed()

void PwcWrapper::SetAutomaticWhiteBalanceSpeed ( int  speed,
int  delay 
)

Sets speed and delay which determine how fast the camera reacts to changes in lighting when it is in automatic mode.

The range is 1..65535. 0 leaves the settings untouched. The higher the value speed, the slower is the reaction.

◆ SetBacklightCompensationMode()

void PwcWrapper::SetBacklightCompensationMode ( int  newmode)

Compensate for a very bright background (where the object in the foreground is too dark).

0 means on, every other value means off.

◆ SetCameraLED()

void PwcWrapper::SetCameraLED ( int  on_time,
int  off_time 
)

Controlling the leds is only supported by the ToUCam series.

It doesn't work with the leds of the SPC 900 NC.

◆ SetCompressionMode()

void PwcWrapper::SetCompressionMode ( int  newmode)

Set compression ratio of the videostream transported by USB.

0 means no compression, 3 means high compression. Each value in between is valid, too.

◆ SetDynamicNoiseReductionMode()

void PwcWrapper::SetDynamicNoiseReductionMode ( int  newmode)

0 means no noise reduction filtering, 3 means highest noise reduction filtering switched on.

Any value in between is valid, too.

◆ SetElectronicSharpness()

void PwcWrapper::SetElectronicSharpness ( int  newvalue)

You can electronically blur or sharpen frames coming from the web cam a little bit.

0 means blurring, 65535 means sharpening.

◆ SetFrameRate()

void PwcWrapper::SetFrameRate ( int  fps)

Set frame rate (should be between 5 and 30).

◆ SetShutterSpeed()

void PwcWrapper::SetShutterSpeed ( int  speed)

Set the shutter speed of a Philips capturing device.

The range is: 0..65535. Setting shutter speed and agc to -1 means automatic adjustment.

◆ SetWhitebalance()

void PwcWrapper::SetWhitebalance ( int  mode,
int  red,
int  blue 
)

The white balance is the ability to correct for different lighting conditions (outdoor, indoor, artificial lighting, etc), by adjusting the gains for the red and blue pixels (green is never affected).

Mode can be one of the following: PWC_WB_AUTO, PWC_WB_MANUAL, PWC_WB_INDOOR, PWC_WB_OUTDOOR, PWC_WB_FL. The last mode means "fluorescent lighting". Only in manual mode the red and blue parameters can be used to adjust the gain manually. The range is 0..65535.

Member Data Documentation

◆ cam

CvCaptureCAM_V4L* PwcWrapper::cam
private

The capturing device (must be set on class construction).


The documentation for this class was generated from the following files: