简体   繁体   中英

Number of positive and negative images needed to create a simple haarcascade

How many positive and how many negative samples will I need to recognize a pattern like one of the 3 stickers on this picture: http://i.expansys.com/i/b/b199956.jpg

Note: that I'm talking about samples for creating a HaarCascade file in xml for OpenCV

Thx! Antoine

Experimentation would be key. Hundreds would be a reasonable first guess for building proper rotational and translational invariances. Rotation would be 16 orientations (human perception limit, most template matching algorithms like these are sensitive to approx. +/- 10 degrees). Any other factors will increase sample requirements multiplicatively.

That said, I'm not sure Haar Cascades are an appropriate solution. They typically take advantage of the grey scale contrast to perform detection. The rotational and translation invariance is also built in via brute force.

By using Haar Cascades, you're throwing away a lot of the rich color information that you have.

Consider the following approach:

  1. Some edge detection (Canny, Sobel, pick your poison)
  2. Hough transform to solve for orientation of the rectangles
  3. Normalize and crop the patterns.
  4. Do color histogramming to discriminate between the three.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM