About image backgrounds while preparing training dataset for cascaded classifier

江枫思渺然 提交于 2019-12-20 04:16:17

问题


I have a question about preparing the dataset of positive samples for a cascaded classifier that will be used for object detection.

As positive samples, I have been given 3 sets of images:

  1. a set of colored images in full size (about 1200x600) with a white background and with the object displayed at a different angles in each image
  2. another set with the same images in grayscale and with a white background, scaled down to the detection window size (60x60)
  3. another set with the same images in grayscale and with a black background, scaled down to the detection window size (60x60)

My question is that in set 1, should the background really be white? Should it not instead be an environment that the object is likely to be found in in the testing dataset? Or should I have a fourth set where the images are in their natural environments? How does environment figure into the training samples?


回答1:


The background should be a typical environment of the object, because when you actually try to detect the objects, the search window will always include some of the background. The best thing is to crop the objects from natural images.

If you use the trainCascadeObjectDetector function in MATLAB, you do not even have to crop the samples. It lets you specify multiple bounding boxes per image. You also do not have to worry about the size of the samples, because trainCascadeObjectDetector will resize them for you.

There is a very handy GUI app on MATLAB file exchange for labeling objects of interest in images designed for use with trainCascadeObjectDetector.

Edit: couple of other points. Your negative images should also contain backgrounds typically associated with your objects of interest. Here is a tutorial that explains how to prepare training data and how to set some of the parameters.



来源:https://stackoverflow.com/questions/19921820/about-image-backgrounds-while-preparing-training-dataset-for-cascaded-classifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!