8进5预警处理
題:在圖像處理中,如果發現有危險標為1,否則標為0. 在圖像處理中可能出現誤報。因此采用8進5的方法,即前8里面有5個預警,我們就返回預警信息.
#include <iostream> #include<queue> using namespace std;queue<int>A; int index = 0; void output(int a) {while (true){if (A.size() != 8){if (a == 1)index++;A.push(a);}else{if (A.front()==0){A.pop();}else if(A.front()==1){index--;A.pop();}if (a == 1)index++;A.push(a);}if (index == 5){cout << "出現預警" << endl;return;}}}?
總結
- 上一篇: 一周换手率超过100%说明什么?
- 下一篇: 宏定义细节