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

MPISearchThread Class Reference

#include <mpisearchthread.h>

Collaboration diagram for MPISearchThread:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void GetColorModel (MPHistogram< float, NUMBINS > *, MPHistogram< float, NUMBINS > *, int *, double *llike)
double getElapsedTime ()
long getLastFrame () const
int GetMPIFaceBoxes (FaceBoxList &faceBoxes)
int GetNumFaces ()
TIMETYPE getTimeStamp () const
RGBTRIPLE MPIBoxPixel (RGBTRIPLE x, double fadeAmount) const
 MPISearchThread ()
void PutData (RGBTRIPLE *, int, int, int, int, int, long)
void Start ()
 ~MPISearchThread ()

Static Public Member Functions

THREAD_RETURN_TYPE StartThreadedTracker (void *)

Public Attributes

MPColorTools m_Color

Private Member Functions

void CompareColorMPIMeans (Square box)
TIMETYPE getCurTime ()
void GetHueMinMax (int, int, int, double &, int &, int &)
void InitColorModel ()
void Process ()
void Search (int, FaceBoxList &faces)
void Search (FFImage< float > &pixels, FaceBoxList &faces)
void setShift ()
void shiftFaces (FaceBoxList &faces)
void UpdateColorModel (FaceBoxList &faces)
void UpdateProbabilities ()
void UpdateTimeMPISearchBoxes (TIMETYPE t)

Private Attributes

int m_bBoxX1
int m_bBoxX2
int m_bBoxY1
int m_bBoxY2
MPColorTools m_color
double m_ColorMeanX
double m_ColorMeanY
long m_curFrame
MPHistogram< float, NUMBINS > m_CurrentProbColorGivenBack
MPHistogram< float, NUMBINS > m_CurrentProbColorGivenFace
MUTEX_TYPE m_DataMutex
MPISearchFaceDetector m_Detector
MUTEX_TYPE m_FaceMutex
THREAD_COND m_GotBufferFillRequest
int m_Height
double m_HighV
MUTEX_TYPE m_ImageMutex
long m_lastFrame
int m_lastHeight
int m_lastWidth
double m_llikePix
MPHistogram< float, NUMBINS > m_LogProbColorGivenBack
MPHistogram< float, NUMBINS > m_LogProbColorGivenFace
double m_LowV
FaceBoxList m_MPIBoxes
double m_MPIMeanX
double m_MPIMeanY
RGBTRIPLE * m_MyPixels
int m_NumFaces
int m_NumPixels
MPHistogram< float, NUMBINS > m_ProbColorGivenBack
MPHistogram< float, NUMBINS > m_ProbColorGivenFace
int m_ResetTracker
int m_shiftAmount
THREAD_TYPE m_ThreadHandle
bool m_ThreadRunning
TIMETYPE m_TimeMPISearchBoxes
int m_Width
double mutex_llikePix
int mutex_ResetTracker

Friends

void StartThreadedTracker (void *)

Constructor & Destructor Documentation

MPISearchThread  ) 
 

Definition at line 54 of file mpisearchthread.cpp.

References CreateMutex(), CreateMutexEvent(), m_ColorMeanX, m_ColorMeanY, m_DataMutex, m_Detector, m_FaceMutex, m_GotBufferFillRequest, m_ImageMutex, m_lastHeight, m_lastWidth, m_llikePix, m_MPIMeanX, m_MPIMeanY, m_MyPixels, m_NumFaces, m_NumPixels, m_ResetTracker, m_shiftAmount, and MPISearchObjectDetector::setPixelMax().

00055 {
00056         //      ASSERT( (m_Detector.DataLoaded()) );
00057         m_MyPixels = 0;
00058         m_NumPixels = m_NumFaces = m_lastWidth = m_lastHeight = 0;
00059         m_ColorMeanX = m_ColorMeanY = m_MPIMeanX = m_MPIMeanY = 0.0;
00060         m_ResetTracker = 0;
00061         m_llikePix = 0;
00062         m_shiftAmount = 1;
00063         //sets max pixel value based on max pixel possibility of FFImage<float>
00064         m_Detector.setPixelMax(2560);
00065 
00066         CreateMutex (m_DataMutex);
00067         CreateMutex (m_FaceMutex);
00068         CreateMutex (m_ImageMutex);
00069         CreateMutexEvent(m_GotBufferFillRequest);
00070         
00071 }

