Classes | Static Public Member Functions

ImageUtility Class Reference

#include <ImageUtility.h>

List of all members.

Classes

struct  SETVALUE

Static Public Member Functions

static float myMean (IplImage *img, double n)
static float mySD (IplImage *img, double n, float mean)
static void showImage (const char *name, IplImage *img)
static void showCircles (const char *name, IplImage *img, const char *eyeFileName, CvPoint xyPupil, int rPupil, CvPoint xyIris, int rIris, int *ellipseVal, double *angleVal)
static void drawCross (IplImage *eyeImg, int centerx, int centery, int xCrossLength, int yCrossLength, CvScalar color)
static IplImage * convertToGray (IplImage *img)
static Masek::IMAGE * convertIplToImage (IplImage *iplImg)
static IplImage * convertImageToIpl (Masek::IMAGE *image)
static char * SaveEyeImages (IplImage *img, char *fileName, const char *ch)
static void SaveImageOptions (IplImage *img, char *fileName, int frame, const char *str, int num, int totalFrame)
static IplImage * extractImagePart (IplImage *img, CvRect &rect, int x, int y, int wd, int ht)
static IplImage * getROIImage (IplImage *eyeImg, int startX, int endX, int startY, int endY)
static Masek::IMAGE * getROIImage_C (Masek::IMAGE *eyeImg, int startX, int endX, int startY, int endY)
static SETVALUE setImage (IplImage *eyeImg, CvPoint center, int cr, int xLimit, int yLimit)
static void myRect (IplImage *img, int x, int y, int radius, int *destVal)
static void myXYRect (IplImage *img, int x, int y, int width, int height, int *destVal)
static void myRect_C (Masek::IMAGE *lidImg, int x, int y, int radius, int *destVal)
static int getValue (int value, int maxSize)

Detailed Description

Image processing utility class.


Member Function Documentation

IplImage * ImageUtility::convertImageToIpl ( Masek::IMAGE *  image ) [static]

Converts an IMAGE to an IplImage

Note:
The returned image needs to be deallocated
Parameters:
imageInput IMAGE type image
Returns:
Ipl type image
See also:
convertIplToImage
Masek::IMAGE * ImageUtility::convertIplToImage ( IplImage *  iplImg ) [static]

Converts an IplImage to an IMAGE.

Note:
The returned image needs to be deallocated
Parameters:
iplImgInput ipl type image
Returns:
IMAGE type image
See also:
convertImageToIpl
IplImage * ImageUtility::convertToGray ( IplImage *  img ) [static]

Converts a color image to a gray-scale image.

Note:
The returned image needs to be deallocated
Parameters:
imgInput image
Returns:
Created gray-scale image
void ImageUtility::drawCross ( IplImage *  eyeImg,
int  centerx,
int  centery,
int  xCrossLength,
int  yCrossLength,
CvScalar  color 
) [static]

Displays an image overlaid with a cross.

Parameters:
eyeImgInput image
centerxCenter X
centeryCenter Y
xCrossLengthCross' length of X
yCrossLengthCross' length of Y
colorCross' color
IplImage * ImageUtility::extractImagePart ( IplImage *  img,
CvRect &  rect,
int  x,
int  y,
int  wd,
int  ht 
) [static]

Extracts a rectangular part out of an image.

Note:
The returned image needs to be deallocated
Parameters:
imginput image.
rectRectangle info
xStarting x
yStarting y
Wdwidth
Htheight
Returns:
Extracted image.
IplImage * ImageUtility::getROIImage ( IplImage *  eyeImg,
int  startX,
int  endX,
int  startY,
int  endY 
) [static]

Return the ROI of an image as IplImage.

Parameters:
eyeImgInput image.
startXX starting point
endXX end point
startYY starting point
endXX end point
Returns:
Returns Ipl image of ROI
See also:
getROIImage_C
Masek::IMAGE * ImageUtility::getROIImage_C ( Masek::IMAGE *  eyeImg,
int  startX,
int  endX,
int  startY,
int  endY 
) [static]

Returns an ROI of an image as IMAGE.

