如何创建自定义 haar 分类器?
我正在努力创建一个自定义 haar 分类器。我在网上找到了一些教程,但他们没有指定他们使用的是哪个版本的 opencv。我需要的是一个非常简洁和简化的所需步骤示例,以及一个简单的图像数据集。我还需要知道 opencv 版本和操作系统平台,以便我可以让它运行。我在 Windows 和 Linux 上尝试了 opencv 版本的矩阵,并且在内存错误之后遇到了内存错误。我想从一组已知的良好数据和简单命令开始,然后再扩展它以适应我的问题。
感谢您的帮助, 克里斯
I am struggling to create a custom haar classifier. I have found a couple tutorials on the web, but they do not specify which version of opencv they are using. What I need is a very concise and simplified example of the steps that are required, along with a simple dataset of images. I also need to know the opencv version and the OS platform so I can get it running. I have tried a matrix of opencv versions on both windows and linux and I have run into memory error after memory error. I would like to start with a known good set of data and simple commands before expanding it to fit my problem.
Thanks for your help,
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OpenCV 提供了两个实用命令
createsamples.exe
和haartraining.exe
,它们可以生成 Haar 分类器使用的 xml 文件。也就是说,通过haartraining.exe
输出的xml文件,您可以直接将人脸检测示例与您的xml文件一起使用来检测任何自定义对象。关于命令的详细使用过程,可以参考《学习OpenCV》一书第513-516页,或者本教程。
关于分类器工作的内部机制,可以参考论文"使用简单的增强级联进行快速物体检测
特征”,已被引用5500+次。
OpenCV provides two utility commands
createsamples.exe
andhaartraining.exe
, which can generate xml files used by Haar Classifiers. That is, with the xml file outputted fromhaartraining.exe
, you can directly use the face detection sample with your xml file to detect any customized objects.About the detailed procedures to use the commands, you may consult Page 513-516 in the book "Learning OpenCV", or this tutorial.
About the internal mechanism of how the classifier works, you may consult the paper "Rapid Object Detection using a Boosted Cascade of Simple
Features", which has been cited 5500+ times.