Here is the call graph for this function:

~MPISearchThread  ) 
 

Definition at line 487 of file mpisearchthread.cpp.

References m_ThreadRunning.

00488 {
00489         m_ThreadRunning = FALSE;
00490         if (m_MyPixels) delete [] m_MyPixels;
00491 
00492 }


Member Function Documentation

void CompareColorMPIMeans Square  box  )  [private]
 

Definition at line 343 of file mpisearchthread.cpp.

References m_ColorMeanX, m_ColorMeanY, m_Height, m_MPIMeanX, m_MPIMeanY, m_ResetTracker, TSquare::size, Square, TSquare::x, and TSquare::y.

00344 {
00345         m_MPIMeanX = box.x + box.size/2;
00346         m_MPIMeanY = m_Height - box.y - box.size/2;
00347         double widthBtwn = abs(double(m_ColorMeanX - m_MPIMeanX));
00348         double heightBtwn = abs(double(m_ColorMeanY - m_MPIMeanY));
00349         double distanceBtwn = sqrt(double(widthBtwn*widthBtwn + heightBtwn*heightBtwn));
00350         if (static_cast<int>(distanceBtwn) > box.size)
00351                 m_ResetTracker = 1;
00352 }

void GetColorModel MPHistogram< float, NUMBINS > *  ,
MPHistogram< float, NUMBINS > *  ,
int *  ,
double *  llike
 

Definition at line 78 of file mpisearchthread.cpp.

References MUTEX_LOCK_RETURN_TYPE, ReleaseMutex(), TryLockMutex(), and WAIT_OBJECT_0.

Referenced by MPColorTracker::MPColorTracker(), and MPColorTracker::MPIUpdate().

00080 {
00081 
00082         MUTEX_LOCK_RETURN_TYPE waitResult = TryLockMutex(m_DataMutex);
00083 
00084         switch( waitResult ) {
00085         case WAIT_OBJECT_0:  
00086 
00087                 *lpf = m_LogProbColorGivenFace;
00088                 *lpb = m_LogProbColorGivenBack;         
00089                 *reset = m_ResetTracker;
00090                 //m_ResetTracker = 0;
00091                 *llike = m_llikePix;
00092                 ReleaseMutex(m_DataMutex);
00093                 break;
00094         default:
00095                 break;
00096         }
00097 }

Here is the call graph for this function:

TIMETYPE getCurTime  )  [private]
 

Definition at line 407 of file mpisearchthread.cpp.

References TIMETYPE.

Referenced by Process().

00407                                     {
00408 
00409         TIMETYPE curTime;
00410 #ifdef WIN32
00411         curTime = timeGetTime();
00412 #else
00413         gettimeofday( &curTime, NULL );
00414 #endif
00415         return curTime;
00416 }

double getElapsedTime  ) 
 

Definition at line 434 of file mpisearchthread.cpp.

References difftv(), m_TimeMPISearchBoxes, and TIMETYPE.

Referenced by MPColorTracker::GetElapsedTime().

00434                                       {
00435 
00436         double elapsedTime;
00437 #ifdef WIN32
00438         elapsedTime = timeGetTime()-m_TimeMPISearchBoxes;
00439 #else
00440         TIMETYPE curTime;
00441         gettimeofday( &curTime, NULL );
00442         elapsedTime = difftv(curTime, m_TimeMPISearchBoxes) * 1000.0;
00443 #endif
00444         return elapsedTime;
00445 }

Here is the call graph for this function:

void GetHueMinMax int  ,
int  ,
int  ,
double &  ,
int &  ,
int & 
[private]
 

Definition at line 366 of file mpisearchthread.cpp.

00366                                                                                        {
00367 /*      float delta;
00368         if (r >= g) {max = r; min = g;}
00369         else {max = g; min = r;}
00370         if (b > max) max = b;
00371         else if (b < min) min = b;
00372         delta = (float)(max - min);
00373         if (max == r) h = (g-b)/delta;
00374         else if (max == g) h = 2 + (b-r)/delta;
00375         else h = 4 + (r-g)/delta;
00376         h = (h < 0) ? (float)(h*60.0 + 360.0) : (float)(h*60.0);*/
00377 }

