user1763100
user1763100

Reputation: 148

Training an OpenCV LBP Classifier

I need to create my own LBP Cascade Classifier using OpenCV, so to get used to the process, I have been using a very small file set, to get the hang of it.

However, I am struggling to find decent information on opencv_traincascade. I set the process running on 87 positive images that were in a .vec file. I realize this is a tiny set and will not be of much use, but I was hoping it might be enough to pickup one of my positive images if I pasted it exactly onto a negative, just to test the theory. However, when I started the training process, the result was that it got to stage 5 and then hung when starting stage 6.

I restarted the process with an even smaller positive set and it did the same thing - for some reason it gets to stage x and freezes on the Neg Count at the start of a training stage, and never recovers.

Does anyone have any ideas or suggestions? Is the problem the tiny size of my training set?

===== TRAINING 0-stage =====
BEGIN
POS count : consumed   6 : 6
NEG count : acceptanceRatio    2600 : 1
Precalculation time: 10.965
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        0|
+----+---------+---------+
END

===== TRAINING 1-stage =====
BEGIN
POS count : consumed   6 : 6
NEG count : acceptanceRatio    2600 : 0.0244943
Precalculation time: 10.985
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        0|
+----+---------+---------+
END

===== TRAINING 2-stage =====
BEGIN
POS count : consumed   6 : 6
NEG count : acceptanceRatio    2600 : 0.000697076
Precalculation time: 11.237
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|0.000384615|
+----+---------+---------+
END

===== TRAINING 3-stage =====
BEGIN
POS count : consumed   6 : 6

Upvotes: 2

Views: 3059

Answers (1)

Graham
Graham

Reputation: 36

I'm in the process of doing something similiar. The train stage can often get locked in a infinite loop and the code needs to be modified to prevent this condition. What parameters are you using for createsamples and traincascade? Try reducing the number of negative images in traincascade initially. This worked for me..

Upvotes: 2

Related Questions