Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

AiboCam Class Reference

#include <aibocam.h>

Collaboration diagram for AiboCam:

Collaboration graph
[legend]

Public Member Functions

 AiboCam ()
virtual ~AiboCam ()
void OpenPrimitive ()
void RAW2 (byte *outImage, byte *rawImage, const int width, const int height, const LAYER l) const
 Functions converts an raw image in the format you want to.
The Raw Image data of the Aibo has a format like :.
Methods for manipulation of the CDT (ColorDetectionTable) data
void SetCdtChannels (const int numChannels)
int GetCdtChannels () const
void SetCdtVectorDataOfPinkBall (const int channel=0)
void SetCdtVectorDataOfPinkBallSpecial (const int channel=0)
void SetCdtTable (const int channel, const CdtData table[32])
int GetColorFrequency (OFbkImageVectorData *imageVec, const int channel=0)
int GetColorFrequency (OFbkImageVectorData *imageVec, const OCdtChannel channel=ocdtCHANNEL0)
bool GetCenter (OFbkImageVectorData *imageVec, int cdtChannel, int &xCenter, int &yCenter)
 Gives the center of an region tracked with a CDT.
bool GetCenter (OFbkImageVectorData *imageVec, int cdtChannel, int *xCenter, int *yCenter)
 Gives the center of an region tracked with a CDT.
bool GetCenter (const OFbkImage &cdtImage, const int cdtChannel, int *xCenter, int *yCenter)
 Gives the center of an region tracked with a CDT.
bool GetCenter (const OFbkImage &cdtImage, const OCdtChannel &cdtChannel, int *xCenter, int *yCenter)
 Gives the center of an region tracked with a CDT.
void saveCDT (char *fileName, CdtData cdt[32]) const
CdtDataloadCDT (char *fileName)
Methods for camera parameters
void SetWhiteBalance (WHITE_BALANCE balance)
void SetShutterSpeed (SHUTTER_SPEED speed)
void SetGain (CAM_GAIN gain)
Methods for saving images on memstick
void SaveRawData (char *path, OFbkImageVectorData *imageVec, const OFbkImageLayer layer) const
void SaveBMP (char *path, OFbkImageVectorData *imageVec, const OFbkImageLayer layer) const
void SaveCdtBMP (char *basepath, OFbkImageVectorData *imageVec) const
Methods for accessing the image data
OFbkImage GetYImage (OFbkImageVectorData *imageVec, const OFbkImageLayer layer)
OFbkImage GetCbImage (OFbkImageVectorData *imageVec, const OFbkImageLayer layer)
OFbkImage GetCrImage (OFbkImageVectorData *imageVec, const OFbkImageLayer layer)
OFbkImage GetCdtImage (OFbkImageVectorData *imageVec)
int GetImageWidth (OFbkImage *image) const
 Returns width of an image.
int GetImageHeight (OFbkImage *image) const
 Returns height of Image.
byte * GetImageData (OFbkImageVectorData *imageVec, const OFbkImageLayer layer)
 gives a pointer to the raw image data
void GetYCrCbData (byte *ycrcbImage, OFbkImageVectorData *imageVec, const OFbkImageLayer layer) const
 copies the ycrcb image data from a raw into a ycrcb image
byte * GetImageData (OFbkImage *image)
 copies the ycrcb image data from a raw into a ycrcb imageReturns a byte pointer to the raw image data
byte * GetImageData (const OFbkImage &image)

Protected Member Functions

Functions for image conversion
void YCrCb2RGB (byte y, byte cr, byte cb, byte *r, byte *g, byte *b) const
 converts a ycrcb tripel into rgb triple
void YCrCb2RGB (byte *rgbImage, byte *ycrcbImage, const int width, const int height) const
 Functions converts an YCrCb (888) image in a RGB (888) image.
void RAW2RGB (byte *rgbImage, byte *rawImage, const int width, const int height) const
 Functions converts an raw image in a RGB (888) image.
void RAW2YCrCb (byte *ycrcbImage, byte *rawImage, const int width, const int height) const
 Functions converts an raw image in a YCrCB(888) image.

Protected Attributes

OPrimitiveID FbkID
OCdtVectorData * CdtVector
MemoryRegionID CdtVectorID

Detailed Description

This class implements methods for simplified camera access, image format conversions etc.
Version:
0.87
Examples:

cam/Makefile, and CamExample.h.


Constructor & Destructor Documentation

AiboCam::AiboCam  ) 
 

Default constructor

AiboCam::~AiboCam  )  [virtual]
 

Default destructor


Member Function Documentation

void AiboCam::OpenPrimitive  ) 
 

Method to initialize the FbkID

See also:
FbkID

void AiboCam::SetCdtChannels const int  numChannels  ) 
 

Sets the number of CDT Channels in CdtVectorData Channel data has to be set first

Parameters:
numChannels Number of channels set in the CdtVectorData. 8 is the upper limit

int AiboCam::GetCdtChannels  )  const [inline]
 

Returns the number of CDT Channels in CdtVectorData

Returns:
Number of channels the CdtVectorData. 8 is the upper limit

