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

ObjectList Class Template Reference

#include <faceboxlist.h>

Inheritance diagram for ObjectList:

Inheritance graph
[legend]
List of all members.

Public Member Functions

TSquare< T > back () const
TSquare< T > back () const
TSquare< T > back () const
TSquare< T > back () const
TSquare_iter begin ()
TSquare_iter begin ()
TSquare_iter begin ()
TSquare_iter begin ()
void clear ()
void clear ()
void clear ()
void clear ()
bool empty () const
bool empty () const
bool empty () const
bool empty () const
TSquare_iter end ()
TSquare_iter end ()
TSquare_iter end ()
TSquare_iter end ()
void erase (TSquare_iter &object)
void erase (TSquare_iter &object)
void erase (TSquare_iter &object)
void erase (TSquare_iter &object)
TSquare< T > front () const
TSquare< T > front () const
TSquare< T > front () const
TSquare< T > front () const
 ObjectList (ObjectList &thelist)
 ObjectList ()
 ObjectList (ObjectList &thelist)
 ObjectList ()
 ObjectList (ObjectList &thelist)
 ObjectList ()
 ObjectList (ObjectList &thelist)
 ObjectList ()
float overlap (avg_object &a, avg_object &b)
float overlap (avg_object &a, avg_object &b)
float overlap (avg_object &a, avg_object &b)
float overlap (avg_object &a, avg_object &b)
void pop_front ()
void pop_front ()
void pop_front ()
void pop_front ()
void push_back (const TSquare< T > &object)
void push_back (const TSquare< T > &object)
void push_back (const TSquare< T > &object)
void push_back (const TSquare< T > &object)
void push_front (const TSquare< T > &object)
void push_front (const TSquare< T > &object)
void push_front (const TSquare< T > &object)
void push_front (const TSquare< T > &object)
void simplify (float tol)
void simplify (float tol)
void simplify (float tol)
void simplify (float tol)
int size () const
int size () const
int size () const
int size () const
void sort ()
void sort ()
void sort ()
void sort ()
 ~ObjectList ()
 ~ObjectList ()
 ~ObjectList ()
 ~ObjectList ()

Public Attributes

list< TSquare< T > > objects

Private Types

typedef list< TSquare< T
> >::iterator 
TSquare_iter
typedef list< TSquare< T
> >::iterator 
TSquare_iter
typedef list< TSquare< T
> >::iterator 
TSquare_iter
typedef list< TSquare< T
> >::iterator 
TSquare_iter

template<class T>
class ObjectList< T >


Member Typedef Documentation

typedef list<TSquare< T > >::iterator TSquare_iter [private]
 

Definition at line 44 of file src/faceboxlist.h.

typedef list<TSquare< T > >::iterator TSquare_iter [private]
 

Definition at line 44 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

typedef list<TSquare< T > >::iterator TSquare_iter [private]
 

Definition at line 44 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

typedef list<TSquare< T > >::iterator TSquare_iter [private]
 

Definition at line 44 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.


Constructor & Destructor Documentation

ObjectList  )  [inline]
 

Definition at line 46 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

00046 {};

ObjectList ObjectList< T > &  thelist  )  [inline]
 

Definition at line 47 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

00047 :objects(thelist.objects){};

~ObjectList  )  [inline]
 

Definition at line 48 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

00048 {};

ObjectList  )  [inline]
 

Definition at line 46 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00046 {};

ObjectList ObjectList< T > &  thelist  )  [inline]
 

Definition at line 47 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00047 :objects(thelist.objects){};

~ObjectList  )  [inline]
 

Definition at line 48 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00048 {};

ObjectList  )  [inline]
 

Definition at line 46 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00046 {};

ObjectList ObjectList< T > &  thelist  )  [inline]
 

Definition at line 47 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00047 :objects(thelist.objects){};

~ObjectList  )  [inline]
 

Definition at line 48 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00048 {};

ObjectList  )  [inline]
 

Definition at line 46 of file src/faceboxlist.h.

00046 {};

ObjectList ObjectList< T > &  thelist  )  [inline]
 

Definition at line 47 of file src/faceboxlist.h.

