Base_pgcamera
[Flea2]

This module handles the lowlevel firewire communication with flea2 cameras. More...

Collaboration diagram for Base_pgcamera:

Data Structures

class  base_pgcamera_control

Files

file  base_pgcamera.cpp
 

Defines the base_pgcamera main methods.


file  base_pgcamera.h
 

Defines the base_pgcamera class.


file  base_pgcamera_setsandgets.cpp
 

Defines the base_pgcamera sets and gets. Methods for settting or getting advanced camera parameters like brightness etc.


Defines

#define TRUE   1
#define FALSE   0
#define AUTO   1
#define MANUAL   0
#define SET1_BRIGHTNESS   350
#define SET1_EXPOSURE   500
#define SET1_SHARPNESS   70
#define SET1_SATURATION   130
#define SET1_GAMMA   1
#define SET1_SHUTTER   7
#define SET1_GAIN   60
#define SET2_BRIGHTNESS   379
#define SET2_EXPOSURE   500
#define SET2_SHARPNESS   70
#define SET2_SATURATION   130
#define SET2_GAMMA   0
#define SET2_SHUTTER   7
#define SET2_GAIN   235
#define USE_1394B

Functions

 base_pgcamera_control::base_pgcamera_control ()
 Class constructor.
 base_pgcamera_control::base_pgcamera_control (int HN, unsigned int NN, dc1394video_mode_t vm, int FR)
 Overloaded class constructor.
 base_pgcamera_control::~base_pgcamera_control ()
 Class destructor.
int base_pgcamera_control::GetFrame_dma (IplImage *img, double *ts)
 Gets an image from the camera at handle handlenum and node nodenum.
int base_pgcamera_control::SetPredefinedParams (int paramsset)
int base_pgcamera_control::GetBrightness (void)
int base_pgcamera_control::GetExposure (void)
int base_pgcamera_control::GetSharpness (void)
int base_pgcamera_control::GetWhiteBalance (void)
int base_pgcamera_control::GetHue (void)
int base_pgcamera_control::GetSaturation (void)
int base_pgcamera_control::GetGamma (void)
int base_pgcamera_control::GetShutter (void)
int base_pgcamera_control::GetGain (void)
int base_pgcamera_control::GetFrameRate (void)
 Inits camera to its factory settings.
int base_pgcamera_control::GetIris (void)
int base_pgcamera_control::SetBrightness (unsigned int b, unsigned char manual)
int base_pgcamera_control::SetSaturation (unsigned int s, unsigned char manual)
int base_pgcamera_control::SetFrameRate (int fr)
int base_pgcamera_control::SetExposure (unsigned int e, unsigned char manual)
int base_pgcamera_control::SetSharpness (unsigned int s, unsigned char manual)
int base_pgcamera_control::SetWhiteBalance (unsigned int ub, unsigned int vr, unsigned char manual)
int base_pgcamera_control::SetHue (unsigned int h, unsigned char manual)
int base_pgcamera_control::SetGamma (unsigned int g, unsigned char manual)
int base_pgcamera_control::SetShutter (unsigned int s, unsigned char manual)
int base_pgcamera_control::SetGain (unsigned int g, unsigned char manual)

Detailed Description

This module handles the lowlevel firewire communication with flea2 cameras.


Define Documentation

#define AUTO   1
#define FALSE   0
#define MANUAL   0
#define SET1_BRIGHTNESS   350
#define SET1_EXPOSURE   500
#define SET1_GAIN   60
#define SET1_GAMMA   1
#define SET1_SATURATION   130
#define SET1_SHARPNESS   70
#define SET1_SHUTTER   7
#define SET2_BRIGHTNESS   379
#define SET2_EXPOSURE   500
#define SET2_GAIN   235
#define SET2_GAMMA   0
#define SET2_SATURATION   130
#define SET2_SHARPNESS   70
#define SET2_SHUTTER   7
#define TRUE   1

libdc 2.0 used for pointgrey cameras

#define USE_1394B

Function Documentation

base_pgcamera_control::base_pgcamera_control ( int  HN,
unsigned int  NN,
dc1394video_mode_t  vm,
int  FR 
) [inherited]

