3

Hello everybody I have a question about haartraining!Well I have 3000 images with 640x480 sizes for positive images and negative images I want to know If I must crop in smaller sizes like 24x24 or when I set -w and -h parametters in createsample images will be resized??

user3312370
  • 45
  • 1
  • 8

1 Answers1

1

opencv_createsamples utility is used to increase the number of positive samples. Thus a large set of positive images is created from the set of positive data having the background from the set of negative images, rotating the image etc.

Thus the positive image is scaled to (w,h) specified while creating the sample images.

The only care to be taken is that the ratio of width and height must be proportional to that of the positive images for decent results.

Anoop K. Prabhu
  • 5,417
  • 2
  • 26
  • 43
  • if I use background of negative images to create more positive images Do I need other negatives images for training?? – user3312370 Feb 20 '14 at 17:58
  • Yes. Negative images were used as background for positive to make it easier for increasing the count of positive images. During training, the negative images are required because a detected feature should not be present in the negative. This test too done in the training phase. – Anoop K. Prabhu Feb 20 '14 at 18:06
  • But There is not problem If I collect my positive images for my own istand of use createsamples right?? – user3312370 Feb 20 '14 at 18:13
  • If the number of positive images is too high, the better. As we cannot fetch such large number of positive images, it would be better to collect as much possible and use these to increase the count by creating images in which the object is rotated or in a different background etc. – Anoop K. Prabhu Feb 20 '14 at 18:19
  • oooohh I understand!!Another question!!Is a good idea to convert positive and negatives images into grayscales and training Haar cascade?? – user3312370 Feb 20 '14 at 19:26
  • The training is done on grayScale images. The color images that you give will be converted to gray scale. This is the reason why we use grayscale images in detection algorithms that use the trained xml file. – Anoop K. Prabhu Feb 20 '14 at 20:23
  • oohh!!Let me see if I understand!!That means!!I dont have to convert to gray scales by my owns otherwise haartraining will be convert to gray scale right? – user3312370 Feb 20 '14 at 20:41
  • Hey can you tell me what kink of feature extraction(haar, lbp,hog) I can use? – user3312370 Apr 06 '14 at 00:24