以下为掉帧算法的定义部分(Frame.hpp)
#include <deque>
#include <iostream>
static std::deque<ArmorBox> HistoryTarget;
bool IsUnidentify = false;//掉帧常数,true为目标曾被识别到 false为目标曾未被识别到
int unidentify_= 0; //掉帧数
int unidentify_num = 0; //掉帧系数
const int unidentified_threshold = 3; //掉帧系数最小值(超过则为掉帧)
const int not_unidentify_threshold = 10; //掉帧数最大值(超过则不为掉帧)
int drop = 0;
bool Framedrop(const ArmorDetector &armorDetector){
if (armorDetector.state == ARMOR_FOUND){//当前帧识别到目标
if(IsUnidentify == true)//目标曾未别识别过
{
if(unidentify_ <= not_unidentify_threshold)//掉帧数小于等于掉帧数最大值(排除掉帧过多失去目标的状态)
{
unidentify_num++;
cout<<"掉帧系数"<<unidentify_num<<endl;
unidentify_ = 0;
if(unidentify_num > unidentified_thres