long getLastFrame  )  const [inline]
 

Definition at line 131 of file mpisearchthread.h.

Referenced by MPColorTracker::GetMissedFrames().

00131 { return m_lastFrame; }

int GetMPIFaceBoxes FaceBoxList faceBoxes  ) 
 

Definition at line 388 of file mpisearchthread.cpp.

References FaceBoxList, m_FaceMutex, MUTEX_LOCK_RETURN_TYPE, ReleaseMutex(), TryLockMutex(), WAIT_ABANDONED, WAIT_FAILED, WAIT_OBJECT_0, and WAIT_TIMEOUT.

Referenced by MPColorTracker::GetLastFaces().

00389 {
00390         MUTEX_LOCK_RETURN_TYPE waitResult = TryLockMutex(m_FaceMutex);
00391         switch( waitResult ) {
00392         case WAIT_OBJECT_0:  
00393                 boxes = m_MPIBoxes;
00394                 ReleaseMutex(m_FaceMutex);
00395                 break;
00396         case WAIT_TIMEOUT: 
00397         case WAIT_ABANDONED:
00398         case WAIT_FAILED:
00399         default:
00400                 break;
00401         }
00402         return 1;
00403 }

Here is the call graph for this function:

int GetNumFaces  ) 
 

Definition at line 469 of file mpisearchthread.cpp.

References m_FaceMutex, MUTEX_LOCK_RETURN_TYPE, ReleaseMutex(), TryLockMutex(), and WAIT_OBJECT_0.

Referenced by MPColorTracker::GetLastNumFrontalFaces().

00470 {
00471         int nf = 0; 
00472         MUTEX_LOCK_RETURN_TYPE waitResult = TryLockMutex(m_FaceMutex);
00473         switch( waitResult ) {
00474         case WAIT_OBJECT_0: 
00475 
00476                 nf = m_NumFaces;
00477                 ReleaseMutex(m_FaceMutex);
00478         default:
00479                 break;
00480         }
00481         return nf;
00482 }

Here is the call graph for this function:

TIMETYPE getTimeStamp  )  const [inline]
 

Definition at line 130 of file mpisearchthread.h.

References TIMETYPE.

Referenced by MPColorTracker::GetTimeStamp().

00130 { return m_TimeMPISearchBoxes; }

void InitColorModel  )  [private]
 

Definition at line 203 of file mpisearchthread.cpp.

References MPHistogram::InitColorModel(), m_CurrentProbColorGivenBack, m_CurrentProbColorGivenFace, m_ProbColorGivenBack, m_ProbColorGivenFace, and UpdateProbabilities().

Referenced by Start().

Here is the call graph for this function:

RGBTRIPLE MPIBoxPixel RGBTRIPLE  x,
double  fadeAmount
const [inline]
 

Definition at line 135 of file mpisearchthread.h.

References RGBTRIPLE.

00135                                                                           {     
00136                 x.rgbtGreen = (unsigned char) (fadeAmount*255.0 + (1.0-fadeAmount)*(double) x.rgbtGreen);       
00137                 x.rgbtBlue = (unsigned char) (fadeAmount*255.0 + (1.0-fadeAmount)*(double) x.rgbtBlue);
00138                 x.rgbtRed = (unsigned char) ((1.0-fadeAmount)*(double) x.rgbtRed);
00139                 return x;
00140         }

void Process  )  [private]
 

Definition at line 147 of file mpisearchthread.cpp.

References ObjectList::empty(), FaceBoxList, faces, getCurTime(), IMAGE_FLIPPED, LockMutex(), m_FaceMutex, m_GotBufferFillRequest, m_Height, m_ImageMutex, m_lastFrame, m_MPIBoxes, m_MyPixels, m_NumFaces, m_NumPixels, m_shiftAmount, m_Width, MutexCondWait(), ObjectList::objects, ReleaseMutex(), Search(), setShift(), shiftFaces(), ObjectList::size(), ObjectList::sort(), TIMETYPE, UpdateColorModel(), and UpdateTimeMPISearchBoxes().

