1

So following up from here, I now need to collect negative samples, for cascaded classification using OpenCV. With positive samples, I know that all samples should have the same aspect ratio.

What about negative samples?

Should they all be larger than positive samples (since OpenCV is going to paste positives on top of negatives to create the test images).

Should all be the same size?

Can they be arbitrary sizes?

Should they too have the same aspect ratio among themselves?

Community
  • 1
  • 1
user961627
  • 12,379
  • 42
  • 136
  • 210

1 Answers1

2

From OpenCV doc on Cascade Classifier Training:

Negative samples are taken from arbitrary images. These images must not contain detected objects. [...] Described images may be of different sizes. But each image should be (but not nessesarily) larger then a training window size, because these images are used to subsample negative image to the training size.

herohuyongtao
  • 49,413
  • 29
  • 133
  • 174
  • In general though, what size makes sense for negative images? Are 320x400 images way too large? I mean, should I downsize my images to be at least close to the window size (40x40)? – user961627 Mar 24 '14 at 12:51
  • 1
    @user961627 Making them close will be better for better sampling from the image. – herohuyongtao Mar 24 '14 at 13:18
  • thanks! i hope you don't mind, but, do you have any idea about this follow-up problem? http://stackoverflow.com/questions/22610142/opencv-createsamples-invalid-background-description-file – user961627 Mar 24 '14 at 13:45