The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

eyefinder/windows/FilterSrc/helperfunctions.h File Reference

#include <windows.h>
#include "mpisearchFaceDetector.h"

Include dependency graph for eyefinder/windows/FilterSrc/helperfunctions.h:

Include dependency graph

Go to the source code of this file.

Defines

#define MPIBlueDecay(x)
#define MPIRedDecay(x)
#define MPIWhiteDecay(x)

Functions

void DrawBoxes (RGBTRIPLE *prgb, FaceBoxList &faces, int failedCycles, int cxImage, int cyImage)
void GreyScaleFlipVideo (int width, int height, int np, RGBTRIPLE *rgbpix, RImage< float > &pixels)
void SetRGBBlue (int x, int y, int cxImage, int cyImage, int failedCycles, RGBTRIPLE *prgb)
void SetRGBRed (int x, int y, int cxImage, int cyImage, int failedCycles, RGBTRIPLE *prgb)
void SetRGBWhite (int x, int y, int cxImage, int cyImage, int failedCycles, RGBTRIPLE *prgb)


Define Documentation

#define MPIBlueDecay  ) 
 

Value:

(x)->rgbtRed = (unsigned char) ceil((x)->rgbtRed - ((x)->rgbtRed - 0)*Decay);           \
  (x)->rgbtBlue = (unsigned char) floor((255 - (x)->rgbtBlue)*Decay + (x)->rgbtBlue);       \
  (x)->rgbtGreen = (unsigned char) ceil((x)->rgbtGreen - ((x)->rgbtGreen - 0)*Decay);

#define MPIRedDecay  ) 
 

Value:

(x)->rgbtRed = (unsigned char) floor((255 - (x)->rgbtRed)*Decay + (x)->rgbtRed);                \
  (x)->rgbtBlue = (unsigned char) ceil((x)->rgbtBlue - ((x)->rgbtBlue - 0)*Decay);          \
  (x)->rgbtGreen = (unsigned char) ceil((x)->rgbtGreen - ((x)->rgbtGreen - 0)*Decay);

#define MPIWhiteDecay  ) 
 

Value:

(x)->rgbtRed = (unsigned char) floor((255 - (x)->rgbtRed)*Decay + (x)->rgbtRed);                \
  (x)->rgbtBlue = (unsigned char) floor((255 - (x)->rgbtBlue)*Decay + (x)->rgbtBlue);       \
  (x)->rgbtGreen = (unsigned char) floor((255 - (x)->rgbtGreen)*Decay + (x)->rgbtGreen);


Function Documentation

void DrawBoxes RGBTRIPLE *  prgb,
FaceBoxList faces,
int  failedCycles,
int  cxImage,
int  cyImage
[inline]
 

Definition at line 64 of file eyefinder/windows/FilterSrc/helperfunctions.h.

References ObjectList::begin(), ObjectList::end(), FaceBoxList, faces, SetRGBBlue(), SetRGBRed(), TSquare::size, Square, TSquare::x, y, and TSquare::y.

00065 {  
00066         int leftX, rightX, topY, bottomY, x, y;
00067         bool firstface = true;
00068         for (list<Square>::iterator it = faces.begin(); it != faces.end(); it++) {
00069                 Square &curface = *it;
00070                 if (curface.size > 0) {
00071                         leftX = curface.x;
00072                         rightX = leftX + curface.size;
00073                         topY = curface.y;
00074                         bottomY = topY + curface.size - 1;
00075 
00076                         for(x = leftX; x <= rightX; ++x){
00077                                 if (firstface) {
00078                                         SetRGBRed(x, topY, cxImage, cyImage, failedCycles, prgb);
00079                                         SetRGBRed(x, bottomY, cxImage, cyImage, failedCycles, prgb);
00080                                 } else {
00081                                         SetRGBBlue(x, topY, cxImage, cyImage, failedCycles, prgb);
00082                                         SetRGBBlue(x, bottomY, cxImage, cyImage, failedCycles, prgb);
00083                                 }
00084                         }
00085                         for(y = topY; y < bottomY; ++y){
00086                                 if (firstface) {
00087                                         SetRGBRed(leftX, y, cxImage, cyImage, failedCycles, prgb);
00088                                         SetRGBRed(rightX, y, cxImage, cyImage, failedCycles, prgb);
00089                                 } else {
00090                                         SetRGBBlue(leftX, y, cxImage, cyImage, failedCycles, prgb);
00091                                         SetRGBBlue(rightX, y, cxImage, cyImage, failedCycles, prgb);
00092                                 }
00093                         }
00094                         firstface = false;
00095                 }
00096         }
00097 }

