比较opencv中n帧的输出

时间:2014-01-31 09:31:49

标签: c++ algorithm

我想比较在输出中重复最少8次的数字,即

假设我的输出= 3对于接下来的8帧是相同的,那么我需要输出为3,

  

输出= 3   输出= 3   输出= 3   输出= 3   输出= 3   输出= 3   输出= 3

我使用opencv和c ++语言,任何帮助

1 个答案:

答案 0 :(得分:0)

问题不明确。我想你想要的是这样的:

int triggerVal;
int triggerCount = 0;
for()
{
    //output obtained.
    if(triggerVal != output)
    {
        triggerVal = output;
        triggerCount = 1;
    }
    else
        triggerCount++;

    if(triggerCount>8)
        printf("%d\n",triggerVal);
}