#include <ImageUtility.h>
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) |
Image processing utility class.
IplImage * ImageUtility::convertImageToIpl | ( | Masek::IMAGE * | image ) | [static] |
Converts an IMAGE to an IplImage
image | Input IMAGE type image |
Masek::IMAGE * ImageUtility::convertIplToImage | ( | IplImage * | iplImg ) | [static] |
Converts an IplImage to an IMAGE.
iplImg | Input ipl type image |
IplImage * ImageUtility::convertToGray | ( | IplImage * | img ) | [static] |
Converts a color image to a gray-scale image.
img | Input image |
void ImageUtility::drawCross | ( | IplImage * | eyeImg, |
int | centerx, | ||
int | centery, | ||
int | xCrossLength, | ||
int | yCrossLength, | ||
CvScalar | color | ||
) | [static] |
Displays an image overlaid with a cross.
eyeImg | Input image |
centerx | Center X |
centery | Center Y |
xCrossLength | Cross' length of X |
yCrossLength | Cross' length of Y |
color | Cross' 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.
img | input image. |
rect | Rectangle info |
x | Starting x |
y | Starting y |
Wd | width |
Ht | height |
IplImage * ImageUtility::getROIImage | ( | IplImage * | eyeImg, |
int | startX, | ||
int | endX, | ||
int | startY, | ||
int | endY | ||
) | [static] |
Return the ROI of an image as IplImage.
eyeImg | Input image. |
startX | X starting point |
endX | X end point |
startY | Y starting point |
endX | X end point |
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.
eyeImg | Input image. |
startX | X starting point |
endX | X end point |
startY | Y starting point |
endY | Y end point |
int ImageUtility::getValue | ( | int | value, |
int | maxSize | ||
) | [static] |
Debug values.
value | Actual value. |
maxSize | Max width or height |
float ImageUtility::myMean | ( | IplImage * | img, |
double | n | ||
) | [static] |
Calculates the mean of an image.
img | Input image |
n | Total number of pixels |
void ImageUtility::myRect | ( | IplImage * | img, |
int | x, | ||
int | y, | ||
int | radius, | ||
int * | destVal | ||
) | [static] |
Calculate the square rectangular info.
img | Input image. |
x | Input x |
y | Input y |
radius | Input radius |
destVal | Used 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.
img | Input image. |
x | Input x |
y | Input y |
radius | Input radius |
destVal | Used 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.
img | Input image |
n | Total number of pixels |
mean | Previously calculated mean value |
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.
img | Input image. |
x | Input x |
y | Input y |
width | Input X radius |
height | Input Y radius |
destVal | Used 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"
img | Input image |
fileName | Filename of the input image |
ch | Append the following prefix to the output filename |
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>"
img | Input image |
fileName | Filename of the input image |
frame | Frame sequence |
str | "L" (left) or "R" (right) position |
num | Detected eye image sequence |
ImageUtility::SETVALUE ImageUtility::setImage | ( | IplImage * | eyeImg, |
CvPoint | center, | ||
int | cr, | ||
int | xLimit, | ||
int | yLimit | ||
) | [static] |
Calculates the rectangular info and center point.
eyeImg | Input image. |
center | Input center point Rectangle info |
cr | Input radius |
xLimit | Max. distance of X from the center |
yLimit | Max. distance of Y from the center |
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.
name | Window name (= caption) |
img | Input image |
eyeFileName | If you would like to save the image, specify a filename |
xyPupil | Pupil's center point |
rPupil | Pupil's radius |
xyIris | Iris' center point |
rIris | Iris' radius |
ellipseVal | Used to return the ellipse info |
angleVal | Used to return the orientation |
void ImageUtility::showImage | ( | const char * | name, |
IplImage * | img | ||
) | [static] |
Displays an image and waits for a keypress.
name | Window name (= caption) |
img | Input image |