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

SingleShotColorSearch Class Reference

Inheritance diagram for SingleShotColorSearch:

Inheritance graph
[legend]
Collaboration diagram for SingleShotColorSearch:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void displayResults ()
void Search (int frameCount)
 SingleShotColorSearch (char *filename)
 ~SingleShotColorSearch ()

Private Attributes

Image m_image
RImage< RGBTRIPLE > * m_pixels
int m_results

Constructor & Destructor Documentation

SingleShotColorSearch char *  filename  )  [inline]
 

Definition at line 43 of file Apps/unix/colortracker/main.cc.

References RImage::array, RImage::height, MPColorTracker::InitStreaming(), m_image, m_pixels, and RImage::width.

00043                                         : m_image(filename){
00044         try{
00045           //Image image(filename);
00046           //image.display();
00047           m_pixels = new RImage<RGBTRIPLE>(m_image.columns(), m_image.rows());
00048           m_image.write(0,0, m_image.columns(), m_image.rows(), "RGB", CharPixel, m_pixels->array);
00049         } catch ( ErrorFileOpen &error ) {
00050           cerr << "Error opening file: "
00051           <<  filename
00052           << ". ImageMagick said: "
00053           << error.what()
00054           << endl;
00055           return;
00056         }
00057         
00058         cout << "Image: " << filename
00059                 << " - " << m_pixels->width
00060                 << "x" << m_pixels->height
00061                 << endl;
00062 
00063         InitStreaming();
00064   }

Here is the call graph for this function:

~SingleShotColorSearch  )  [inline]
 

Definition at line 111 of file Apps/unix/colortracker/main.cc.

References MPColorTracker::EndStreaming().

00111 { delete m_pixels; EndStreaming();};

Here is the call graph for this function:


Member Function Documentation

void displayResults  )  [inline]
 

Definition at line 72 of file Apps/unix/colortracker/main.cc.

References RImage::array, ObjectList::empty(), FaceBoxList, faces, ObjectList::front(), MPColorTracker::GetColorBox(), MPColorTracker::GetLastFaces(), RImage::height, m_pixels, ObjectList::pop_front(), ObjectList::size(), TSquare::size, Square, RImage::width, TSquare::x, and TSquare::y.

00072                        {
00073                 
00074                 /*if(m_results) {
00075                         Image im2(m_pixels->width, m_pixels->height, "RGB", CharPixel, m_pixels->array);
00076         im2.display();
00077                 }*/
00078                         
00079                 FaceBoxList faces;
00080                 TSquare<double> box;
00081     cout << ".";
00082     if(m_results){
00083       //cout << endl << "Just got a Detect " << GetElapsedTime() << " ms ago" << endl;
00084       GetColorBox(box);
00085       cout << "Bounding Box is [" << box.x << "," << box.y << "; " << box.x+box.size << "," << box.y+box.size << "]" << endl;
00086         Image im2(m_pixels->width, m_pixels->height, "RGB", CharPixel, m_pixels->array);
00087                         im2.strokeColor("white");
00088       im2.strokeWidth(1);
00089       im2.fillColor("none" );
00090       im2.draw( DrawableRectangle(box.x, box.y, box.x+box.size, box.y+box.size) );
00091                         GetLastFaces(faces);
00092       if(faces.size() != 0) {
00093         im2.strokeColor("red");
00094         im2.strokeWidth(1);
00095         im2.fillColor("none" );
00096 
00097         while(!faces.empty( ))
00098         {
00099           Square face = faces.front();  
00100           faces.pop_front();
00101 
00102           im2.draw( DrawableRectangle(face.x, face.y, 
00103                 face.x + face.size, face.y + face.size));
00104 
00105         }
00106                         }                                               
00107       im2.display();
00108     }
00109   }

Here is the call graph for this function:

void Search int  frameCount  )  [inline]
 

Definition at line 66 of file Apps/unix/colortracker/main.cc.

References RImage::array, MPColorTracker::DoSearch(), RImage::height, m_pixels, m_results, MPColorTracker::MPIUpdate(), MPColorTracker::PutImage(), and RImage::width.

00066                              {
00067                 PutImage(m_pixels->array, m_pixels->width, m_pixels->height, (long)frameCount);
00068                 MPIUpdate();
00069                 m_results = DoSearch();
00070         }

Here is the call graph for this function:


Member Data Documentation

Image m_image [private]
 

Definition at line 115 of file Apps/unix/colortracker/main.cc.

Referenced by SingleShotColorSearch().

RImage<RGBTRIPLE>* m_pixels [private]
 

Definition at line 114 of file Apps/unix/colortracker/main.cc.

Referenced by displayResults(), Search(), and SingleShotColorSearch().

int m_results [private]
 

Reimplemented from MPColorTracker.

Definition at line 116 of file Apps/unix/colortracker/main.cc.

Referenced by Search().


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