void AiboCam::SetCdtVectorDataOfPinkBall const int  channel = 0  ) 
 

Method sets the first channel of the segmentation unit (CDT = color detection table) to the color of the pink ball.
You have to use SetCdtChannels(const int numChannels) to enable tracking.

Parameters:
channel CDT-Channel to which th pink ball data is set
See also:
SetCdtChannels(const int numChannels)

void AiboCam::SetCdtVectorDataOfPinkBallSpecial const int  channel = 0  ) 
 

void AiboCam::SetCdtTable const int  channel,
const CdtData  table[32]
 

Initializes and sets the Cdt for a given channel. You have to use SetCdtChannels(const int numChannels) to enable tracking.

Parameters:
channel Channel for which the table is set
table The Cdt
See also:
SetCdtChannels(const int numChannels)

int AiboCam::GetColorFrequency OFbkImageVectorData *  imageVec,
const int  channel = 0
 

Returns the color frequency (pixel number/16), which was detected with the CDT of the given channel
WARING: If you want to use more than on CDT it would be faster to use OFbkImage GetCdtImage(OFbkImageVectorData* imageVec) and get the color freq with the OPEN-R ColorFrequency() method

Parameters:
imageVec the actual image vector
channel the CDT channel
Returns:
Color Frequency

Here is the call graph for this function:

int AiboCam::GetColorFrequency OFbkImageVectorData *  imageVec,
const OCdtChannel  channel = ocdtCHANNEL0
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Here is the call graph for this function:

bool AiboCam::GetCenter OFbkImageVectorData *  imageVec,
int  cdtChannel,
int &  xCenter,
int &  yCenter
 

Gives the center of an region tracked with a CDT.

Parameters:
imageVec The image vector
cdtChannel Channel of CDT of which the region center should be returned
xCenter The x-center of the region
yCenter The y-center of the region
Returns:
True if any pixel of CDT color found in image False otherwise

Here is the call graph for this function:

bool AiboCam::GetCenter OFbkImageVectorData *  imageVec,
int  cdtChannel,
int *  xCenter,
int *  yCenter
 

Gives the center of an region tracked with a CDT.

Parameters:
imageVec The image vector
cdtChannel Channel of CDT of which the region center should be returned
xCenter The x-center of the region
yCenter The y-center of the region
Returns:
True if any pixel of CDT color found in image False otherwise

Here is the call graph for this function:

bool AiboCam::GetCenter const OFbkImage &  cdtImage,
const int  cdtChannel,
int *  xCenter,
int *  yCenter
 

Gives the center of an region tracked with a CDT.

Parameters:
cdtImage The cdt-image vector
cdtChannel Channel of CDT of which the region center should be returned
xCenter The x-center of the region
yCenter The y-center of the region
Returns:
True if any pixel of CDT color found in image False otherwise

Here is the call graph for this function:

bool AiboCam::GetCenter const OFbkImage &  cdtImage,
const OCdtChannel &  cdtChannel,
int *  xCenter,
int *  yCenter
 

Gives the center of an region tracked with a CDT.

Parameters:
cdtImage The cdt-image vector
cdtChannel Channel of CDT of which the region center should be returned
xCenter The x-center of the region
yCenter The y-center of the region
Returns:
True if any pixel of CDT color found in image False otherwise

void AiboCam::saveCDT char *  fileName,
CdtData  cdt[32]
const
 

Writes the data of the cdt as a file on the memorystick of the aibo in fileName

Parameters:
fileName File name of cdt
cdt cdt to save

CdtData * AiboCam::loadCDT char *  fileName  ) 
 

Loads a CDT form memorystick

Parameters:
fileName File name of CDT to load
Returns:
CdtData

void AiboCam::SetWhiteBalance WHITE_BALANCE  balance  ) 
 

Sets the white balance of the camera

Parameters:
balance The desired white balance mode
See also:
WHITE_BALANCE

void AiboCam::SetShutterSpeed SHUTTER_SPEED  speed  ) 
 

Sets the shutter speed of the camera

Parameters:
speed The desired speed mode
See also:
SHUTTER_SPEED

void AiboCam::SetGain CAM_GAIN  gain  ) 
 

Sets the gain of the camera

Parameters:
gain The desired gain mode
See also:
CAM_GAIN

void AiboCam::SaveRawData char *  path,
OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
const
 

Method to save the raw image data on memorystick

Parameters:
path Path and filename where the image should be saved on memstick
imageVec Vector containing image data
layer Image layer which will be saved

void AiboCam::SaveBMP char *  path,
OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
const
 

Writes the image in the given format on memstick

Parameters:
path Path an filename for the image
imageVec Vector containing image data
layer ImageLayer that will be saved

Here is the call graph for this function:

void AiboCam::SaveCdtBMP char *  basepath,
OFbkImageVectorData *  imageVec
const
 

Writes all of the valid cdt images on memstick

Parameters:
basepath Basepath an filename for the image
imageVec Vector containing image data

Here is the call graph for this function:

OFbkImage AiboCam::GetYImage OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
 

Returns the YImage of the give layer

