This module handles low level firewire communication with unibrain firei cameras. More...
![]() |
Data Structures | |
class | base_firei_control |
Files | |
file | base_firei.cpp |
Defines the class's main methods. | |
file | base_firei.h |
Defines the base_firei class. | |
file | conversions.cpp |
Defines the base_firei conversions. Copied directly from Coriander, and added conversions to bgr (backwards rgb). | |
file | conversions.h |
Defines the base_firei conversions. Copied directly from Coriander, and added conversions to bgr (backwards rgb). | |
file | setsandgets.cpp |
Defines the base_firei 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 | YUYV |
#define | YUV2RGB(y, u, v, r, g, b) |
#define | RGB2YUV(r, g, b, y, u, v) |
#define | CLIP(in, out) |
#define | OPENCV_CONVERSIONS |
Enumerations | |
enum | bayer_decoding_t { NO_BAYER_DECODING, BAYER_DECODING_NEAREST, BAYER_DECODING_EDGE_SENSE, BAYER_DECODING_DOWNSAMPLE } |
enum | stereo_decoding_t { NO_STEREO_DECODING, STEREO_DECODING } |
enum | bayer_pattern_t { BAYER_PATTERN_BGGR, BAYER_PATTERN_GRBG, BAYER_PATTERN_RGGB, BAYER_PATTERN_GBRG } |
Functions | |
void | yuyv2uyvy (unsigned char *, unsigned char *, int) |
void | uyvy2yuyv (unsigned char *, unsigned char *, int) |
void | uyyvyy2uyvy (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyv2uyvy (unsigned char *src, unsigned char *dest, int NumPixels) |
void | y2uyvy (unsigned char *src, unsigned char *dest, int NumPixels) |
void | y162uyvy (unsigned char *src, unsigned char *dest, int NumPixels, int bits) |
void | y162y (unsigned char *src, unsigned char *dest, int NumPixels, int bits) |
void | rgb2uyvy (unsigned char *src, unsigned char *dest, int NumPixels) |
void | rgb482uyvy (unsigned char *src, unsigned char *dest, int NumPixels) |
void | rgb482rgb (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyv2rgb (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyv2bgr (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyvy2rgb (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyvy2bgr (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyyvyy2rgb (unsigned char *src, unsigned char *dest, int NumPixels) |
void | uyyvyy2bgr (unsigned char *src, unsigned char *dest, int NumPixels) |
void | y2rgb (unsigned char *src, unsigned char *dest, int NumPixels) |
void | y162rgb (unsigned char *src, unsigned char *dest, int NumPixels, int bits) |
void | BayerNearestNeighbor (unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type) |
void | BayerEdgeSense (unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type) |
void | BayerDownsample (unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type) |
void | StereoDecode (unsigned char *src, unsigned char *dest, int NumPixels) |
void | convert_to_rgb (unsigned char *src, unsigned char *dest, int mode, int width, int height, int f7_colormode, int bayer, int bits) |
void | convert_to_bgr (unsigned char *src, unsigned char *dest, int mode, int width, int height, int, int bayer, int) |
base_firei_control::base_firei_control () | |
Class constructor. | |
base_firei_control::base_firei_control (char *devicefile, int HN, int NN, int CF, int FR) | |
Overloaded class constructor. | |
base_firei_control::~base_firei_control () | |
Class destructor. | |
int | base_firei_control::SetPredefinedParams (int paramsset) |
int | base_firei_control::SetColorFormat (int cm) |
Sets the camera color format. | |
int | base_firei_control::OpenHandle (void) |
Opens the raw1394 handle with the num HandleNum. | |
int | base_firei_control::TurnOffCamera (void) |
Turns off the camera in handle handlenum and node nodenum. | |
int | base_firei_control::TurnOnCamera (void) |
Turns on the camera in handle handlenum and node nodenum. | |
int | base_firei_control::GetCameraNodes (void) |
Gets all the cameras and their nodes in the predefined handlenum. | |
int | base_firei_control::PrintPossibleModes (void) |
Prints to shell all the camera possible modes. | |
int | base_firei_control::PrintPossibleFrameRates (void) |
Prints to shell all the camera possible frame rates. | |
int | base_firei_control::StartIsoTransmission (void) |
Starts iso transmission. | |
int | base_firei_control::GetFrame_dma (IplImage *img, int64 *ts) |
int | base_firei_control::GetFrame_dma (IplImage *img) |
Gets an image from the camera at handle handlenum and node nodenum. | |
int | base_firei_control::GetFrame (IplImage *img, double *ts) |
int | base_firei_control::GetFrame_dma (IplImage *img, double *ts) |
int | base_firei_control::SetFeatureToManualAuto (unsigned int f, unsigned int val) |
Sets a camera feature to manual or auto control. | |
int | base_firei_control::GetBrightness (void) |
int | base_firei_control::GetExposure (void) |
int | base_firei_control::GetSharpness (void) |
int | base_firei_control::GetWhiteBalance (void) |
int | base_firei_control::GetHue (void) |
int | base_firei_control::GetSaturation (void) |
int | base_firei_control::GetGamma (void) |
int | base_firei_control::GetShutter (void) |
int | base_firei_control::GetGain (void) |
int | base_firei_control::GetFrameRate (void) |
int | base_firei_control::GetIris (void) |
int | base_firei_control::SetBrightness (unsigned int b, unsigned char manual) |
int | base_firei_control::SetSaturation (unsigned int s, unsigned char manual) |
int | base_firei_control::SetFrameRate (int fr) |
int | base_firei_control::SetExposure (unsigned int e, unsigned char manual) |
int | base_firei_control::SetSharpness (unsigned int s, unsigned char manual) |
int | base_firei_control::SetWhiteBalance (unsigned int ub, unsigned int vr, unsigned char manual) |
int | base_firei_control::SetHue (unsigned int h, unsigned char manual) |
int | base_firei_control::SetGamma (unsigned int g, unsigned char manual) |
int | base_firei_control::SetShutter (unsigned int s, unsigned char manual) |
int | base_firei_control::SetGain (unsigned int g, unsigned char manual) |
This module handles low level firewire communication with unibrain firei cameras.
#define AUTO 1 |
#define CLIP | ( | in, | |||
out | ) |
{\ in = in < 0 ? 0 : in;\ in = in > 255 ? 255 : in;\ out=in;\ }
#define FALSE 0 |
#define MANUAL 0 |
#define OPENCV_CONVERSIONS |
#define RGB2YUV | ( | r, | |||
g, | |||||
b, | |||||
y, | |||||
u, | |||||
v | ) |
#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 |
#define YUV2RGB | ( | y, | |||
u, | |||||
v, | |||||
r, | |||||
g, | |||||
b | ) |
#define YUYV |
enum bayer_decoding_t |
enum bayer_pattern_t |
enum stereo_decoding_t |
base_firei_control::base_firei_control | ( | char * | devicefile, | |
int | HN, | |||
int | NN, | |||
int | CF, | |||
int | FR | |||
) | [inherited] |
Overloaded class constructor.
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. |
References base_firei_control::camera, base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::channel, base_firei_control::format, base_firei_control::framerate, base_firei_control::handle, base_firei_control::handlenum, base_firei_control::mode, base_firei_control::nodenum, base_firei_control::numCameras, base_firei_control::numNodes, and base_firei_control::speed.
base_firei_control::base_firei_control | ( | ) | [inherited] |
Class constructor.
void BayerDownsample | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | sx, | |||
int | sy, | |||
bayer_pattern_t | type | |||
) |
void BayerEdgeSense | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | sx, | |||
int | sy, | |||
bayer_pattern_t | type | |||
) |
void BayerNearestNeighbor | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | sx, | |||
int | sy, | |||
bayer_pattern_t | type | |||
) |
void convert_to_bgr | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | mode, | |||
int | width, | |||
int | height, | |||
int | , | |||
int | bayer, | |||
int | ||||
) |
Referenced by base_firei_control::GetFrame(), and base_firei_control::GetFrame_dma().
void convert_to_rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | mode, | |||
int | width, | |||
int | height, | |||
int | f7_colormode, | |||
int | bayer, | |||
int | bits | |||
) |
int base_firei_control::GetBrightness | ( | void | ) | [inherited] |
int base_firei_control::GetCameraNodes | ( | void | ) | [inherited] |
Gets all the cameras and their nodes in the predefined handlenum.
References base_firei_control::camera_nodes, base_firei_control::handle, and base_firei_control::numCameras.
int base_firei_control::GetExposure | ( | void | ) | [inherited] |
int base_firei_control::GetFrame | ( | IplImage * | img, | |
double * | ts | |||
) | [inherited] |
References base_firei_control::camera, base_firei_control::captureparams, convert_to_bgr(), FALSE, base_firei_control::handle, base_firei_control::mode, NO_BAYER_DECODING, and TRUE.
int base_firei_control::GetFrame_dma | ( | IplImage * | img, | |
double * | ts | |||
) | [inherited] |
References base_firei_control::camera, base_firei_control::captureparams, convert_to_bgr(), FALSE, base_firei_control::handle, base_firei_control::mode, NO_BAYER_DECODING, and TRUE.
int base_firei_control::GetFrame_dma | ( | IplImage * | img | ) | [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.
img | Pointer to the user image. |
References base_firei_control::camera, base_firei_control::captureparams, convert_to_bgr(), FALSE, base_firei_control::handle, base_firei_control::mode, NO_BAYER_DECODING, and TRUE.
Referenced by base_firei_control::GetFrame_dma().
int base_firei_control::GetFrame_dma | ( | IplImage * | img, | |
int64 * | ts | |||
) | [inherited] |
int base_firei_control::GetFrameRate | ( | void | ) | [inherited] |
int base_firei_control::GetGain | ( | void | ) | [inherited] |
int base_firei_control::GetGamma | ( | void | ) | [inherited] |
int base_firei_control::GetHue | ( | void | ) | [inherited] |
int base_firei_control::GetIris | ( | void | ) | [inherited] |
int base_firei_control::GetSaturation | ( | void | ) | [inherited] |
int base_firei_control::GetSharpness | ( | void | ) | [inherited] |
int base_firei_control::GetShutter | ( | void | ) | [inherited] |
int base_firei_control::GetWhiteBalance | ( | void | ) | [inherited] |
int base_firei_control::OpenHandle | ( | void | ) | [inherited] |
Opens the raw1394 handle with the num HandleNum.
References FALSE, base_firei_control::handle, base_firei_control::handlenum, and TRUE.
int base_firei_control::PrintPossibleFrameRates | ( | void | ) | [inherited] |
Prints to shell all the camera possible frame rates.
Referenced by base_firei_control::SetFrameRate().
int base_firei_control::PrintPossibleModes | ( | void | ) | [inherited] |
Prints to shell all the camera possible modes.
Referenced by base_firei_control::SetColorFormat().
void rgb2uyvy | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void rgb482rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void rgb482uyvy | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
int base_firei_control::SetBrightness | ( | unsigned int | b, | |
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by brightness_change_handler().
int base_firei_control::SetColorFormat | ( | int | cm | ) | [inherited] |
Sets the camera color format.
The color format is defined in an enum declared in dc1394_control.h
The supported modes are:
If none of this modes is selected the default mode MODE_320x240_YUV422 is selected
cm | Color format reference given by an enum defined in dc1394_control.h |
References base_firei_control::captureparams, and base_firei_control::PrintPossibleModes().
int base_firei_control::SetExposure | ( | unsigned int | e, | |
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by exposure_change_handler().
int base_firei_control::SetFeatureToManualAuto | ( | unsigned int | f, | |
unsigned int | val | |||
) | [inherited] |
Sets a camera feature to manual or auto control.
The available features are defined in a enum of dc1394_control.h
These are:
f | feature to change | |
val | 1 is auto and 0 for manual |
References base_firei_control::camera_nodes, base_firei_control::handle, and base_firei_control::nodenum.
int base_firei_control::SetFrameRate | ( | int | fr | ) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, base_firei_control::nodenum, and base_firei_control::PrintPossibleFrameRates().
int base_firei_control::SetGain | ( | unsigned int | g, | |
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by gain_change_handler().
int base_firei_control::SetGamma | ( | unsigned int | g, | |
unsigned char | manual | |||
) | [inherited] |
int base_firei_control::SetHue | ( | unsigned int | h, | |
unsigned char | manual | |||
) | [inherited] |
int base_firei_control::SetPredefinedParams | ( | int | paramsset | ) | [inherited] |
int base_firei_control::SetSaturation | ( | unsigned int | s, | |
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by saturation_change_handler().
int base_firei_control::SetSharpness | ( | unsigned int | s, | |
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by sharpness_change_handler().
int base_firei_control::SetShutter | ( | unsigned int | s, | |
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by shutter_change_handler().
int base_firei_control::SetWhiteBalance | ( | unsigned int | ub, | |
unsigned int | vr, | |||
unsigned char | manual | |||
) | [inherited] |
References base_firei_control::camera_nodes, base_firei_control::captureparams, base_firei_control::handle, and base_firei_control::nodenum.
Referenced by whitebalance_change_handler().
int base_firei_control::StartIsoTransmission | ( | void | ) | [inherited] |
Starts iso transmission.
References base_firei_control::camera, and base_firei_control::handle.
void StereoDecode | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
int base_firei_control::TurnOffCamera | ( | void | ) | [inherited] |
Turns off the camera in handle handlenum and node nodenum.
References base_firei_control::handle, base_firei_control::nodenum, and ret.
int base_firei_control::TurnOnCamera | ( | void | ) | [inherited] |
Turns on the camera in handle handlenum and node nodenum.
References base_firei_control::handle, base_firei_control::nodenum, and ret.
void uyv2bgr | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
References YUV2RGB.
void uyv2rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void uyv2uyvy | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void uyvy2bgr | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void uyvy2rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void uyvy2yuyv | ( | unsigned char * | , | |
unsigned char * | , | |||
int | ||||
) |
void uyyvyy2bgr | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
References YUV2RGB.
void uyyvyy2rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void uyyvyy2uyvy | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void y162rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels, | |||
int | bits | |||
) |
void y162uyvy | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels, | |||
int | bits | |||
) |
void y162y | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels, | |||
int | bits | |||
) |
void y2rgb | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void y2uyvy | ( | unsigned char * | src, | |
unsigned char * | dest, | |||
int | NumPixels | |||
) |
void yuyv2uyvy | ( | unsigned char * | , | |
unsigned char * | , | |||
int | ||||
) |
base_firei_control::~base_firei_control | ( | ) | [inherited] |
Class destructor.
References base_firei_control::camera, and base_firei_control::handle.