00148 {
00149         FaceBoxList faces;
00150         TIMETYPE timeBeginMPISearchSearch; 
00151         
00152         MutexCondWait(m_GotBufferFillRequest, m_ImageMutex); 
00153         if (m_NumPixels) {
00154                 timeBeginMPISearchSearch = getCurTime();
00155                 setShift();
00156                 // Create FFImage wrapper around pixels
00157 #ifdef WIN32 
00158                 //(pthreads)lock is handled in wait condition
00159                 LockMutex(m_ImageMutex);
00160 #endif
00161                 FFImage<RGBTRIPLE> source(m_MyPixels, m_Width, m_Height, IMAGE_FLIPPED);
00162                 // Create New Grayscale version of the FFImage to be used in mpisearch
00163                 FFImage<float> pixels(source, m_shiftAmount);           
00164                 ReleaseMutex(m_ImageMutex);
00165 
00166                 Search(pixels, faces); // do not hold mutex during long process 
00167 
00168                 m_NumFaces=faces.size();
00169 
00170                 if (!faces.empty()) {
00171                         shiftFaces(faces);
00172                         faces.objects.sort();
00173                         faces.objects.reverse();
00174 
00175                         LockMutex(m_FaceMutex);
00176                         m_MPIBoxes = faces;
00177                         m_lastFrame = m_curFrame;
00178                         ReleaseMutex(m_FaceMutex);
00179 
00180                         UpdateTimeMPISearchBoxes(timeBeginMPISearchSearch); // Added by Javier
00181                         UpdateColorModel(faces);
00182                 }
00183                 m_NumPixels=0; // Tells color tracker that processing is done 
00184 
00185         }
00186         //else ReleaseMutex(m_ImageMutex);
00187 }

Here is the call graph for this function:

void PutData RGBTRIPLE *  ,
int  ,
int  ,
int  ,
int  ,
int  ,
long 
 

Definition at line 121 of file mpisearchthread.cpp.

References d, m_ColorMeanX, m_ColorMeanY, m_curFrame, m_GotBufferFillRequest, m_Height, m_ImageMutex, m_MyPixels, m_NumPixels, m_Width, MUTEX_LOCK_RETURN_TYPE, MutexCondSignal(), ReleaseMutex(), RGBTRIPLE, TryLockMutex(), and WAIT_OBJECT_0.

Referenced by MPColorTracker::MPIUpdate().

00122 {
00123 
00124         MUTEX_LOCK_RETURN_TYPE waitResult = TryLockMutex(m_ImageMutex);
00125         switch( waitResult ) {
00126         case WAIT_OBJECT_0: 
00127                 if (!m_NumPixels) {
00128                         m_NumPixels = np;
00129                         if (!m_MyPixels) m_MyPixels = new RGBTRIPLE[m_NumPixels];
00130                         memcpy(m_MyPixels, d, m_NumPixels*sizeof(RGBTRIPLE));
00131                         m_Width = x;
00132                         m_Height = y;
00133                         m_ColorMeanX = colorMeanX;
00134                         m_ColorMeanY = colorMeanY;
00135                         m_curFrame = curFrame;
00136                         MutexCondSignal(m_GotBufferFillRequest);
00137                 }
00138                 ReleaseMutex( m_ImageMutex);
00139                 break;
00140         default:
00141                 break;
00142         }
00143 }

Here is the call graph for this function:

void Search int  ,
FaceBoxList faces
[private]
 

void Search FFImage< float > &  pixels,
FaceBoxList faces
[private]
 

Definition at line 191 of file mpisearchthread.cpp.

References f(), FaceBoxList, faces, RImage::height, m_Detector, m_lastHeight, m_lastWidth, MPISearchObjectDetector::resetStream(), MPISearchObjectDetector::search(), ObjectList::simplify(), and RImage::width.

Referenced by Process().

00192 {
00193         if((pixels.width != m_lastWidth) || (pixels.height != m_lastHeight)){
00194                 m_Detector.resetStream(pixels.width, pixels.height);
00195                 m_lastWidth = pixels.width ; m_lastHeight = pixels.height;
00196         }
00197         m_Detector.search(pixels, faces);
00198         faces.simplify(0.2f);
00199 }

