Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Minimize False Positives using opencv_traincascade

I am using opencv to detect a brand logo in different possible orientations.

1) Since the logo is a constant image, I used opencv_createsamples with a single logo image. I had used the default value for the -num parameter ( which amounts to 1000). My syntax is as below: opencv_createsamples -img ../brandname.jpg -vec brandnamew100h30.vec -w 100 -h 30

I created a VEC file with parameter of width 100 and height 30. The actual image dimensions are bigger than the size used here. Note that I am NOT using the background images for the sample creation. The sample creation will just contain the brands and not the background.

2) I am then using the opencv_traincascade to train this VEC file. opencv_traincascade -data "brandxml" -vec brandnamew100h30.vec -bg ../tobmp/neglist.txt -numPos 600 -numNeg 300 -w 100 -h 30 -featuretype LBP

The bg file here is just random background images and not relevant to where the brand might appear (in the test video below) When I try to match images/videos using the resultant xml, I am getting a lot of false positives.

Any suggestions on how to decrease the false positives?

Karthik