Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

error while loading haar classifier

HHello, I want to use haar cascade to detect a object. So I collected large image dataset. At first I created a classifier for less stage, which correctly creaed a classifier file. But when I load this classifier the process stops at the current step of loading classifier. The program smoothly runs when given another xml classifier. Look:

C:\TrainingDatas>opencv_haartraining -data haarcascade -vec myvec.vec -bg negatives.txt -npos 2726 -nneg 4925 -nstages 3 Data dir name: haarcascade Vec file name: myvec.vec BG file name: negatives.txt, is a vecfile: no Num pos: 2726 Num neg: 4925 Num stages: 3 Num splits: 1 (stump as weak classifier) Mem: 200 MB Symmetric: TRUE Min hit rate: 0.995000 Max false alarm rate: 0.500000 Weight trimming: 0.950000 Equal weights: FALSE Mode: BASIC Width: 24 Height: 24 Applied boosting algorithm: GAB Error (valid only for Discrete and Real AdaBoost): misclass Max number of splits in tree cascade: 0 Min number of positive samples per cluster: 500 Required leaf false alarm rate: 0.125

Tree Classifier Stage +---+ | 0| +---+

Number of features used : 85848

Parent node: NULL

* 1 cluster * POS: 2726 2726 1.000000 NEG: 4925 1 BACKGROUND PROCESSING TIME: 0.48 Precalculation time: 0.69 +----+----+-+---------+---------+---------+---------+ | N |%SMP|F| ST.THR | HR | FA | EXP. ERR| +----+----+-+---------+---------+---------+---------+ | 1|100%|-|-0.619577| 1.000000| 1.000000| 0.147955| +----+----+-+---------+---------+---------+---------+ | 2|100%|+|-0.786546| 1.000000| 1.000000| 0.147955| +----+----+-+---------+---------+---------+---------+ | 3|100%|-|-1.135068| 1.000000| 1.000000| 0.147170| +----+----+-+---------+---------+---------+---------+ | 4| 89%|+|-1.409561| 1.000000| 1.000000| 0.108744| +----+----+-+---------+---------+---------+---------+ | 5| 92%|-|-1.841712| 1.000000| 1.000000| 0.110574| +----+----+-+---------+---------+---------+---------+ | 6| 89%|+|-1.445023| 0.998899| 0.682234| 0.107568| +----+----+-+---------+---------+---------+---------+ | 7| 93%|-|-1.126912| 0.995965| 0.332183| 0.073454| +----+----+-+---------+---------+---------+---------+ Stage training time: 1973.78 Number of used features: 7

Parent node: NULL Chosen number of splits: 0

Total number of splits: 0

Tree Classifier Stage +---+ | 0| +---+

0

Parent node: 0

* 1 cluster * POS: 2715 2726 0.995965 NEG: 4905 0.338579 BACKGROUND PROCESSING TIME: 1.20 Precalculation time: 0.73 +----+----+-+---------+---------+---------+---------+ | N |%SMP|F| ST.THR | HR | FA | EXP. ERR| +----+----+-+---------+---------+---------+---------+ | 1|100%|-|-0.547500| 1.000000| 1.000000| 0.181627| +----+----+-+---------+---------+---------+---------+ | 2|100%|+|-0.656821| 1.000000| 1.000000| 0.181627| +----+----+-+---------+---------+---------+---------+ | 3|100%|-|-1.274177| 1.000000| 1.000000| 0.139764| +----+----+-+---------+---------+---------+---------+ | 4|100%|+|-1.660406| 1.000000| 1.000000| 0.158661| +----+----+-+---------+---------+---------+---------+ | 5|100%|-|-1.263998| 0.996317| 0.657085| 0.112467| +----+----+-+---------+---------+---------+---------+ | 6| 77%|+|-1.326653| 0.997422| 0.639551| 0.118110| +----+----+-+---------+---------+---------+---------+ | 7| 80%|-|-1.121162| 0.995212| 0.496228| 0.103018| +----+----+-+---------+---------+---------+---------+ Stage training time: 1953.28 Number of used features: 7

Parent node: 0 Chosen number of splits: 0

Total number of splits: 0

Tree Classifier Stage +---+---+ | 0| 1| +---+---+

0---1

Parent node: 1

* 1 cluster * POS: 2702 2726 0.991196 NEG: 4881 0.178935 BACKGROUND PROCESSING TIME: 1.05 Precalculation time: 0.48 +----+----+-+---------+---------+---------+---------+ | N |%SMP|F| ST.THR | HR | FA | EXP. ERR| +----+----+-+---------+---------+---------+---------+ | 1|100%|-|-0.502708| 1.000000| 1.000000| 0.202690| +----+----+-+---------+---------+---------+---------+ | 2|100%|+|-0.419535| 0.997039| 0.871543| 0.193987| +----+----+-+---------+---------+---------+---------+ | 3| 91%|-|-1.223766| 1.000000| 0.981561| 0.154292| +----+----+-+---------+---------+---------+---------+ | 4| 98%|+|-1.429344| 1.000000| 0.981561| 0.133325| +----+----+-+---------+---------+---------+---------+ | 5| 82%|-|-0.942375| 0.997039| 0.771358| 0.184096| +----+----+-+---------+---------+---------+---------+ | 6| 80%|+|-1.131326| 0.997039| 0.771563| 0.138336| +----+----+-+---------+---------+---------+---------+ | 7| 80%|-|-1.204775| 0.995189| 0.656423| 0.107345| +----+----+-+---------+---------+---------+---------+ | 8| 81%|+|-1.389244| 0.995189| 0.627330| 0.091784| +----+----+-+---------+---------+---------+---------+ | 9| 78%|-|-1.430342| 0.995189| 0.504610| 0.098642| +----+----+-+---------+---------+---------+---------+ | 10| 75%|+|-1.433879| 0.995189| 0.489654| 0.087564| +----+----+-+---------+---------+---------+---------+ Stage training time: 8688.43 Number of used features: 10

Parent node: 1 Chosen number of splits: 0

Total number of splits: 0

Tree Classifier Stage +---+---+---+ | 0| 1| 2| +---+---+---+

0---1---2

Parent node: 2

* 1 cluster * POS: 2689 2726 0.986427 NEG: 4858 0.114397 BACKGROUND PROCESSING TIME: 2.64 Required leaf false alarm rate achieved. Branch training terminated. Total number of splits: 0

Tree Classifier Stage +---+---+---+ | 0| 1| 2| +---+---+---+

0---1---2

Cascade performance POS: 2689 2726 0.986427 NEG: 4858 0.120292 BACKGROUND PROCESSING TIME: 2.75

Don't what's the error