From 1a16b19acb23a4f28bafd01f3ed80fb225a96c3e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 30 九月 2022 18:04:12 +0800 Subject: [PATCH] 'bug修复' --- ConsoleApplication/LimitUpCapture.cpp | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ConsoleApplication/LimitUpCapture.cpp b/ConsoleApplication/LimitUpCapture.cpp index ac34154..b218564 100644 --- a/ConsoleApplication/LimitUpCapture.cpp +++ b/ConsoleApplication/LimitUpCapture.cpp @@ -246,8 +246,8 @@ path.append(to_string(i)).append("_").append(to_string(j)).append(".jpg"); //cv::imwrite(path, cv::Mat(grayImg, cv::Rect(sx, sy, ex - sx + 1, ey - sy + 1))); } - int sx = splitResult[(ele_count_per_line * i + 0) * 4 + 0]; - int ex = splitResult[(ele_count_per_line * i + 0) * 4 + 2]; + int sx = splitResult[(ele_count_per_line * i + 1) * 4 + 0]; + int ex = splitResult[(ele_count_per_line * i + 1) * 4 + 2]; if (ex - sx < 40) { //噪点数据 excudeIndexs.insert(i); @@ -338,6 +338,7 @@ } percent.append(to_string(numberResult[i][num_length_per_ele * 4 + j])); } + /* if (percent == "0000.00") { int sx = splitResult[(ele_count_per_line * i + 4) * 4 + 0]; int sy = splitResult[(ele_count_per_line * i + 4) * 4 + 1]; @@ -347,6 +348,7 @@ path.append(to_string(i)).append("_").append(".jpg"); cv::imwrite(path, cv::Mat(grayImg, cv::Rect(sx, sy, ex - sx + 1, ey - sy + 1))); } + */ limitUpData.index = i; limitUpData.code = code; @@ -449,15 +451,21 @@ PostMessage(win, WM_MOUSEWHEEL, 0, MAKEWORD(x, y)); Sleep(200); cv::Mat oimg = CaptureUtil::capture(win); - list<LimitUpData> codes = captureLimitUpCodes(oimg); - for (list<LimitUpData>::iterator ele = codes.begin();ele != codes.end();ele++) { - string code = (*ele).code; - if (codesSet.count(code) == 0) { - codesSet.insert(code); - flist.push_back(*ele); + try { + list<LimitUpData> codes = captureLimitUpCodes(oimg); + for (list<LimitUpData>::iterator ele = codes.begin();ele != codes.end();ele++) { + string code = (*ele).code; + if (codesSet.count(code) == 0) { + codesSet.insert(code); + flist.push_back(*ele); + } } + codes.clear(); } - codes.clear(); + catch (string e) { + cout << e << endl; + } + Sleep(50); } } -- Gitblit v1.8.0