Here is the call graph for this function:

void setShift  )  [private]
 

Definition at line 449 of file mpisearchthread.cpp.

References m_shiftAmount, and m_Width.

Referenced by Process().

00449                                {
00450         m_shiftAmount = static_cast<int>(m_Width/MPI_IMAGE_WIDTH);
00451         if (m_shiftAmount < 1) m_shiftAmount = 1;
00452 }

void shiftFaces FaceBoxList faces  )  [private]
 

Definition at line 456 of file mpisearchthread.cpp.

References ObjectList::begin(), ObjectList::end(), FaceBoxList, faces, m_shiftAmount, and ObjectList::size().

Referenced by Process().

00456                                                     {
00457         if(m_shiftAmount < 1) m_shiftAmount = 1;
00458         list<Square>::iterator it = faces.begin();
00459         while (it != faces.end()) {
00460                 it->size *= m_shiftAmount;
00461                 it->x *= m_shiftAmount;
00462                 it->y *= m_shiftAmount;
00463                 *it++;
00464         }
00465 }

Here is the call graph for this function:

void Start  ) 
 

Definition at line 101 of file mpisearchthread.cpp.

References InitColorModel(), LockMutex(), m_DataMutex, m_ThreadHandle, m_ThreadRunning, ReleaseMutex(), and StartThreadedTracker.

Referenced by MPColorTracker::MPColorTracker().

00102 {
00103         LockMutex( m_DataMutex );
00104         m_ThreadRunning = TRUE;
00105         InitColorModel();
00106         ReleaseMutex( m_DataMutex);
00107 #ifdef WIN32
00108         m_ThreadHandle = (HANDLE) (_beginthread( StartThreadedTracker, 0, this ));
00109 #ifdef SHOWPROBS
00110         SetThreadPriority(m_ThreadHandle, THREAD_PRIORITY_NORMAL);
00111 #else
00112         SetThreadPriority(m_ThreadHandle, THREAD_PRIORITY_NORMAL-1);
00113 #endif // SHOWPROBS
00114 #else
00115         pthread_create(&m_ThreadHandle, NULL, &StartThreadedTracker, (void *)this);
00116 #endif
00117 }

Here is the call graph for this function:

THREAD_RETURN_TYPE StartThreadedTracker void *   )  [static]
 

void UpdateColorModel FaceBoxList faces  )  [private]
 

Definition at line 214 of file mpisearchthread.cpp.

References MPHistogram::addtobin(), ObjectList::begin(), ObjectList::end(), end, MPRectangle::face, FaceBoxList, faces, ObjectList::front(), MPHistogram::get_prob(), FFImage::getPixel(), IMAGE_FLIPPED, MPHistogram::initialize(), LockMutex(), m_CurrentProbColorGivenBack, m_CurrentProbColorGivenFace, m_DataMutex, m_Height, m_llikePix, m_LogProbColorGivenBack, m_LogProbColorGivenFace, m_MyPixels, m_Width, max, min(), ObjectList::push_back(), ReleaseMutex(), RGBTRIPLE, TSquare::size, ObjectList::sort(), Square, UpdateProbabilities(), TSquare::x, MPRectangle::X1, MPRectangle::X2, y, TSquare::y, MPRectangle::Y1, and MPRectangle::Y2.

Referenced by Process().

