Repository navigation
Expand file tree
/
Copy pathmsSysPrompt.cpp
More file actions
232 lines (201 loc) · 8.92 KB
/
Copy pathmsSysPrompt.cpp
File metadata and controls
232 lines (201 loc) · 8.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/*******************************************************
Mean Shift Analysis Library
=============================================
The mean shift library is a collection of routines
that use the mean shift algorithm. Using this algorithm,
the necessary output will be generated needed
to analyze a given input set of data.
Mean Shift System:
==================
The Mean Shift System class provides a mechanism for the
mean shift library classes to prompt progress and to
time its computations. When porting the mean shift library
to an application the methods of this class may be changed
such that the output of the mean shift class prompts
will be given to whatever hardware or software device that
is desired.
The definition for the mean shift system class is provided
below. Its prototype is provided in "msSys.cc".
The theory is described in the papers:
D. Comaniciu, P. Meer: Mean Shift: A robust approach toward feature
space analysis.
C. Christoudias, B. Georgescu, P. Meer: Synergism in low level vision.
and they are is available at:
http://www.caip.rutgers.edu/riul/research/papers/
Implemented by Chris M. Christoudias, Bogdan Georgescu
********************************************************/
////////////////////////////////////////////////////////////////////////
// Command Line Version:
// This version of mean shift system is written for the command
// line version of EDISON.
////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
//include the msSystem class prototype
#include "msSys.h"
//include needed system libraries
#include <time.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
//define bgLog
//extern bool CmCDisplayProgress;
//void bgLog(const char *PromptStr, ...)
//{
// //obtain argument list using ANSI standard...
// va_list argList;
// va_start(argList, PromptStr);
//
// //print the output string to stderr using
// if(CmCDisplayProgress) vfprintf(stdout, PromptStr, argList);
// va_end(argList);
//
// //done.
// return;
//}
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ PUBLIC METHODS @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
/*** Class Constructor and Destructor ***/
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/*/
/*******************************************************/
/*Class Constructor */
/*******************************************************/
/*Constructs a mean shift system object. */
/*******************************************************/
/*Post: */
/* - an msSystem object has been properly init- */
/* ialized. */
/*******************************************************/
//msSystem::msSystem( void )
//{
//
// //initialize currentTime
// currentTime = clock();
//
// //done.
//
//}
/*******************************************************/
/*Class Destructor */
/*******************************************************/
/*Destroys a mean shift system object. */
/*******************************************************/
/*Post: */
/* - an msSystem object has been properly dest- */
/* royed. */
/*******************************************************/
//msSystem::~msSystem( void )
//{
// /* do nothing */
//}
/*/\/\/\/\/\/\/\/\/\*/
/*** System Timer ***/
/*\/\/\/\/\/\/\/\/\/*/
/*******************************************************/
/*Start Timer */
/*******************************************************/
/*Sets the mean shift system time to the current */
/*system time. */
/*******************************************************/
/*Post: */
/* - the mean shift system time has been set to */
/* the current system time. */
/*******************************************************/
//void msSystem::StartTimer( void )
//{
//
////set msSystem time to system time
//currentTime = clock();
//
////done.
//return;
//
//}
/*******************************************************/
/*Elapsed Time */
/*******************************************************/
/*Returns the amount of time in seconds since the */
/*mean shift system time was last set. */
/*******************************************************/
/*Post: */
/* - the amount of time in seconds since the mean */
/* shift system time was last set is returned. */
/*******************************************************/
//double msSystem::ElapsedTime( void )
//{
//
// //return the amount of time elapsed in seconds
// //since the msSystem time was last set...
// return ((double) (clock() - currentTime))/(CLOCKS_PER_SEC);
//
//}
/*/\/\/\/\/\/\/\/\/\/\*/
/*** System Output ***/
/*\/\/\/\/\/\/\/\/\/\/*/
/*******************************************************/
/*Prompt */
/*******************************************************/
/*Output a text message to the user. */
/*******************************************************/
/*Pre: */
/* - PromptStr is a string containing delimeters */
/* that is to be output to the user. */
/* - a variable set of arguments is also passed */
/* to this method that are used to replace */
/* the delimeters contained by PromptStr */
/*Post: */
/* - the delimeters of PromptStr have been */
/* replaced accordingly using the variable */
/* set of arguments and the resulting string */
/* has been output to the user. */
/*******************************************************/
//void msSystem::Prompt(const char *PromptStr, ...)
//{
//
// //obtain argument list using ANSI standard...
// va_list argList;
// va_start(argList, PromptStr);
//
// //print the output string to stderr using
// if(CmCDisplayProgress) vfprintf(stdout, PromptStr, argList);
// va_end(argList);
//
// //done.
// return;
//
//}
/*******************************************************/
/*Progress */
/*******************************************************/
/*The progress of a specific algorithm of the mean */
/*shift library is output to the user. */
/*******************************************************/
/*Pre: */
/* - percentComplete indicates the percentage */
/* of the algorithm that has executed and is */
/* a floating point number from zero to one */
/*Post: */
/* - the percentComplete has been noted by the */
/* interface (possibly to update a progress */
/* bar). */
/* - if the thread executing the mean shift code */
/* must halt execution msSYS_HALT is returned, */
/* msSYS_OK is returned otherwise */
/*******************************************************/
///////////////////////////////////////////////////////////////////
//NOTE: This implementation is specific to EDISON. In order
// for one to port the mean shift class to another project
// or program one must re-implement this method.
///////////////////////////////////////////////////////////////////
//ErrorLevel msSystem::Progress(float percentComplete)
//{
// return EL_OKAY;
//}
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ END OF CLASS DEFINITION @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/