在Haar级联训练中numPos可以为负数吗 [英] Can numPos be a Negative Number in Haar Cascade Training

查看:125
本文介绍了在Haar级联训练中numPos可以为负数吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自己的haar级联分类器,我有2139个正像,但是我有16000个负像,对吗?所以我有一个负的numPos 因为: numPos< =(正样本-负样本)/(1+(阶段数-1)(1-命中率))) 所以: (2139-16000)/(1+(17-1)(1-0.995))=-12834 这是正常的吗?

I am trying my own haar cascade classifier I have 2139 positive images However I have 16000 negative images This is right ? And so I have a negative numPos Because: numPos<=(Positive samples-negative samples)/(1+(stages number-1)(1-minhitrate))) so: (2139-16000)/(1+(17-1)(1-0.995))=-12834 This is normal??

推荐答案

否,numPos与您的阴性样本无关. numPos是您要在每个阶段中使用的正数.这一定要比阳性样本总数少一点,因为在每个阶段,您都会丢失所有假阴性(=分类器错误地不再检测到的阳性样本).

no, numPos has nothing to do with your negative samples. numPos is the number of positives you want to use in each stage. This must be a bit lower than your total number of positive samples because you'll lose all the false negatives ( = positive samples which are falsely not detected anymore by the classifier) in each stage.

例如,如果将numPos设置为1000,将minHitRate设置为0.999,则每个阶段最多丢失1个正样本(1000-1000 * 0.999).因此,如果要计算2个阶段,则在选择numPos = 1000时最多需要1001个样本.

For example if you sr numPos to 1000 and minHitRate to 0.999 you lose up to 1 positive sample (1000 - 1000*0.999) in each stage. So if you want to compute 2 stages you'll need up to 1001 samples when choosing numPos = 1000.

在20个阶段中,我大致选择numPos作为我的阳性样本的90%,尽管对于minHitRate 0.999而言过于悲观(非常适合0.995).如果要计算最佳/最大保存值,则openCV Q& A中有一个公式.

For 20 stages I roughly choose numPos to be 90% of my positive samples although that is too pessimistic for minHitRate 0.999 (fits 0.995 quite well afair). There is a formula in the openCV Q&A if you want to compute the best/max save value.

这篇关于在Haar级联训练中numPos可以为负数吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