简体   繁体   English

创建一个简单的级联所需的正负图像数量

[英]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 我需要多少个正样本和多少个负样本才能识别出此图片上的3个贴纸之一所示的模式: http : //i.expansys.com/i/b/b199956.jpg

Note: that I'm talking about samples for creating a HaarCascade file in xml for OpenCV 注意:我在谈论的是在OpenCV的xml中创建HaarCascade文件的示例

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). 旋转方向为16个方向(人类的感知极限,像这样的大多数模板匹配算法对+/- 10度敏感)。 Any other factors will increase sample requirements multiplicatively. 任何其他因素都会成倍增加样品需求量。

That said, I'm not sure Haar Cascades are an appropriate solution. 就是说,我不确定Haar Cascades是否合适。 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. 通过使用Haar Cascades,您将丢弃许多现有的丰富色彩信息。

Consider the following approach: 考虑以下方法:

  1. Some edge detection (Canny, Sobel, pick your poison) 一些边缘检测(Canny,Sobel,选择毒药)
  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. 做颜色直方图来区分这三个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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