00215 {
00216         m_CurrentProbColorGivenFace.initialize();
00217         m_CurrentProbColorGivenBack.initialize();
00218 
00219         Square mainface;
00220         mainface = faces.front();
00221         bool isNonFace;
00222 
00223         double shrink = 0.15;
00224         double shrinky = .8;
00225         // We collect stats for the central region of the face box. This central region is 
00226   // n % of the original box but has been modified so that the offset in the y direction is less. 
00227         int offsetx = static_cast<int>(shrink*mainface.size), 
00228                 offsety = (int) (((float) offsetx)*shrinky ),            
00229                 startXMPI, startYMPI, endXMPI, endYMPI,
00230                 startXFace, startYFace, endXFace, endYFace;
00231         
00232         startXMPI = mainface.x;
00233         startYMPI = mainface.y;
00234         endXMPI = startXMPI+mainface.size;
00235         endYMPI = startYMPI+mainface.size;
00236         startXFace      = startXMPI + offsetx;
00237         startYFace      = startYMPI + offsety;
00238         endXFace        = endXMPI - offsetx;
00239         endYFace        = endYMPI - offsety;
00240 
00241 
00242   list<MPRectangle> searchRects;
00243   list<int> xPos;
00244   list<int> yPos;
00245   list<Square>::iterator it = faces.begin();
00246   list<Square>::iterator end = faces.end();
00247 
00248   xPos.push_back(0);
00249   xPos.push_back(m_Width);
00250   yPos.push_back(0);
00251   yPos.push_back(m_Height);
00252   for (;it != end; it++) {
00253     Square face = *(it);
00254     //set rectangle for foreground **there is a cushion set smaller then face box
00255     MPRectangle foreground(face.x+offsetx, face.x+face.size-offsetx, face.y+offsety, face.y+face.size-offsety, true);
00256     searchRects.push_back(foreground);
00257     //set positions to create background rectangles **there is a cushion set larger then face box
00258     xPos.push_back(max(0,face.x-offsetx));
00259     xPos.push_back(min(m_Width,face.x+face.size+offsetx));
00260     yPos.push_back(max(0,face.y-offsety));
00261     yPos.push_back(min(m_Height,face.y+face.size+offsety));
00262   }
00263         xPos.sort();
00264         yPos.sort();
00265         
00266         //set rectange for background from positions created previously
00267   list<int>::iterator itX = xPos.begin();
00268   list<int>::iterator endX = xPos.end();
00269   list<int>::iterator itY = yPos.begin();
00270   list<int>::iterator endY = yPos.end();
00271   int leftX, rightX, topY, bottomY;
00272   float midX, midY;
00273   while (itX != endX) {
00274     leftX = *(itX);
00275     itX++;
00276     if (itX == endX) break;
00277     rightX = *(itX);
00278     midX = (leftX+rightX)*0.5;
00279     //cout << "leftx = " << leftX;
00280     //cout << " rightX = " << rightX << endl;
00281     itY = yPos.begin();
00282     while (itY != endY) {
00283       topY = *(itY);
00284       itY++;
00285       if (itY == endY) break;
00286       bottomY = *(itY);
00287       midY = (topY+bottomY)*0.5;
00288       isNonFace = true;
00289       it = faces.begin();
00290       for(;it != end; it++) {
00291         Square face = *(it);
00292 
00293         if (midX > face.x && midX < (face.x+face.size) &&
00294             midY > face.y && midY < (face.y+face.size))
00295           isNonFace = false;
00296       }
00297       if(isNonFace) {
00298         MPRectangle background(leftX, rightX, topY, bottomY, false);
00299         searchRects.push_back(background);
00300       }
00301     }
00302   }
00303 
00304           // Create FFImage wrapper around pixels
00305           FFImage<RGBTRIPLE> rgbimage(m_MyPixels, m_Width, m_Height, IMAGE_FLIPPED);
00306           RGBTRIPLE temp;
00307 
00308           // get probs for both face and background
00309           list<MPRectangle>::iterator it2 = searchRects.begin();
00310           list<MPRectangle>::iterator end2 = searchRects.end();
00311           for (;it2 != end2; it2++) {
00312                         MPRectangle rect = *(it2);
00313                         for(int y=rect.Y1; y<rect.Y2; y++) {
00314                                 for (int x=rect.X1; x<rect.X2; x++) {
00315                                         temp = rgbimage.getPixel(x,y);
00316                                         if(rect.face)
00317                                                 m_CurrentProbColorGivenFace.addtobin(temp);
00318                                         else
00319                                                 m_CurrentProbColorGivenBack.addtobin(temp);
00320                                 }
00321                         }
00322           }
00323 
00324         LockMutex(m_DataMutex);
00325         UpdateProbabilities();
00326 
00327         // compute likelihood ratio per pixel under new model at current face box 
00328         m_llikePix = 0;
00329         int nPix = 0;
00330         for (int x=startXFace; x<endXFace; x++) {
00331                 for (int y=startYFace; y < endYFace; y++) {
00332                   temp = rgbimage.getPixel(x,y);
00333                   m_llikePix += m_LogProbColorGivenFace.get_prob(temp) - m_LogProbColorGivenBack.get_prob(temp);
00334                   nPix++;
00335                 }
00336         }
00337         m_llikePix /= nPix;
00338         ReleaseMutex(m_DataMutex);
00339 }

