# Traincascade parameters -> -numPos and -numNeg

Hi , I' m tring to understand what -numNeg and -numPos are , indeed i read some Q&A (here for exemple) which helped me a lot ,but I m still confused conserning -numNeg, infact I read from @StevenPuttemans ( here) that -numNeg is not the exact number of my Negative images:

I get the impression you are mixing up the concept of negative images (which is gathered manually) and negative windows (which are indicated by -numNeg and which are automatically retrieved from the negative set you supplied at model size).

So i now know was -numNeg is not but I can't get what -numNeg is ^^

Looking forward to your andswers, Regards , Luc

edit retag close merge delete

Sort by » oldest newest most voted

You have a set of background images, which you input when running the training algorithm, and they're used as negative images. However these images are not use as they are, i. e. a full complete image is not taken. Instead, the algorithm chooses windows of these images, of the appropriate size (the size of the positive images). That means that a single background image will be used as many negative smaller images (supposing it's bigger than positive samples, what it's normally true). So, the -numNeg parameters indicates the number of windows taken, and not the number of real input background images

more

While training a cascade, we use more negative image samples as compared to positive images. The reason behind doing so is enabling the cascade to reject non-object region easily and thus reducing false detection and increasing computational efficiency. While training the cascade, we decide the window size. The cascade can detect objects with minimum size that of window. Also, it randomly picks samples of window size from the negative images. So you could have only 1000 unique negative images of 500 X 500 but -numNeg could be 10000 or more with window size of 50 X 50. This helps having more negative samples withoutthe need of having unique negative images. Hope this clears stuff!

more

1

The window-sized samples are not chosen randomly but sequentially.

( 2015-05-24 12:18:52 -0500 )edit

Like Lorena said, both by me and others the mistake has been made that the sampling is random, which is not the case! It is a full sequential process.

( 2015-05-27 08:09:12 -0500 )edit

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2015-05-22 08:50:35 -0500

Seen: 2,290 times

Last updated: May 24 '15