问题描述
我正在尝试自己的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 numPosBecause: 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可以为负数吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!