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

Apps/unix/colortracker/main.cc File Reference

#include <iostream.h>
#include <iomanip.h>
#include "MPColorTracker.h"
#include <list>
#include <Magick++.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <sys/times.h>
#include <stdlib.h>

Include dependency graph for Apps/unix/colortracker/main.cc:

Include dependency graph

Go to the source code of this file.

Classes

struct  arguments
class  SingleShotColorSearch

Defines

#define FALSE   0
#define MAX_NUM_IMAGES   20
#define TRUE   1

Functions

int main (int argc, char **argv)


Define Documentation

#define FALSE   0
 

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

Referenced by MPFaceDetectorFilter::Copy(), MPEyeFinderFilter::Copy(), MPColorTrackerFilter::Copy(), MPBlinkDetectorFilter::Copy(), CreateMutex(), CreateMutexEvent(), DllUnregisterServer(), SaveVideo::DoDataExchange(), SaveVideo::OnPause(), SaveVideo::OnResume(), SaveVideo::OnSave(), and SaveVideo::OnStop().

#define MAX_NUM_IMAGES   20
 

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

#define TRUE   1
 

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

Referenced by MPFaceDetectorFilter::Copy(), MPEyeFinderFilter::Copy(), MPColorTrackerFilter::Copy(), MPBlinkDetectorFilter::Copy(), CreateMutexEvent(), DllRegisterServer(), SaveVideo::DoDataExchange(), SaveVideo::OnPause(), SaveVideo::OnResume(), SaveVideo::OnSave(), SaveVideo::OnStop(), MPColorTrackerFilter::put_IPEffect(), and MPDirectShow::SaveGraphEditFile().


Function Documentation

int main int  argc,
char **  argv
 

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

References arguments::args, i, im, and s.

00124 {  
00125         int i;
00126   struct arguments arguments;
00127   for(i = 0; i<MAX_NUM_IMAGES; i++)
00128     arguments.args[i] = 0;
00129     
00130   // get values from command line
00131   if(argc==2) {
00132         arguments.args[0] = (char *)malloc(256 * sizeof(char));
00133     strcpy(arguments.args[0],argv[1]);
00134         }
00135   else{
00136                 for (i = 0; i < argc-1 && i < MAX_NUM_IMAGES; i++) {
00137                         arguments.args[i] = (char *)malloc(256 * sizeof(char));
00138         strcpy(arguments.args[i],argv[i+1]);
00139                 }
00140   }
00141 
00142         int im = 0;
00143         while (arguments.args[im] && im < MAX_NUM_IMAGES) {
00144         cout << "instantiate SingleShotColorSearch for image " << arguments.args[im] << endl;
00145   
00146         SingleShotColorSearch s(arguments.args[im]);
00147 
00148         s.Search(0);
00149         struct tms tms_buf;
00150         clock_t start_time;
00151         double elapsed_time;
00152         // start the clock
00153     start_time = times(&tms_buf);
00154 
00155         // SEARCH 100 times!
00156         int NSearch = 20;
00157                 int showResults = 0;
00158         for(int i = 1; i< NSearch; i++){
00159         s.Search(i);
00160                         if (showResults > 5) {
00161                 s.displayResults();
00162                                 showResults = 0;
00163                         }
00164                         cout << ".";
00165                         showResults++;
00166         }
00167         cout << endl;
00168         elapsed_time = (double)(times(&tms_buf) - start_time) / 1000;
00169         cout << endl << NSearch/elapsed_time << " Frames per second" << endl;
00170         // stop the clock  
00171         printf("\tThe search took %g seconds. \n", elapsed_time);
00172                 im++;
00173         }
00174   
00175 }


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