Here is the call graph for this function:

void GreyScaleFlipVideo int  width,
int  height,
int  np,
RGBTRIPLE *  rgbpix,
RImage< float > &  pixels
[inline]
 

Definition at line 7 of file eyefinder/windows/FilterSrc/helperfunctions.h.

References RImage::array, RGBTRIPLE, and y.

00008 {
00009         RGBTRIPLE *source;
00010         unsigned char *sp;
00011         float *dest;
00012 
00013         // convert image to grayscale and out of directshow coordinates 
00014         for (int y=0; y < height; y++) {
00015                 source = rgbpix + (np - (y+1) * width);
00016                 sp = (unsigned char *) source;
00017                 dest = pixels.array + width*y;
00018                 for (int x = 0; x < width; x++) {
00019                         *dest++ = (float)(sp[2] + sp[1]*6 + sp[0]*3);
00020                         sp += 3;
00021                 }
00022         }
00023 
00024 } 

void SetRGBBlue int  x,
int  y,
int  cxImage,
int  cyImage,
int  failedCycles,
RGBTRIPLE *  prgb
[inline]
 

Definition at line 40 of file eyefinder/windows/FilterSrc/helperfunctions.h.

References MPIBlueDecay, and y.

00040                                                                                                  {
00041         float Decay = (10 - failedCycles)*.1;
00042 #define MPIBlueDecay(x)                                         \
00043   (x)->rgbtRed = (unsigned char) ceil((x)->rgbtRed - ((x)->rgbtRed - 0)*Decay);         \
00044   (x)->rgbtBlue = (unsigned char) floor((255 - (x)->rgbtBlue)*Decay + (x)->rgbtBlue);       \
00045   (x)->rgbtGreen = (unsigned char) ceil((x)->rgbtGreen - ((x)->rgbtGreen - 0)*Decay);
00046 
00047         MPIBlueDecay( prgb + (x + cxImage*((cyImage-1) - y)));
00048 }

void SetRGBRed int  x,
int  y,
int  cxImage,
int  cyImage,
int  failedCycles,
RGBTRIPLE *  prgb
[inline]
 

Definition at line 28 of file eyefinder/windows/FilterSrc/helperfunctions.h.

References MPIRedDecay, and y.

00028                                                                                                 {
00029         float Decay = (10 - failedCycles)*.1;
00030 #define MPIRedDecay(x)                                          \
00031   (x)->rgbtRed = (unsigned char) floor((255 - (x)->rgbtRed)*Decay + (x)->rgbtRed);              \
00032   (x)->rgbtBlue = (unsigned char) ceil((x)->rgbtBlue - ((x)->rgbtBlue - 0)*Decay);          \
00033   (x)->rgbtGreen = (unsigned char) ceil((x)->rgbtGreen - ((x)->rgbtGreen - 0)*Decay);
00034 
00035         MPIRedDecay( prgb + (x + cxImage*((cyImage-1) - y)));
00036 }

void SetRGBWhite int  x,
int  y,
int  cxImage,
int  cyImage,
int  failedCycles,
RGBTRIPLE *  prgb
[inline]
 

Definition at line 52 of file eyefinder/windows/FilterSrc/helperfunctions.h.

References MPIWhiteDecay, and y.

00052                                                                                                   {
00053         float Decay = (10 - failedCycles)*.1;
00054 #define MPIWhiteDecay(x)                                                \
00055   (x)->rgbtRed = (unsigned char) floor((255 - (x)->rgbtRed)*Decay + (x)->rgbtRed);              \
00056   (x)->rgbtBlue = (unsigned char) floor((255 - (x)->rgbtBlue)*Decay + (x)->rgbtBlue);       \
00057   (x)->rgbtGreen = (unsigned char) floor((255 - (x)->rgbtGreen)*Decay + (x)->rgbtGreen);
00058 
00059         MPIWhiteDecay( prgb + (x + cxImage*((cyImage-1) - y)));
00060 }


Generated on Mon Nov 8 17:08:01 2004 for MPT by  doxygen 1.3.9.1