Here is the call graph for this function:

void UpdateProbabilities  )  [private]
 

Definition at line 356 of file mpisearchthread.cpp.

References m_CurrentProbColorGivenBack, m_CurrentProbColorGivenFace, m_LogProbColorGivenBack, m_LogProbColorGivenFace, m_ProbColorGivenBack, m_ProbColorGivenFace, and MPHistogram::update_hist().

Referenced by InitColorModel(), and UpdateColorModel().

00357 {
00358 
00359         m_ProbColorGivenBack.update_hist (m_CurrentProbColorGivenBack, m_LogProbColorGivenBack, 0.5);
00360         m_ProbColorGivenFace.update_hist (m_CurrentProbColorGivenFace, m_LogProbColorGivenFace, 0.5);
00361 
00362 } // MPISearchThread::UpdateProbabilities

Here is the call graph for this function:

void UpdateTimeMPISearchBoxes TIMETYPE  t  )  [private]
 

Definition at line 381 of file mpisearchthread.cpp.

References m_TimeMPISearchBoxes.

Referenced by Process().

00382 {
00383         m_TimeMPISearchBoxes = t;
00384 }


Friends And Related Function Documentation

THREAD_RETURN_TYPE StartThreadedTracker void *   )  [friend]
 

Definition at line 41 of file mpisearchthread.cpp.

Referenced by Start().

00042 {
00043         MPISearchThread *MPI = static_cast<MPISearchThread *>(ThisMPISearchThread);
00044         while (MPI->m_ThreadRunning)
00045                 MPI->Process();
00046 #ifdef WIN32
00047         _endthread();
00048 #endif
00049 }


Member Data Documentation

int m_bBoxX1 [private]
 

Definition at line 83 of file mpisearchthread.h.

int m_bBoxX2 [private]
 

Definition at line 83 of file mpisearchthread.h.

int m_bBoxY1 [private]
 

Definition at line 83 of file mpisearchthread.h.

int m_bBoxY2 [private]
 

Definition at line 83 of file mpisearchthread.h.

MPColorTools m_Color
 

Definition at line 146 of file mpisearchthread.h.

MPColorTools m_color [private]
 

Definition at line 94 of file mpisearchthread.h.

double m_ColorMeanX [private]
 

Definition at line 81 of file mpisearchthread.h.

Referenced by CompareColorMPIMeans(), MPISearchThread(), and PutData().

double m_ColorMeanY [private]
 

Definition at line 81 of file mpisearchthread.h.

Referenced by CompareColorMPIMeans(), MPISearchThread(), and PutData().

long m_curFrame [private]
 

Definition at line 92 of file mpisearchthread.h.

Referenced by PutData().

MPHistogram<float, NUMBINS> m_CurrentProbColorGivenBack [private]
 

Definition at line 75 of file mpisearchthread.h.

Referenced by InitColorModel(), UpdateColorModel(), and UpdateProbabilities().

MPHistogram<float, NUMBINS> m_CurrentProbColorGivenFace [private]
 

Definition at line 74 of file mpisearchthread.h.

Referenced by InitColorModel(), UpdateColorModel(), and UpdateProbabilities().

MUTEX_TYPE m_DataMutex [private]
 

Definition at line 109 of file mpisearchthread.h.

Referenced by MPISearchThread(), Start(), and UpdateColorModel().

MPISearchFaceDetector m_Detector [private]
 

Definition at line 60 of file mpisearchthread.h.

Referenced by MPISearchThread(), and Search().

MUTEX_TYPE m_FaceMutex [private]
 

Definition at line 110 of file mpisearchthread.h.

Referenced by GetMPIFaceBoxes(), GetNumFaces(), MPISearchThread(), and Process().

THREAD_COND m_GotBufferFillRequest [private]
 

