|
@@ -556,7 +556,7 @@ int paperPreIdentify::getBalckAreaCount(Mat& tMat)
|
|
|
|
|
|
}
|
|
|
|
|
|
-PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string> papersVec, string strIp) {
|
|
|
+PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string>& papersVec, string strIp) {
|
|
|
vector<PaperPage> tAllPaperList;
|
|
|
int nPaperSize = papersVec.size();
|
|
|
if(0 == nPaperSize || nPaperSize % 2 != 0)
|
|
@@ -566,6 +566,7 @@ PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string> papersVec, stri
|
|
|
int nGetQrcodeFailCount = 0;
|
|
|
string strFirPagePath;
|
|
|
map<string, int> qrCodeCountMap;
|
|
|
+ map<string, int> qrCodeContentMap;
|
|
|
for(int i = 0; i < nPaperSize; i++)
|
|
|
{
|
|
|
if(i % 2 == 0)
|
|
@@ -592,7 +593,14 @@ PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string> papersVec, stri
|
|
|
tAllPaperList.push_back(tPage);
|
|
|
continue;
|
|
|
}
|
|
|
+ else
|
|
|
+ qrCodeContentMap[strQRCode] = 1;
|
|
|
tPage.qrCode = strQRCode;
|
|
|
+
|
|
|
+ //前五份之内存在如果存在试卷夹带,中止扫描
|
|
|
+ if(i + 1 <= 10 && qrCodeContentMap.size() > 1)
|
|
|
+ return PAPERDOPING;
|
|
|
+
|
|
|
if(qrCodeCountMap.count(strQRCode) == 0)
|
|
|
{
|
|
|
//二维码能正确识别则根据识别出的答题卡ID获取模板信息
|
|
@@ -612,23 +620,28 @@ PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string> papersVec, stri
|
|
|
else
|
|
|
{
|
|
|
//仅记录能够成功获取模板信息的QrCode
|
|
|
+ if(qrCodeCountMap.size() == 0)
|
|
|
+ qrCodeCountMap[strQRCode] = 2;
|
|
|
qrCodeCountMap[strQRCode] = 1;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- int nCount = qrCodeCountMap[strQRCode];
|
|
|
- nCount++;
|
|
|
- qrCodeCountMap[strQRCode] = nCount;
|
|
|
+ //计数加1
|
|
|
+ if(qrCodeCountMap.size() == 1)
|
|
|
+ qrCodeCountMap[strQRCode]++;
|
|
|
}
|
|
|
+#if 0
|
|
|
+ //暂时屏蔽定位点识别逻辑
|
|
|
//模板能正常获取继续走定位点识别流程
|
|
|
bool bFind = findAnchors(tPage);
|
|
|
if(!bFind)
|
|
|
tPage.ePaperStatus = PAPER_INVALIDANCHORS;
|
|
|
+#endif
|
|
|
tAllPaperList.push_back(tPage);
|
|
|
}
|
|
|
}
|
|
|
- map<string, int>::iterator iter = qrCodeCountMap.begin();
|
|
|
+ auto iter = qrCodeCountMap.begin();
|
|
|
int nMaxCount;
|
|
|
string strMaxCountQr = "";
|
|
|
if(!qrCodeCountMap.empty())
|
|
@@ -649,7 +662,6 @@ PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string> papersVec, stri
|
|
|
vector<PaperPage> invAncList;
|
|
|
vector<PaperPage> invQrList;
|
|
|
vector<PaperPage> cannotReadQrList;
|
|
|
-// vector<PaperPage> cannotGetTmpList;
|
|
|
//标记二维码异常(试卷夹带)答题卡
|
|
|
//将异常类型分类存储至map中
|
|
|
for(PaperPage tPaper : tAllPaperList)
|
|
@@ -666,7 +678,6 @@ PAPERIDENTIFYSTATUS paperPreIdentify::preIdentify(vector<string> papersVec, stri
|
|
|
}
|
|
|
m_abnPaperMap[PAPER_INVALIDQRCODE] = invQrList;
|
|
|
m_abnPaperMap[PAPER_INVALIDANCHORS] = invAncList;
|
|
|
-// m_abnPaperMap[PAPER_CANNOTGETTEMPLATE] = cannotGetTmpList;
|
|
|
m_abnPaperMap[PAPER_CANNOTREADQRCODE] = cannotReadQrList;
|
|
|
return FINISHPREIDENTIFY;
|
|
|
}
|