maoyehu 2 years ago
parent
commit
b72e98116d
1 changed files with 6 additions and 5 deletions
  1. 6 5
      MFCApplication1/CvxText.cpp

+ 6 - 5
MFCApplication1/CvxText.cpp

@@ -738,6 +738,7 @@ int cutPaper(int pageNum, std::string strJsonPath, std::string strPaperPath, std
 		cv::Mat cut = src(rc_ansInfo);
 		cv::imwrite(szJpgPath, cut);
 
+		int index = 1;
 		for (auto& iter : vecTranslate)
 		{
 			cv::Rect rcOcr = std::get<0>(iter);
@@ -746,10 +747,10 @@ int cutPaper(int pageNum, std::string strJsonPath, std::string strPaperPath, std
 			{
 				char szOcrJpgPath[MAX_PATH] = { 0 };
 				char szOcrJpgText[MAX_PATH] = { 0 };
-				sprintf(szOcrJpgPath, "%s\\%s\\%d_%s_%ld_%d_%d_%d_%d.jpg", strSavePath.c_str(), ret ? "abnormal_small" : "normal_small", pageNum, id.c_str(), dwCount,
-					rcOcr.x - rc_ansInfo.x, rcOcr.y - rc_ansInfo.y, rcOcr.width, rcOcr.height);
-				sprintf(szOcrJpgText, "%s\\%s\\%d_%s_%ld_%d_%d_%d_%d.txt", strSavePath.c_str(), ret ? "abnormal_small" : "normal_small", pageNum, id.c_str(), dwCount,
-					rcOcr.x - rc_ansInfo.x, rcOcr.y - rc_ansInfo.y, rcOcr.width, rcOcr.height);
+				sprintf(szOcrJpgPath, "%s\\%s\\%d_%s_%ld_%d_%d_%d_%d_%d.jpg", strSavePath.c_str(), ret ? "abnormal_small" : "normal_small", pageNum, id.c_str(), dwCount,
+					rcOcr.x - rc_ansInfo.x, rcOcr.y - rc_ansInfo.y, rcOcr.width, rcOcr.height, index);
+				sprintf(szOcrJpgText, "%s\\%s\\%d_%s_%ld_%d_%d_%d_%d_%d.txt", strSavePath.c_str(), ret ? "abnormal_small" : "normal_small", pageNum, id.c_str(), dwCount,
+					rcOcr.x - rc_ansInfo.x, rcOcr.y - rc_ansInfo.y, rcOcr.width, rcOcr.height, index);
 
 				CFile zip3;
 				zip3.Open(CA2T(szOcrJpgText), CFile::modeCreate | CFile::modeWrite);
@@ -759,7 +760,7 @@ int cutPaper(int pageNum, std::string strJsonPath, std::string strPaperPath, std
 				cv::Mat cut = src(rcOcr);
 				cv::imwrite(szOcrJpgPath, cut);
 
-				break;
+				index++;
 			}
 		}
 	}