Overloaded class constructor.

Parameters:
HN Handle number
NN Node number
CF Color format. Check int SetColorFormat(int cm) for more info.
FR Frame rate. Check int SetFrameRate(int fr) for more info.

Find cameras on the 1394 buses

Test if camera node number NN exists

create a new camera struct

get supported video modes

check if asked video mode is supported

get supported frame rates

set the highest frame rate possible

setup capture

setup video mode and framerate

setup dma_buffer to 15

start iso transmission

Sleep untill the camera has a transmission

Get width and height of chossen format

Check how many channels for the image. Use dc1394_is_color() to see if its a color image

References base_pgcamera_control::camera, base_pgcamera_control::captureparams, base_pgcamera_control::cleanup_and_exit(), base_pgcamera_control::coding, base_pgcamera_control::d, base_pgcamera_control::err, base_pgcamera_control::features, base_pgcamera_control::framerate, base_pgcamera_control::framerates, base_pgcamera_control::handlenum, i, base_pgcamera_control::is_color, base_pgcamera_control::nodenum, status, base_pgcamera_control::video_mode, and base_pgcamera_control::video_modes.

Here is the call graph for this function:

base_pgcamera_control::base_pgcamera_control (  )  [inherited]

Class constructor.

int base_pgcamera_control::GetBrightness ( void   )  [inherited]
int base_pgcamera_control::GetExposure ( void   )  [inherited]
int base_pgcamera_control::GetFrame_dma ( IplImage *  img,
double *  ts 
) [inherited]

Gets an image from the camera at handle handlenum and node nodenum.

The img data will be filled with the captured frame information. If testimgparams flag is set (it's set by default) the function first checks if the img properties are the same as the capture ones avoiding a runtime crash. Of course this test will take a bit longer if performed.

Parameters:
img Pointer to the user image.
Returns:
function return the value of the current framerate stored in captureparams.FrameRate

First call to dequeue is to clean up accumulated frames

Get the frame

Aparently function dc1394_convert_to_RGB8() already will checks if the image is in RGB and only just copies them if required

Opencv uses BGR representation

enqueue frame

point argument to image

get timestamp

References base_pgcamera_control::camera, base_pgcamera_control::captureparams, base_pgcamera_control::cleanup_and_exit(), base_pgcamera_control::err, and base_pgcamera_control::frame.

Here is the call graph for this function:

int base_pgcamera_control::GetFrameRate ( void   )  [inherited]

Inits camera to its factory settings.

Returns:
function result. 1 is OK 0 is NOK

References base_pgcamera_control::captureparams.

int base_pgcamera_control::GetGain ( void   )  [inherited]
int base_pgcamera_control::GetGamma ( void   )  [inherited]
int base_pgcamera_control::GetHue ( void   )  [inherited]
int base_pgcamera_control::GetIris ( void   )  [inherited]
int base_pgcamera_control::GetSaturation ( void   )  [inherited]
int base_pgcamera_control::GetSharpness ( void   )  [inherited]
int base_pgcamera_control::GetShutter ( void   )  [inherited]
int base_pgcamera_control::GetWhiteBalance ( void   )  [inherited]
int base_pgcamera_control::SetBrightness ( unsigned int  b,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetExposure ( unsigned int  e,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetFrameRate ( int  fr  )  [inherited]
int base_pgcamera_control::SetGain ( unsigned int  g,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetGamma ( unsigned int  g,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetHue ( unsigned int  h,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetPredefinedParams ( int  paramsset  )  [inherited]
int base_pgcamera_control::SetSaturation ( unsigned int  s,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetSharpness ( unsigned int  s,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetShutter ( unsigned int  s,
unsigned char  manual 
) [inherited]
int base_pgcamera_control::SetWhiteBalance ( unsigned int  ub,
unsigned int  vr,
unsigned char  manual 
) [inherited]
base_pgcamera_control::~base_pgcamera_control (  )  [inherited]

Class destructor.

References base_pgcamera_control::camera, and base_pgcamera_control::cleanup_and_exit().

Here is the call graph for this function:

Generated on Wed Jun 2 12:43:24 2010 for LAR Atlas by  doxygen 1.6.3