00047 :objects(thelist.objects){};

~ObjectList  )  [inline]
 

Definition at line 48 of file src/faceboxlist.h.

00048 {};


Member Function Documentation

TSquare< T > back  )  const [inline]
 

Definition at line 62 of file src/faceboxlist.h.

00062 { return objects.back(); }

TSquare< T > back  )  const [inline]
 

Definition at line 62 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00062 { return objects.back(); }

TSquare< T > back  )  const [inline]
 

Definition at line 62 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00062 { return objects.back(); }

TSquare< T > back  )  const [inline]
 

Definition at line 62 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

00062 { return objects.back(); }

TSquare_iter begin  )  [inline]
 

Definition at line 59 of file src/faceboxlist.h.

00059 { return objects.begin(); }

TSquare_iter begin  )  [inline]
 

Definition at line 59 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00059 { return objects.begin(); }

TSquare_iter begin  )  [inline]
 

Definition at line 59 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00059 { return objects.begin(); }

TSquare_iter begin  )  [inline]
 

Definition at line 59 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by DrawBoxes(), FilterInterface::DrawBoxes(), MPEyeFinder::findEyes(), FindFacesInGWorld::FindFaces:, MPBlink::get_eyes(), main(), mexFunction(), MPISearchThread::shiftFaces(), and MPISearchThread::UpdateColorModel().

00059 { return objects.begin(); }

void clear  )  [inline]
 

Definition at line 53 of file src/faceboxlist.h.

00053 {objects.clear();}

void clear  )  [inline]
 

Definition at line 53 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00053 {objects.clear();}

void clear  )  [inline]
 

Definition at line 53 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00053 {objects.clear();}

void clear  )  [inline]
 

Definition at line 53 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by MPEyeFinder::findEyes(), and main().

00053 {objects.clear();}

bool empty  )  const [inline]
 

Definition at line 52 of file src/faceboxlist.h.

00052 {return objects.empty(); }

bool empty  )  const [inline]
 

Definition at line 52 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00052 {return objects.empty(); }

bool empty  )  const [inline]
 

Definition at line 52 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00052 {return objects.empty(); }

bool empty  )  const [inline]
 

Definition at line 52 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by SingleShotColorSearch::displayResults(), FindFacesInGWorld::FindFaces:, main(), MPISearchThread::Process(), and MPISearchObjectDetector::search().

00052 {return objects.empty(); }

TSquare_iter end  )  [inline]
 

Definition at line 60 of file src/faceboxlist.h.

00060 { return objects.end(); }

TSquare_iter end  )  [inline]
 

Definition at line 60 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00060 { return objects.end(); }

TSquare_iter end  )  [inline]
 

Definition at line 60 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00060 { return objects.end(); }

TSquare_iter end  )  [inline]
 

Definition at line 60 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by DrawBoxes(), FilterInterface::DrawBoxes(), MPEyeFinder::findEyes(), MPBlink::get_eyes(), main(), mexFunction(), MPISearchThread::shiftFaces(), and MPISearchThread::UpdateColorModel().

00060 { return objects.end(); }

void erase TSquare_iter object  )  [inline]
 

Definition at line 55 of file src/faceboxlist.h.

00055 {objects.erase(object);}

void erase TSquare_iter object  )  [inline]
 

Definition at line 55 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00055 {objects.erase(object);}

void erase TSquare_iter object  )  [inline]
 

Definition at line 55 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00055 {objects.erase(object);}

void erase TSquare_iter object  )  [inline]
 

Definition at line 55 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

00055 {objects.erase(object);}

TSquare< T > front  )  const [inline]
 

Definition at line 61 of file src/faceboxlist.h.

00061 { return objects.front(); }

TSquare< T > front  )  const [inline]
 

Definition at line 61 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00061 { return objects.front(); }

TSquare< T > front  )  const [inline]
 

Definition at line 61 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00061 { return objects.front(); }

TSquare< T > front  )  const [inline]
 

Definition at line 61 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by SingleShotColorSearch::displayResults(), FindFacesInGWorld::FindFaces:, main(), and MPISearchThread::UpdateColorModel().

