Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You have to create your own training set (positive and negative(background) images). opencv_createsamples prepares your positive images for traincascade. If you want to detect cars in the images, you should crop N images of cars saved as .png or .jpg. And make a list of them and with opencv_createsamples make a .vec file which traincascade use. Negative (background) images are images that doesn't contain object you want to detect, in this case car. It can be anything you want (flowers, empty road, sky, wood, people...) but it's better if it was the environment you expect to find your cars (road, parking place...).

So to answer your questions:

  1. it's not used for creating positive samples. it's used to help your traincascade to learn what is not a car.

  2. background images are not used to create .vec file of positive images. Only positives images (images of cars) are needed.

  3. i not sure what are you trying to say here but negative images should be without object you are trying to detect.

  4. You have to create by your own positive and negative images and make a list of each in .txt file with correct path.