Ask Your Question
0

error while loading haar classifier

asked 2013-06-20 12:27:51 -0600

VoidMee gravatar image

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 ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-06-20 15:33:42 -0600

berak gravatar image

updated 2013-06-20 15:34:45 -0600

the training terminates, when one of Max_false_alarm_rate or Min_hit_rate is reached.

this happened to you already at stage 2, probably , because your Max_false_alarm_rate: 0.500000 is too high. it would also mean, that you're happy with a 50% false alarms.

make that a much smaller value, try 0.1, or 0.05 even

something in the order of : Max_false_alarm rate = 1 - Min_hit_rate would make sense to me

edit flag offensive delete link more

Comments

thanx a lot, but can you tell how to know my how much my Max_false_alarm_rate should be

VoidMee gravatar imageVoidMee ( 2013-06-22 21:48:15 -0600 )edit

Question Tools

Stats

Asked: 2013-06-20 12:27:51 -0600

Seen: 1,374 times

Last updated: Jun 20 '13