Parameters:
imageVec Vector containing image data
layer Parameter for desired quality of output
Returns:
OFbkImage in quality of layer

OFbkImage AiboCam::GetCbImage OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
 

Returns the CbImage of the give layer

Parameters:
imageVec Vector containing image data
layer Parameter for desired quality of output
Returns:
OFbkImage in quality of layer

OFbkImage AiboCam::GetCrImage OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
 

Returns the CrImage of the give layer

Parameters:
imageVec Vector containing image data
layer Parameter for desired quality of output
Returns:
OFbkImage in quality of layer

OFbkImage AiboCam::GetCdtImage OFbkImageVectorData *  imageVec  ) 
 

Returns the CDTImage (all in one)

Parameters:
imageVec Vector containing image data
Returns:
OFbkImage CDT

int AiboCam::GetImageWidth OFbkImage *  image  )  const [inline]
 

Returns width of an image.

Parameters:
image Input image
Returns:
width of image

int AiboCam::GetImageHeight OFbkImage *  image  )  const [inline]
 

Returns height of Image.

Parameters:
image Input image
Returns:
Height of image

byte * AiboCam::GetImageData OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
 

gives a pointer to the raw image data

Parameters:
imageVec Vector containing image data
layer Parameter for desired quality of output
Returns:
Pointer to image data (all color channels in one byte array)

void AiboCam::GetYCrCbData byte *  ycrcbImage,
OFbkImageVectorData *  imageVec,
const OFbkImageLayer  layer
const
 

copies the ycrcb image data from a raw into a ycrcb image

Parameters:
ycrcbImage The reult ycrcb image
imageVec Vector containing image data
layer Parameter for desired quality of output
Warning:
due to the fact the the raw image does not only contain image data but additional information some pixel of the resulting ycrcb image might be disturbed !!

Here is the call graph for this function:

byte * AiboCam::GetImageData OFbkImage *  image  )  [inline]
 

copies the ycrcb image data from a raw into a ycrcb imageReturns a byte pointer to the raw image data

Parameters:
image Input image
Returns:
Pointer to image data

byte * AiboCam::GetImageData const OFbkImage &  image  )  [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void AiboCam::RAW2 byte *  outImage,
byte *  rawImage,
const int  width,
const int  height,
const LAYER  l
const [inline]
 

Functions converts an raw image in the format you want to.
The Raw Image data of the Aibo has a format like :.

rawimage.jpg

The rawimage layout

where the GradX and GradY is a Sobel image and mag is the magnitude.

Parameters:
outImage The output Image. It has to be big enough that the lyer fits in
rawImage the raw input image
width Image width
height Image height
l The image Layer you want to get
Warning:
if you want to get on of the y, cr, cb lyers you might want to use the ofkimage functions for this purpose. because these channels contain some additional data which is not filtered by this function.

void AiboCam::YCrCb2RGB byte  y,
byte  cr,
byte  cb,
byte *  r,
byte *  g,
byte *  b
const [inline, protected]
 

converts a ycrcb tripel into rgb triple

void AiboCam::YCrCb2RGB byte *  rgbImage,
byte *  ycrcbImage,
const int  width,
const int  height
const [inline, protected]
 

Functions converts an YCrCb (888) image in a RGB (888) image.

Parameters:
rgbImage the rgb out put image. It has to be big enough that the image fits in
ycrcbImage the ycrcb input image
width Image width
height Image height

Here is the call graph for this function:

void AiboCam::RAW2RGB byte *  rgbImage,
byte *  rawImage,
const int  width,
const int  height
const [inline, protected]
 

Functions converts an raw image in a RGB (888) image.

Parameters:
rgbImage the rgb output image . It has to be big enough that the image fits in
rawImage the raw input image
width Image width
height Image height
Warning:
due to the fact the the raw image does not only contain image data but additional information some pixel of the resultig rgb image might be disturbed !!

The function is only valid for raw images of type odataFBK_YCrCb_HPF (see openr doc for details) !!

Do not use on aibo if you can do the ycrcb2rgb conversion on pc!!

Here is the call graph for this function:

void AiboCam::RAW2YCrCb byte *  ycrcbImage,
byte *  rawImage,
const int  width,
const int  height
const [inline, protected]
 

Functions converts an raw image in a YCrCB(888) image.

Parameters:
ycrcbImage the ycrcb output image. It has to be big enough that the image fits in
rawImage the raw input image
width Image width
height Image height
Warning:
due to the fact the the raw image does not only contain image data but additional information some pixel of the resultig rgb image might be disturbed !!

The function is only valid for raw images of type odataFBK_YCrCb_HPF (see openr doc for details) !!


Field Documentation

OPrimitiveID AiboCam::FbkID [protected]
 

Primitive ID of the camera

OCdtVectorData* AiboCam::CdtVector [protected]
 

OCdtVector for the camera

MemoryRegionID AiboCam::CdtVectorID [protected]
 

ID for CdtVector


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

tams Tim Baier AiboLib v0.2.4
Generated Thu Jan 19 11:55:07 2006 by doxygen 1.4.3