Parameters:
eyeImgInput image.
startXX starting point
endXX end point
startYY starting point
endYY end point
Returns:
Returns IMAGE type image of ROI
See also:
getROIImage
int ImageUtility::getValue ( int  value,
int  maxSize 
) [static]

Debug values.

Parameters:
valueActual value.
maxSizeMax width or height
Returns:
Proper value
float ImageUtility::myMean ( IplImage *  img,
double  n 
) [static]

Calculates the mean of an image.

Parameters:
imgInput image
nTotal number of pixels
Returns:
Mean value
void ImageUtility::myRect ( IplImage *  img,
int  x,
int  y,
int  radius,
int *  destVal 
) [static]

Calculate the square rectangular info.

Parameters:
imgInput image.
xInput x
yInput y
radiusInput radius
destValUsed to return the rect info (0:left, 1:right, 2:bottom, 3:top)
void ImageUtility::myRect_C ( Masek::IMAGE *  lidImg,
int  x,
int  y,
int  radius,
int *  destVal 
) [static]

Calculate the square rectangular info of an IMAGE type image.

Parameters:
imgInput image.
xInput x
yInput y
radiusInput radius
destValUsed to return the rect info (0:left, 1:right, 2:bottom, 3:top)
float ImageUtility::mySD ( IplImage *  img,
double  n,
float  mean 
) [static]

Calculates the standard deviation of an image.

Parameters:
imgInput image
nTotal number of pixels
meanPreviously calculated mean value
Returns:
Standard deviation value
See also:
myMean
void ImageUtility::myXYRect ( IplImage *  img,
int  x,
int  y,
int  width,
int  height,
int *  destVal 
) [static]

Calculates the rectangular info with different X and Y radius.

Parameters:
imgInput image.
xInput x
yInput y
widthInput X radius
heightInput Y radius
destValUsed to return the rect info (0:left, 1:right, 2:bottom, 3:top)
char * ImageUtility::SaveEyeImages ( IplImage *  img,
char *  fileName,
const char *  ch 
) [static]

Saves an IplImage as BMP file.

Resulting filename: "<fileName>_<ch>.bmp"

Parameters:
imgInput image
fileNameFilename of the input image
chAppend the following prefix to the output filename
Returns:
Name of the created file
See also:
SaveImageOptions
void ImageUtility::SaveImageOptions ( IplImage *  img,
char *  fileName,
int  frame,
const char *  str,
int  num,
int  totalFrame 
) [static]

Saves an IplImage along with the position and sequence info encoded in the output filename.

Resulting filename: "<fileName>_F<frame>_<str><num>"

Parameters:
imgInput image
fileNameFilename of the input image
frameFrame sequence
str"L" (left) or "R" (right) position
numDetected eye image sequence
See also:
SaveEyeImages
ImageUtility::SETVALUE ImageUtility::setImage ( IplImage *  eyeImg,
CvPoint  center,
int  cr,
int  xLimit,
int  yLimit 
) [static]

Calculates the rectangular info and center point.

Parameters:
eyeImgInput image.
centerInput center point Rectangle info
crInput radius
xLimitMax. distance of X from the center
yLimitMax. distance of Y from the center
Returns:
Rect info and center point See also SETVALUE
void ImageUtility::showCircles ( const char *  name,
IplImage *  img,
const char *  eyeFileName,
CvPoint  xyPupil,
int  rPupil,
CvPoint  xyIris,
int  rIris,
int *  ellipseVal,
double *  angleVal 
) [static]

Displays an image overlaid with circles and ellipses.

Note:
The image is modified in the process!
Parameters:
nameWindow name (= caption)
imgInput image
eyeFileNameIf you would like to save the image, specify a filename
xyPupilPupil's center point
rPupilPupil's radius
xyIrisIris' center point
rIrisIris' radius
ellipseValUsed to return the ellipse info
angleValUsed to return the orientation
void ImageUtility::showImage ( const char *  name,
IplImage *  img 
) [static]

Displays an image and waits for a keypress.

Note:
Uses OpenCV to display the image
Parameters:
nameWindow name (= caption)
imgInput image

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Defines