why does opencv_createsamlples only create 1000 sample vector file

asked 2020-07-03 16:09:56 -0500

I created 26,640 positive images from a collection of 20 object images and 1350 negative images. I ran opencv_create samples 20 times, each time using the same 1350 negative images. The result was a collection of 26,640 positive images and 20 info.lst files. I concatenated all of the the .lst files into a single list file called info-t.lst, it contains a description line for all 26,640 unique positive images in the pos directory.

When I attempt to create the vector file from the 26,640 images and the info-t.lst file, only 1000 samples are created. Is num = 1000 the maximum? I can't find any documentation to indicate that is the case. Here is the command line I am using to create the vector file.

opencv_createsamples -info pos/info-t.lst -w 30 -h 40 -vec -num 26640 positives.vec

edit retag flag offensive close merge delete


broken cmdline, -vec expects a filename arg, so it gulps up -num for this, and ignores your number, falling back to the default of 1000. if at all, use:

opencv_createsamples -info pos/info-t.lst -w 30 -h 40 -vec positives.vec -num 26640

what's in your info files ? shouldn't there be filenames and boxes ? you generate vecs before, not files on disk, or do you ?

berak gravatar imageberak ( 2020-07-04 02:42:06 -0500 )edit

ignore the above, let's start at the beginning:

which kind of object do you try to train this on ?

is it even feasible to train a cascade on this ? (mostly, it isn't, so XY problem)

berak gravatar imageberak ( 2020-07-04 02:42:56 -0500 )edit