00061 { return objects.front(); }

float overlap avg_object a,
avg_object b
 

float overlap avg_object a,
avg_object b
 

float overlap avg_object a,
avg_object b
 

float overlap avg_object a,
avg_object b
 

Definition at line 80 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

References avg_object::b, avg_object::l, max, min(), p, avg_object::r, avg_object::t, total, and y.

Referenced by simplify().

00080                                                          {
00081   float  x = max(0,min(a.r,b.r)-max(a.l,b.l));
00082   float  y = max(0,min(a.b,b.b)-max(a.t,b.t));
00083   float  intersection = x*y;
00084   float  total = (a.r-a.l)*(a.b-a.t) + (b.r-b.l)*(b.b-b.t);
00085   float  unin = total-intersection; // note: 'union' is reserved
00086   float  p = intersection/unin;
00087   return(p);
00088 }

Here is the call graph for this function:

void pop_front  )  [inline]
 

Definition at line 58 of file src/faceboxlist.h.

00058 {objects.pop_front();}

void pop_front  )  [inline]
 

Definition at line 58 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00058 {objects.pop_front();}

void pop_front  )  [inline]
 

Definition at line 58 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00058 {objects.pop_front();}

void pop_front  )  [inline]
 

Definition at line 58 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by SingleShotColorSearch::displayResults(), FindFacesInGWorld::FindFaces:, and main().

00058 {objects.pop_front();}

void push_back const TSquare< T > &  object  )  [inline]
 

Definition at line 56 of file src/faceboxlist.h.

00056 {objects.push_back(object);}

void push_back const TSquare< T > &  object  )  [inline]
 

Definition at line 56 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00056 {objects.push_back(object);}

void push_back const TSquare< T > &  object  )  [inline]
 

Definition at line 56 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00056 {objects.push_back(object);}

void push_back const TSquare< T > &  object  )  [inline]
 

Definition at line 56 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by MPISearchThread::UpdateColorModel().

00056 {objects.push_back(object);}

void push_front const TSquare< T > &  object  )  [inline]
 

Definition at line 57 of file src/faceboxlist.h.

00057 {objects.push_front(object);}

void push_front const TSquare< T > &  object  )  [inline]
 

Definition at line 57 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00057 {objects.push_front(object);}

void push_front const TSquare< T > &  object  )  [inline]
 

Definition at line 57 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00057 {objects.push_front(object);}

void push_front const TSquare< T > &  object  )  [inline]
 

Definition at line 57 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by MPISearchObjectDetector::search().

00057 {objects.push_front(object);}

void simplify float  tol  ) 
 

void simplify float  tol  ) 
 

void simplify float  tol  ) 
 

void simplify float  tol  ) 
 

Definition at line 91 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

References avg_object::b, f(), i, avg_object::l, n, avg_object::normalize(), objects, overlap(), avg_object::r, TSquare::scale, avg_object::scale, TSquare::size, square, avg_object::t, TSquare::x, and TSquare::y.

Referenced by MPEyeFinder::findEyes(), FindFacesInGWorld::FindFaces:, main(), and MPISearchThread::Search().

