For several days I am have been trying to build my own object classification program using Python-Open cv and Haar Cascade.
After creating the samples, here is how train the system:
opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 12 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000 -numNeg 600 -w 50 -h 50 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024
and after stage 8 I have received this output
===== TRAINING 8-stage =====
<BEGIN
POS count : consumed 1000 : 1000
NEG count : acceptanceRatio 600 : 0.00221078
Precalculation time: 10
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 0.898333|
+----+---------+---------+
| 4| 1| 0.916667|
+----+---------+---------+
| 5| 1| 0.691667|
+----+---------+---------+
| 6| 1| 0.681667|
+----+---------+---------+
| 7| 1| 0.518333|
+----+---------+---------+
| 8| 1| 0.626667|
+----+---------+---------+
| 9| 1| 0.441667|
+----+---------+---------+
===== TRAINING 9-stage =====
<BEGIN
POS count : consumed 1000 : 1000
NEG count : acceptanceRatio 0 : 0
Required leaf false alarm rate achieved. Branch training terminated.
However the trained model does not detect any object (watch in this case). I am stucked and don't know how to solve this out. Any useful ideas are appreciated greatly.
Your desired parameters were acheived: "-minHitRate 0.999 -maxFalseAlarmRate 0.5".
You have (according the table you show above): HitRate=1 and FalseAlarmRate=0.441667, that's why training stopped.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.