Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 260a85a

Browse files
committed
Update documentation
1 parent 601deba commit 260a85a

4 files changed

Lines changed: 46 additions & 30 deletions

File tree

doc/motionplus_build.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<link href="motionplus.png" rel="icon" type="image/png">
6-
<title>Motion</title>
6+
<title>MotionPlus</title>
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<link rel="stylesheet" type="text/css" href="motionplus_stylesheet.css" media="screen">
99
<script>

doc/motionplus_examples.html

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ <h3><a name="Examples"></a> Examples</h3>
5454
<li> <a href="#haar_setup">Haar setup</a></li>
5555
<li> <a href="#hog_setup">HOG setup</a></li>
5656
<li> <a href="#dnn_setup">DNN setup</a></li>
57-
57+
<li> <a href="#haar_train">Haar Model Training</a></li>
5858
<p></p>
5959
<p></p>
6060
</ul>
@@ -309,6 +309,50 @@ <h3><a name="dnn_setup"></a>DNN setup</h3>
309309

310310
</ul>
311311

312+
<h3><a name="haar_train"></a>Haar Model Training</h3>
313+
<ul>
314+
The OpenCV documentation is the definitive source for instructions on how to train
315+
a Haar model. This brief introduction only provides a few scripts that may be
316+
helpful in using MotionPlus to get positive and negative images to feed into the
317+
training process.
318+
<br>
319+
<br>Start with creating positive images movie as input file.
320+
<br>Run with picture_output_motion roi
321+
<br>Remove any pictures that are not desired.
322+
<br>Run the script to create the positive file list
323+
<br>Run while in the directory with the positive images.
324+
<small><code><ul>
325+
opencv_createsamples -vec posfiles.vec -info poslist.txt -num 350 -h 96 -w 96
326+
</ul></code></small>
327+
Next get a sample file that does not have desired positives.
328+
<br>Change to picture_output on and turn off motion roi
329+
<br>Change threshold to tiny number and run to create negatives
330+
<small><code><ul>
331+
opencv_traincascade -data ./model -vec ./pos/posfiles.vec -bg neglist.txt -numPos 350 -numNeg 325
332+
</ul></code></small>
333+
The following are the simple scripts to create positive and negative list files for training
334+
<small><small><code>
335+
<ul>
336+
!/bin/bash
337+
<br>FILES=./pos/*.jpg
338+
<br>for FULLNAME in $FILES
339+
<br>do
340+
<br>HW=$(identify -format '%w %h' $FULLNAME)
341+
<br>printf "$FULLNAME 1 0 0 $HW \n" >>poslist.txt
342+
<br>done
343+
</ul>
344+
<ul>
345+
<br>!/bin/bash
346+
<br>FILES=./neg/*.jpg
347+
<br>for FULLNAME in $FILES
348+
<br>do
349+
<br> printf "$FULLNAME \n" >>neglist.txt
350+
<br>done
351+
</ul>
352+
</code></small></small>
353+
354+
</ul>
355+
312356

313357
</section>
314358
</body>

scripts/haar_neg.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

scripts/haar_pos.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)