4 <meta http-equiv=Content-Type content="text/html; charset=windows-1251">
5 <meta name=Generator content="Microsoft Word 11 (filtered)">
6 <title>Object Detection Using Haar-like Features with Cascade of Boosted
10 /* Style Definitions */
11 p.MsoNormal, li.MsoNormal, div.MsoNormal
13 margin-bottom:.0001pt;
16 font-family:"Times New Roman";}
23 page-break-after:avoid;
32 page-break-after:avoid;
42 page-break-after:avoid;
46 {font-family:"Courier New";
49 {size:595.3pt 841.9pt;
50 margin:56.7pt 88.0pt 63.2pt 85.05pt;}
53 /* List Definitions */
67 <h1><span lang=EN-US>Rapid Object Detection With A Cascade of Boosted
68 Classifiers Based on Haar-like Features</span></h1>
70 <h2><span lang=EN-US>Introduction</span></h2>
72 <p class=MsoNormal><span lang=EN-US>This document describes how to train and
73 use a cascade of boosted classifiers for rapid object detection. A large set of
74 over-complete haar-like features provide the basis for the simple individual
75 classifiers. Examples of object detection tasks are face, eye and nose
76 detection, as well as logo detection. </span></p>
78 <p class=MsoNormal><span lang=EN-US> </span></p>
80 <p class=MsoNormal><span lang=EN-US>The sample detection task in this document
81 is logo detection, since logo detection does not require the collection of
82 large set of registered and carefully marked object samples. Instead we assume
83 that from one prototype image, a very large set of derived object examples can
84 be derived (</span><span class=Typewch><span lang=EN-US>createsamples</span></span><span
85 lang=EN-US> utility, see below).</span></p>
87 <p class=MsoNormal><span lang=EN-US> </span></p>
89 <p class=MsoNormal><span lang=EN-US>A detailed description of the training/evaluation
90 algorithm can be found in [1] and [2].</span></p>
92 <h2><span lang=EN-US>Samples Creation</span></h2>
94 <p class=MsoNormal><span lang=EN-US>For training a training samples must be
95 collected. There are two sample types: negative samples and positive samples.
96 Negative samples correspond to non-object images. Positive samples correspond
97 to object images.</span></p>
99 <h3><span lang=EN-US>Negative Samples</span></h3>
101 <p class=MsoNormal><span lang=EN-US>Negative samples are taken from arbitrary
102 images. These images must not contain object representations. Negative samples
103 are passed through background description file. It is a text file in which each
104 text line contains the filename (relative to the directory of the description
105 file) of negative sample image. This file must be created manually. Note that
106 the negative samples and sample images are also called background samples or
107 background samples images, and are used interchangeably in this document</span></p>
109 <p class=MsoNormal><span lang=EN-US> </span></p>
111 <p class=MsoNormal><span lang=EN-US>Example of negative description file:</span></p>
113 <p class=MsoNormal><span lang=EN-US> </span></p>
115 <p class=MsoNormal><span lang=EN-US>Directory structure:</span></p>
117 <p class=MsoNormal><span class=Typewch><span lang=EN-US>/img</span></span></p>
119 <p class=MsoNormal><span class=Typewch><span lang=EN-US> img1.jpg</span></span></p>
121 <p class=MsoNormal><span class=Typewch><span lang=EN-US> img2.jpg</span></span></p>
123 <p class=MsoNormal><span class=Typewch><span lang=EN-US>bg.txt</span></span></p>
125 <p class=MsoNormal><span class=Typewch><span lang=EN-US> </span></span></p>
127 <p class=MsoNormal><span class=Typewch><span style='font-family:"Times New Roman";
128 font-weight:normal'>File </span></span><span class=Typewch><span lang=EN-US>bg.txt:</span></span></p>
130 <p class=MsoNormal><span class=Typewch><span lang=EN-US>img/img1.jpg</span></span></p>
132 <p class=MsoNormal><span class=Typewch><span lang=EN-US>img/img2.jpg</span></span></p>
134 <h3><span lang=EN-US>Positive Samples</span></h3>
136 <p class=MsoNormal><span lang=EN-US>Positive samples are created by </span><span
137 class=Typewch><span lang=EN-US>createsamples</span></span><span lang=EN-US>
138 utility. They may be created from single object image or from collection of
139 previously marked up images.<br>
143 <p class=MsoNormal><span lang=EN-US>The single object image may for instance
144 contain a company logo. Then are large set of positive samples are created from
145 the given object image by randomly rotating, changing the logo color as well as
146 placing the logo on arbitrary background.</span></p>
148 <p class=MsoNormal><span lang=EN-US>The amount and range of randomness can be
149 controlled by command line arguments. </span></p>
151 <p class=MsoNormal><span lang=EN-US>Command line arguments:</span></p>
153 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
154 class=Typewch><span lang=EN-US>- vec <vec_file_name></span></span><span
155 lang=EN-US> </span></p>
157 <p class=MsoNormal style='margin-left:17.1pt'><span lang=EN-US>name of the
158 output file containing the positive samples for training</span></p>
160 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
161 class=Typewch><span lang=EN-US>- img <image_file_name></span></span><span
162 lang=EN-US> </span></p>
164 <p class=MsoNormal style='margin-left:17.1pt'><span lang=EN-US>source object
165 image (e.g., a company logo)</span></p>
167 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
168 class=Typewch><span lang=EN-US>- bg <background_file_name></span></span><span
169 lang=EN-US> </span></p>
171 <p class=MsoNormal style='margin-left:17.1pt'><span lang=EN-US>background
172 description file; contains a list of images into which randomly distorted
173 versions of the object are pasted for positive sample generation</span></p>
175 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
176 class=Typewch><span lang=EN-US>- num <number_of_samples></span></span><span
177 lang=EN-US> </span></p>
179 <p class=MsoNormal style='margin-left:17.1pt'><span lang=EN-US>number of
180 positive samples to generate </span></p>
182 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
183 class=Typewch><span lang=EN-US>- bgcolor <background_color></span></span></p>
185 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
186 lang=EN-US> background color (currently grayscale images are assumed); the
187 background color denotes the transparent color. Since there might be
188 compression artifacts, the amount of color tolerance can be specified by </span><span
189 class=Typewch><span lang=EN-US>
\96bgthresh</span></span><span class=Typewch><span
190 lang=EN-US style='font-family:Arial;font-weight:normal'>. </span></span><span
191 lang=EN-US>All pixels between </span><span class=Typewch><span lang=EN-US>bgcolor-bgthresh</span></span><span
192 lang=EN-US> and </span><span class=Typewch><span lang=EN-US>bgcolor+bgthresh</span></span><span
193 lang=EN-US> are regarded as transparent.</span></p>
195 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
196 class=Typewch><span lang=EN-US>- bgthresh <background_color_threshold></span></span></p>
198 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
199 class=Typewch><span lang=EN-US>- inv</span></span></p>
201 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
202 lang=EN-US> if specified, the colors will be inverted</span></p>
204 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
205 class=Typewch><span lang=EN-US>- randinv</span></span><span lang=EN-US> </span></p>
207 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
208 lang=EN-US> if specified, the colors will be inverted randomly</span></p>
210 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
211 class=Typewch><span lang=EN-US>- maxidev <max_intensity_deviation></span></span></p>
213 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
214 class=Typewch><span lang=EN-US> </span></span><span lang=EN-US>maximal
215 intensity deviation of foreground samples pixels</span></p>
217 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
218 class=Typewch><span lang=EN-US>- maxxangle <max_x_rotation_angle>,</span></span></p>
220 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
221 class=Typewch><span lang=EN-US>- maxyangle <max_y_rotation_angle>,</span></span></p>
223 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
224 class=Typewch><span lang=EN-US>- maxzangle <max_z_rotation_angle></span></span></p>
226 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
227 lang=EN-US> maximum rotation angles in radians</span></p>
229 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
230 class=Typewch><span lang=EN-US>-show</span></span></p>
232 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
233 lang=EN-US> if specified, each sample will be shown. Pressing
\91Esc
\92 will
234 continue creation process without samples showing. Useful debugging option.</span></p>
236 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
237 class=Typewch><span lang=EN-US>- w <sample_width></span></span></p>
239 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
240 class=Typewch><span lang=EN-US> </span></span><span class=Typewch><span
241 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'>width (in
242 pixels) of the output samples</span></span></p>
244 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
245 class=Typewch><span lang=EN-US>- h <sample_height></span></span></p>
247 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
248 class=Typewch><span lang=EN-US> </span></span><span class=Typewch><span
249 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'>height (in
250 pixels) of the output samples</span></span></p>
252 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
253 class=Typewch><span lang=EN-US> </span></span></p>
255 <p class=MsoNormal><span lang=EN-US>For following procedure is used to create a
256 sample object instance:</span></p>
258 <p class=MsoNormal><span lang=EN-US>The source image is rotated random around
259 all three axes. The chosen angle is limited my</span><span class=Typewch><span
260 lang=EN-US> -max?angle</span></span><span lang=EN-US>. Next pixels of
261 intensities in the range of </span><span class=Typewch><span lang=EN-US>[bg_color-bg_color_threshold;
262 bg_color+bg_color_threshold]</span></span><span lang=EN-US> are regarded as
263 transparent. White noise is added to the intensities of the foreground. If </span><span
264 class=Typewch><span lang=EN-US>
\96inv</span></span><span lang=EN-US> key is
265 specified then foreground pixel intensities are inverted. If </span><span
266 class=Typewch><span lang=EN-US>
\96randinv</span></span><span lang=EN-US> key is
267 specified then it is randomly selected whether for this sample inversion will
268 be applied. Finally, the obtained image is placed onto arbitrary background
269 from the background description file, resized to the pixel size specified by </span><span
270 class=Typewch><span lang=EN-US>
\96w</span></span><span lang=EN-US> and </span><span
271 class=Typewch><span lang=EN-US>
\96h</span></span><span lang=EN-US> and stored
272 into the file specified by the </span><span class=Typewch><span lang=EN-US>
\96vec</span></span><span
273 lang=EN-US> command line parameter.</span></p>
275 <p class=MsoNormal><span lang=EN-US> </span></p>
277 <p class=MsoNormal><span lang=EN-US>Positive samples also may be obtained from
278 a collection of previously marked up images. This collection is described by
279 text file similar to background description file. Each line of this file
280 corresponds to collection image. The first element of the line is image file
281 name. It is followed by number of object instances. The following numbers are
282 the coordinates of bounding rectangles (x, y, width, height).</span></p>
284 <p class=MsoNormal><span lang=EN-US> </span></p>
286 <p class=MsoNormal><span lang=EN-US>Example of description file:</span></p>
288 <p class=MsoNormal><span lang=EN-US> </span></p>
290 <p class=MsoNormal><span lang=EN-US>Directory structure:</span></p>
292 <p class=MsoNormal><span class=Typewch><span lang=EN-US>/img</span></span></p>
294 <p class=MsoNormal><span class=Typewch><span lang=EN-US> img1.jpg</span></span></p>
296 <p class=MsoNormal><span class=Typewch><span lang=EN-US> img2.jpg</span></span></p>
298 <p class=MsoNormal><span class=Typewch><span lang=EN-US>info.dat</span></span></p>
300 <p class=MsoNormal><span class=Typewch><span lang=EN-US> </span></span></p>
302 <p class=MsoNormal><span class=Typewch><span lang=EN-US style='font-family:
303 "Times New Roman";font-weight:normal'>File </span></span><span class=Typewch><span
304 lang=EN-US>info.dat:</span></span></p>
306 <p class=MsoNormal><span class=Typewch><span lang=EN-US>img/img1.jpg 1 140
307 100 45 45</span></span></p>
309 <p class=MsoNormal><span class=Typewch><span lang=EN-US>img/img2.jpg 2 100
310 200 50 50 50 30 25 25</span></span></p>
312 <p class=MsoNormal><span lang=EN-US> </span></p>
314 <p class=MsoNormal><span lang=EN-US>Image </span><span class=Typewch><span
315 lang=EN-US>img1.jpg</span></span><span lang=EN-US> contains single object
316 instance with bounding rectangle (140, 100, 45, 45). Image </span><span
317 class=Typewch><span lang=EN-US>img2.jpg</span></span><span lang=EN-US> contains
318 two object instances.</span></p>
320 <p class=MsoNormal><span lang=EN-US> </span></p>
322 <p class=MsoNormal><span lang=EN-US>In order to create positive samples from
323 such collection </span><span class=Typewch><span lang=EN-US>
\96info</span></span><span
324 lang=EN-US> argument should be specified instead of </span><span class=Typewch><span
325 lang=EN-US>
\96img</span></span><span class=Typewch><span style='font-family:"Times New Roman";
326 font-weight:normal'>:</span></span></p>
328 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
329 class=Typewch><span lang=EN-US>- info <collection_file_name></span></span><span
330 lang=EN-US> </span></p>
332 <p class=MsoNormal style='margin-left:17.1pt'><span lang=EN-US>description file
333 of marked up images collection</span></p>
335 <p class=MsoNormal><span lang=EN-US> </span></p>
337 <p class=MsoNormal><span lang=EN-US>The scheme of sample creation in this case
338 is as follows. The object instances are taken from images. Then they are
339 resized to samples size and stored in output file. No distortion is applied, so
340 the only affecting arguments are </span><span class=Typewch><span lang=EN-US>
\96w</span></span><span
341 lang=EN-US>, </span><span class=Typewch><span lang=EN-US>-h</span></span><span
342 lang=EN-US>, </span><span class=Typewch><span lang=EN-US>-show</span></span><span
343 lang=EN-US> and </span><span class=Typewch><span lang=EN-US>
\96num</span></span><span
344 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
345 normal'>.</span></span></p>
347 <p class=MsoNormal><span lang=EN-US> </span></p>
349 <p class=MsoNormal><span class=Typewch><span lang=EN-US>createsamples</span></span><span
350 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
351 normal'> utility may be used for examining samples stored in positive samples
352 file. In order to do this only </span></span><span class=Typewch><span
353 lang=EN-US>
\96vec</span></span><span class=Typewch><span lang=EN-US
354 style='font-family:"Times New Roman";font-weight:normal'>, </span></span><span
355 class=Typewch><span lang=EN-US>
\96w</span></span><span class=Typewch><span
356 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'> and </span></span><span
357 class=Typewch><span lang=EN-US>
\96h</span></span><span class=Typewch><span
358 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'> parameters
359 should be specified.</span></span></p>
361 <p class=MsoNormal><span lang=EN-US> </span></p>
363 <p class=MsoNormal><span lang=EN-US>Note that for training, it does not matter
364 how positive samples files are generated. So the </span><span class=Typewch><span
365 lang=EN-US>createsamples</span></span><span lang=EN-US> utility is only one way
366 to collect/create a vector file of positive samples.</span></p>
368 <h2><span lang=EN-US>Training</span></h2>
370 <p class=MsoNormal><span lang=EN-US>The next step after samples creation is
371 training of classifier. It is performed by the </span><span class=Typewch><span
372 lang=EN-US>haartraining</span></span><span lang=EN-US> utility.</span></p>
374 <p class=MsoNormal><span lang=EN-US> </span></p>
376 <p class=MsoNormal><span lang=EN-US>Command line arguments:</span><span
377 class=Typewch><span lang=EN-US> </span></span></p>
379 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
380 class=Typewch><span lang=EN-US>- data <dir_name></span></span><span
381 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
382 normal'> </span></span></p>
384 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
385 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
386 normal'> directory name in which the trained classifier is stored</span></span></p>
388 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
389 class=Typewch><span lang=EN-US>- vec <vec_file_name></span></span><span
390 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
391 normal'> </span></span></p>
393 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
394 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
395 normal'> file name of positive sample file (created by </span></span><span
396 class=Typewch><span lang=EN-US>trainingsamples</span></span><span
397 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
398 normal'> utility or by any other means)</span></span></p>
400 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
401 class=Typewch><span lang=EN-US>- bg <background_file_name></span></span></p>
403 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
404 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
405 normal'> background description file</span></span></p>
407 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
408 class=Typewch><span lang=EN-US>- npos <number_of_positive_samples>,</span></span></p>
410 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
411 class=Typewch><span lang=EN-US>- nneg <number_of_negative_samples></span></span><span
412 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
413 normal'> </span></span></p>
415 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
416 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
417 normal'> number of positive/negative samples used in training of each
418 classifier stage. Reasonable values are npos = 7000 and nneg = 3000.</span></span></p>
420 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
421 class=Typewch><span lang=EN-US>- nstages <number_of_stages></span></span></p>
423 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
424 class=Typewch><span lang=EN-US> </span></span><span class=Typewch><span
425 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'>number of
426 stages to be trained</span></span></p>
428 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
429 class=Typewch><span lang=EN-US>- nsplits <number_of_splits></span></span><span
430 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
431 normal'> </span></span></p>
433 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
434 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
435 normal'> determines the weak classifier used in stage classifiers. If </span></span><span
436 class=Typewch><span lang=EN-US style='font-family:"Times New Roman"'>1</span></span><span
437 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
438 normal'>, then a simple stump classifier is used, if </span></span><span
439 class=Typewch><span lang=EN-US style='font-family:"Times New Roman"'>2</span></span><span
440 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
441 normal'> and more, then CART classifier with </span></span><span class=Typewch><span
442 lang=EN-US>number_of_splits</span></span><span class=Typewch><span lang=EN-US
443 style='font-family:"Times New Roman";font-weight:normal'> internal (split)
444 nodes is used</span></span></p>
446 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
447 class=Typewch><span lang=EN-US>- mem <memory_in_MB></span></span><span
448 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
449 normal'> </span></span></p>
451 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
452 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
453 normal'> Available memory in MB for precalculation. The more memory you
454 have the faster the training process</span></span></p>
456 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
457 class=Typewch><span lang=EN-US>- sym (default),</span></span></p>
459 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
460 class=Typewch><span lang=EN-US>- nonsym</span></span><span class=Typewch><span
461 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'> </span></span></p>
463 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
464 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
465 normal'> specifies whether the object class under training has vertical
466 symmetry or not. Vertical symmetry speeds up training process. For instance,
467 frontal faces show off vertical symmetry</span></span></p>
469 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
470 class=Typewch><span lang=EN-US>- minhitrate <min_hit_rate></span></span></p>
472 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
473 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
474 normal'> minimal desired hit rate for each stage classifier. Overall hit
475 rate may be estimated as </span></span><span class=Typewch><span lang=EN-US>(min_hit_rate^number_of_stages)</span></span></p>
477 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
478 class=Typewch><span lang=EN-US>- maxfalsealarm <max_false_alarm_rate></span></span><span
479 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
480 normal'> </span></span></p>
482 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
483 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
484 normal'> maximal desired false alarm rate for each stage classifier. </span></span><span
485 class=Typewch><span style='font-family:"Times New Roman";font-weight:normal'>Overall
486 false alarm rate may be estimated as</span></span><span class=Typewch><span
487 lang=EN-US> (max_false_alarm_rate^number_of_stages)</span></span></p>
489 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
490 class=Typewch><span lang=EN-US>- weighttrimming <weight_trimming></span></span></p>
492 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
493 class=Typewch><span lang=EN-US> </span></span><span class=Typewch><span
494 lang=EN-US style='font-family:"Times New Roman";font-weight:normal'>Specifies
495 whether and how much weight trimming should be used. A decent choice is 0.90.</span></span></p>
497 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
498 class=Typewch><span lang=EN-US>- eqw</span></span></p>
500 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
501 class=Typewch><span lang=EN-US>- mode <BASIC (default) | CORE | ALL></span></span><span
502 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
503 normal'> </span></span></p>
505 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
506 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
507 normal'> selects the type of haar features set used in training. BASIC use
508 only upright features, while ALL uses the full set of upright and 45 degree
509 rotated feature set. See [1] for more details.</span></span></p>
511 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
512 class=Typewch><span lang=EN-US>- w <sample_width>,</span></span></p>
514 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
515 class=Typewch><span lang=EN-US>- h <sample_height></span></span><span
516 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
517 normal'> </span></span></p>
519 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
520 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
521 normal'> Size of training samples (in pixels). Must have exactly the same
522 values as used during training samples creation (utility </span></span><span
523 class=Typewch><span lang=EN-US>trainingsamples</span></span><span
524 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
525 normal'>)</span></span></p>
527 <p class=MsoNormal><span class=Typewch><span lang=EN-US style='font-family:
528 "Times New Roman";font-weight:normal'> </span></span></p>
530 <p class=MsoNormal><span class=Typewch><span lang=EN-US style='font-family:
531 "Times New Roman";font-weight:normal'>Note: in order to use multiprocessor
532 advantage a compiler that supports OpenMP 1.0 standard should be used.</span></span></p>
534 <h2><span lang=EN-US>Application</span></h2>
536 <p class=MsoNormal><span lang=EN-US>OpenCV cvHaarDetectObjects() function (in
537 particular haarFaceDetect demo) is used for detection.</span></p>
539 <h3><span lang=EN-US>Test Samples</span></h3>
541 <p class=MsoNormal><span lang=EN-US>In order to evaluate the performance of
542 trained classifier a collection of marked up images is needed. When such
543 collection is not available test samples may be created from single object
544 image by </span><span class=Typewch><span lang=EN-US>createsamples</span></span><span
545 lang=EN-US> utility. The scheme of test samples creation in this case is
546 similar to training samples creation since each test sample is a background
547 image into which a randomly distorted and randomly scaled instance of the
548 object picture is pasted at a random position. </span></p>
550 <p class=MsoNormal><span lang=EN-US> </span></p>
552 <p class=MsoNormal><span lang=EN-US>If both </span><span class=Typewch><span
553 lang=EN-US>
\96img</span></span><span lang=EN-US> and </span><span class=Typewch><span
554 lang=EN-US>
\96info</span></span><span lang=EN-US> arguments are specified then
555 test samples will be created by </span><span class=Typewch><span lang=EN-US>createsamples</span></span><span
556 lang=EN-US> utility. The sample image is arbitrary distorted as it was
557 described below, then it is placed at random location to background image and
558 stored. The corresponding description line is added to the file specified by </span><span
559 class=Typewch><span lang=EN-US>
\96info</span></span><span lang=EN-US> argument.</span></p>
561 <p class=MsoNormal><span lang=EN-US> </span></p>
563 <p class=MsoNormal><span lang=EN-US>The </span><span class=Typewch><span
564 lang=EN-US>
\96w</span></span><span lang=EN-US> and </span><span class=Typewch><span
565 lang=EN-US>
\96h</span></span><span lang=EN-US> keys determine the minimal size of
566 placed object picture.</span></p>
568 <p class=MsoNormal><span lang=EN-US> </span></p>
570 <p class=MsoNormal><span lang=EN-US>The test image file name format is as
573 <p class=MsoNormal><span class=Typewch><span lang=EN-US>imageOrderNumber_x_y_width_height.jpg</span></span><span
574 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
575 normal'>, where </span></span><span class=Typewch><span lang=EN-US>x</span></span><span
576 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
577 normal'>, </span></span><span class=Typewch><span lang=EN-US>y</span></span><span
578 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
579 normal'>, </span></span><span class=Typewch><span lang=EN-US>width</span></span><span
580 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
581 normal'> and </span></span><span class=Typewch><span lang=EN-US>height</span></span><span
582 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
583 normal'> are the coordinates of placed object bounding rectangle.</span></span></p>
585 <p class=MsoNormal><span class=Typewch><span lang=EN-US style='font-family:
586 "Times New Roman";font-weight:normal'>Note that you should use a background
587 images set different from the background image set used during training.</span></span></p>
589 <h3><span class=Typewch><span lang=EN-US style='font-family:"Times New Roman"'>Performance
590 Evaluation</span></span></h3>
592 <p class=MsoNormal><span lang=EN-US>In order to evaluate the performance of the
593 classifier </span><span class=Typewch><span lang=EN-US>performance</span></span><span
594 lang=EN-US> utility may be used. It takes a collection of marked up images,
595 applies the classifier and outputs the performance, i.e. number of found
596 objects, number of missed objects, number of false alarms and other
597 information.</span></p>
599 <p class=MsoNormal><span lang=EN-US> </span></p>
601 <p class=MsoNormal><span lang=EN-US>Command line arguments:</span><span
602 class=Typewch><span lang=EN-US> </span></span></p>
604 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
605 class=Typewch><span lang=EN-US>- data <dir_name></span></span><span
606 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
607 normal'> </span></span></p>
609 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
610 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
611 normal'> directory name in which the trained classifier is stored</span></span></p>
613 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
614 class=Typewch><span lang=EN-US>- info <collection_file_name></span></span><span
615 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
616 normal'> </span></span></p>
618 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
619 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
620 normal'> file with test samples description</span></span></p>
622 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
623 class=Typewch><span lang=EN-US>- maxSizeDiff <max_size_difference></span></span><span
624 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
625 normal'>,</span></span></p>
627 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
628 class=Typewch><span lang=EN-US>- maxPosDiff <max_position_difference></span></span><span
629 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
630 normal'> </span></span></p>
632 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
633 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
634 normal'> determine the criterion of reference and detected rectangles
635 coincidence. Default values are 1.5 and 0.3 respectively.</span></span></p>
637 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
638 class=Typewch><span lang=EN-US>- sf <scale_factor></span></span><span
639 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
640 normal'>,</span></span></p>
642 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
643 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
644 normal'> detection parameter. Default value is 1.2.</span></span></p>
646 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
647 class=Typewch><span lang=EN-US>- w <sample_width>,</span></span></p>
649 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
650 class=Typewch><span lang=EN-US>- h <sample_height></span></span><span
651 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
652 normal'> </span></span></p>
654 <p class=MsoNormal style='margin-left:17.1pt;text-indent:-17.1pt'><span
655 class=Typewch><span lang=EN-US style='font-family:"Times New Roman";font-weight:
656 normal'> Size of training samples (in pixels). Must have exactly the same
657 values as used during training (utility </span></span><span class=Typewch><span
658 lang=EN-US>haartraining</span></span><span class=Typewch><span lang=EN-US
659 style='font-family:"Times New Roman";font-weight:normal'>)</span></span></p>
661 <h2><span lang=EN-US>References</span></h2>
663 <p class=MsoNormal><span lang=EN-US>[1] Rainer Lienhart and Jochen Maydt. An
664 Extended Set of Haar-like Features for Rapid Object Detection. Submitted to
667 <p class=MsoNormal><span lang=EN-US>[2] Alexander Kuranov, Rainer Lienhart, and
668 Vadim Pisarevsky. An Empirical Analysis of Boosting Algorithms for Rapid
669 Objects With an Extended Set of Haar-like Features. Intel Technical Report
670 MRL-TR-July02-01, 2002.</span></p>