3

I recently got into opencv and have realized that making synthetic samples with one positive image and many negative images aren't super accurate. Having read the documentation and some other blogs and tutorials, I realize that there is a way to use more than 1 positive image to make synthetic positive images. My question is, how do I use (for example) 3 positive images and use the opencv_createsamples to make the rest of the samples.

Thanks in advance!

  • afaik, the typical approach is to use the create_samples tools for each input set individually and merge the .vec files afterwards. – Micka Aug 02 '18 at 20:23
  • How do I actually merge these vector files? I have seen other forums that tell to do this but they lack a proper explanation. Can you please elaborate? How do I go about merging these files? – Rohan Harish Aug 02 '18 at 20:26
  • 1
    never done it, I only use individual samples. There should be a project online somewhere. Maybe this one: https://github.com/wulfebw/mergevec – Micka Aug 02 '18 at 20:33
  • Thank you for the quick response! I will give this a try. If it works please make this an answer so I can mark it as the answer. – Rohan Harish Aug 02 '18 at 20:35

1 Answers1

0

I worked with cascade-classifiers the process is very simple but you need a lot of training data! Basically you'll need a set of positive samples(that includes the Object that you want to scan) and a set negative samples(that NOT contains the object that you want to scan).

EXAMPLE: Supposing you want to scan potholes using opencv and an haar cascade-classifier: you'll need a set of images of streets that contains potholes(positive samples) and a set of image of streets that NOT contains potholes(negative samples).

I leave you a link that helped me so much: http://www.academia.edu/9149928/A_complete_guide_to_train_a_cascade_classifier_filter

This example uses a GitHub project i here's the link: https://github.com/sauhaardac/Haar-Training

Hope to be helpful, bye :D

Roberto Manfreda
  • 2,345
  • 3
  • 25
  • 39