Definition at line 113 of file mpisearchthread.h.

Referenced by MPISearchThread(), Process(), and PutData().

int m_Height [private]
 

Definition at line 84 of file mpisearchthread.h.

Referenced by CompareColorMPIMeans(), Process(), PutData(), and UpdateColorModel().

double m_HighV [private]
 

Definition at line 87 of file mpisearchthread.h.

MUTEX_TYPE m_ImageMutex [private]
 

Definition at line 111 of file mpisearchthread.h.

Referenced by MPISearchThread(), Process(), and PutData().

long m_lastFrame [private]
 

Definition at line 92 of file mpisearchthread.h.

Referenced by Process().

int m_lastHeight [private]
 

Definition at line 84 of file mpisearchthread.h.

Referenced by MPISearchThread(), and Search().

int m_lastWidth [private]
 

Definition at line 84 of file mpisearchthread.h.

Referenced by MPISearchThread(), and Search().

double m_llikePix [private]
 

Definition at line 90 of file mpisearchthread.h.

Referenced by MPISearchThread(), and UpdateColorModel().

MPHistogram<float, NUMBINS> m_LogProbColorGivenBack [private]
 

Definition at line 77 of file mpisearchthread.h.

Referenced by UpdateColorModel(), and UpdateProbabilities().

MPHistogram<float, NUMBINS> m_LogProbColorGivenFace [private]
 

Definition at line 76 of file mpisearchthread.h.

Referenced by UpdateColorModel(), and UpdateProbabilities().

double m_LowV [private]
 

Definition at line 87 of file mpisearchthread.h.

FaceBoxList m_MPIBoxes [private]
 

Definition at line 91 of file mpisearchthread.h.

Referenced by Process().

double m_MPIMeanX [private]
 

Definition at line 82 of file mpisearchthread.h.

Referenced by CompareColorMPIMeans(), and MPISearchThread().

double m_MPIMeanY [private]
 

Definition at line 82 of file mpisearchthread.h.

Referenced by CompareColorMPIMeans(), and MPISearchThread().

RGBTRIPLE* m_MyPixels [private]
 

Definition at line 61 of file mpisearchthread.h.

Referenced by MPISearchThread(), Process(), PutData(), and UpdateColorModel().

int m_NumFaces [private]
 

Definition at line 80 of file mpisearchthread.h.

Referenced by MPISearchThread(), and Process().

int m_NumPixels [private]
 

Definition at line 80 of file mpisearchthread.h.

Referenced by MPISearchThread(), Process(), and PutData().

MPHistogram<float, NUMBINS> m_ProbColorGivenBack [private]
 

Definition at line 73 of file mpisearchthread.h.

Referenced by InitColorModel(), and UpdateProbabilities().

MPHistogram<float, NUMBINS> m_ProbColorGivenFace [private]
 

Definition at line 72 of file mpisearchthread.h.

Referenced by InitColorModel(), and UpdateProbabilities().

int m_ResetTracker [private]
 

Definition at line 89 of file mpisearchthread.h.

Referenced by CompareColorMPIMeans(), and MPISearchThread().

int m_shiftAmount [private]
 

Definition at line 86 of file mpisearchthread.h.

Referenced by MPISearchThread(), Process(), setShift(), and shiftFaces().

THREAD_TYPE m_ThreadHandle [private]
 

Definition at line 112 of file mpisearchthread.h.

Referenced by Start().

bool m_ThreadRunning [private]
 

Definition at line 88 of file mpisearchthread.h.

Referenced by Start(), and ~MPISearchThread().

TIMETYPE m_TimeMPISearchBoxes [private]
 

Definition at line 93 of file mpisearchthread.h.

Referenced by getElapsedTime(), and UpdateTimeMPISearchBoxes().

int m_Width [private]
 

Definition at line 84 of file mpisearchthread.h.

Referenced by Process(), PutData(), setShift(), and UpdateColorModel().

double mutex_llikePix [private]
 

Definition at line 90 of file mpisearchthread.h.

int mutex_ResetTracker [private]
 

Definition at line 89 of file mpisearchthread.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 8 17:08:39 2004 for MPT by  doxygen 1.3.9.1