OpenCV 2.4.9 - Traincascade problems <p>I use OSX 10.11. I'm new to opencv and I'm trying to train a simple (and surely weak) cascade classifier to detect an object. I have already read several answers, posts, guide, docs and tutorials about cascade classifier but I have some problems. I referred to this guide:</p> <p><a href="http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html" rel="nofollow noreferrer">guide</a></p> <p>That follow opencv doc. Now I have 8 jpg with my interest object and 249 background images (I know that it's a poor dataset but it's only an attempt).</p> <p>When I call opencv_createsamples I noticed the author of guide generate 1500 samples and also I do it. It means that generate 1500 samples from my 8 positive images?</p> <pre><code>perl bin/createsamples.pl positives.txt negatives.txt samples 1500 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40" </code></pre> <p>Note that in sample folder I have only 7 img*.jpg.vec file. They would not be 1500? After when I call:</p> <pre><code>g++ `pkg-config --libs --cflags opencv` -I. -o mergevec mergevec.cpp cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp cvhaartraining.cpp -lopencv_core -lopencv_calib3d -lopencv_imgproc -lopencv_highgui -lopencv_objdetect </code></pre> <p>I have some errors because missing "OpenCL" "AppKit" "QuartzCore" "QTKit" "Cocoa". Where I can retrieve these? However I'm tried to continue and I generate samples.vec file.</p> <pre><code>find ./samples -name '*.vec' &gt; samples.txt ./mergevec samples.txt samples.vec </code></pre> <p>Finally I train my classifier with this code:</p> <pre><code>opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000 -numNeg 249 -featureType LBP -w 80 -h 40 -precalcValBufSize 2048 -precalcIdxBufSize 4096 </code></pre> <p>After read some posts I've choosen -numPos smaller than 1500 samples previously generated (but where are they?). When I start the training, the one stuck in this situation:</p> <p><a href="https://i.stack.imgur.com/iYs1D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iYs1D.png" alt="terminal"></a></p>