00092 {
00093   list<avg_object>* origObjects;
00094   avg_object tmp;
00095 
00096   if(objects.size() > 1){
00097     int n = 0;
00098     //
00099     // First, put objects into convenient form
00100     //
00101     TSquare<T> f;
00102     origObjects = new list<avg_object>;
00103     while(objects.size() > 0) {
00104       f = objects.front();
00105       //cout << "Simplifying from (x,y,scale,size): (" << f.x << ", " << f.y << ", " << f.scale<<", " << f.size << ")" << endl;
00106       tmp.l = f.x;
00107       tmp.r = f.x + f.size;
00108       tmp.t = f.y;
00109       tmp.b = f.y + f.size;
00110       //tmp.n = 1;
00111       tmp.scale = f.scale;
00112       origObjects->push_back(tmp);  // append the copy
00113       objects.pop_front();
00114     }
00115 
00116     //
00117     // Now, iterate through boxes and combine those that overlap with first
00118     // box.  Make a new list containing originals and combined boxes.  Now
00119     // repeat, using this new list in place of the original, until all boxes
00120     // have been checked with all other boxes.
00121     //
00122     list<avg_object> *newObjects;
00123     list<avg_object> *overlappingObjects;
00124     //float  collapsed;
00125     for(int i = 0; i < origObjects->size(); i++){
00126       newObjects = new list<avg_object>;
00127       overlappingObjects = new list<avg_object>;
00128 
00129       //
00130       // store the first object in the overlapping list.
00131       //
00132       overlappingObjects->push_back(origObjects->front());
00133       origObjects->pop_front();
00134       //
00135       //        Loop through all boxes in list, and add them either to the new list,
00136       //  or the overlapping boxes list.
00137       //
00138       while ( origObjects->size() > 0 ) {
00139         float  o = overlap(overlappingObjects->front(),origObjects->front());
00140         if(o > tol)
00141           overlappingObjects->push_back(origObjects->front());
00142         else
00143           newObjects->push_back(origObjects->front());
00144         origObjects->pop_front();
00145       }
00146 
00147 
00148       //
00149       // Now average all the overlapping boxes, and add them to the new list.
00150       //
00151       list<avg_object>::iterator over_iter = overlappingObjects->begin(),
00152         over_iter_end = overlappingObjects->end();
00153       tmp = *over_iter;
00154       for ( over_iter++; over_iter != over_iter_end; over_iter++){
00155         tmp += *over_iter;
00156       }
00157       tmp.normalize();
00158       //cout << "tmp after normallizing: (" << tmp.t << ","<< tmp.b << ","<< tmp.l << ","<< tmp.r << ")"<<endl;
00159       newObjects->push_back(tmp);
00160 
00161       //
00162       //  Make the new list pose as the original list, and free memory so we
00163       //  can make a new new list and overlapping boxes list.
00164       //
00165       delete(origObjects);        // get rid of the old original list
00166       origObjects = newObjects; // make the new list pose as the original
00167       delete(overlappingObjects); // get rid of the overlapping list
00168     }
00169 
00170     // finally, write them back into object
00171     while( !newObjects->empty() ) {
00172       tmp = *(newObjects->begin());
00173       TSquare< T > square (static_cast<int>(tmp.r-tmp.l), static_cast<int>(tmp.l), static_cast<int>(tmp.t), static_cast<int>(floor(tmp.scale+.5)));
00174       objects.push_front(square);
00175       f = objects.front();
00176       newObjects->pop_front ( );
00177     }
00178     delete newObjects;
00179   }
00180 }

Here is the call graph for this function:

int size  )  const [inline]
 

Definition at line 51 of file src/faceboxlist.h.

00051 {return objects.size();}

int size  )  const [inline]
 

Definition at line 51 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00051 {return objects.size();}

int size  )  const [inline]
 

Definition at line 51 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00051 {return objects.size();}

int size  )  const [inline]
 

Definition at line 51 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by SingleShotColorSearch::displayResults(), MPBlink::findBlinks(), MPEyeFinder::findEyes(), FindFacesInGWorld::FindFaces:, main(), mexFunction(), MPISearchThread::Process(), and MPISearchThread::shiftFaces().

00051 {return objects.size();}

void sort  )  [inline]
 

Definition at line 54 of file src/faceboxlist.h.

00054 {objects.sort();}

void sort  )  [inline]
 

Definition at line 54 of file mac/build/mpisearch.framework/Versions/Current/Headers/faceboxlist.h.

00054 {objects.sort();}

void sort  )  [inline]
 

Definition at line 54 of file mac/build/mpisearch.framework/Versions/A/Headers/faceboxlist.h.

00054 {objects.sort();}

void sort  )  [inline]
 

Definition at line 54 of file mac/build/mpisearch.framework/Headers/faceboxlist.h.

Referenced by main(), MPISearchThread::Process(), and MPISearchThread::UpdateColorModel().

00054 {objects.sort();}


Member Data Documentation

list< TSquare< T > > objects
 

Definition at line 64 of file src/faceboxlist.h.

Referenced by main(), MPISearchThread::Process(), and simplify().


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