| | |
| | | |
| | | // CappDlg 对话框 |
| | | |
| | | RecognitionManager* CappDlg::recognitionManager; |
| | | |
| | | CappDlg::CappDlg(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_APP_DIALOG, pParent) |
| | | { |
| | |
| | | RecognitionUtil::init(); |
| | | ImgUtil::init(); |
| | | capture = new ScreenDataCapture(); |
| | | recognitionManager = new RecognitionManager(); |
| | | } |
| | | |
| | | void CappDlg::DoDataExchange(CDataExchange* pDX) |
| | |
| | | //暂停采集 |
| | | app->capture->stop(index); |
| | | |
| | | bool result = THSActionUtil::setGP(quickCode, codeList); |
| | | bool result = THSActionUtil::setGP(quickCode, codeList, recognitionManager); |
| | | if (!result) { |
| | | throw string("设置版块监控的GP失败"); |
| | | } |
| | | |
| | | THSActionUtil::setListenL2GP(index, code); |
| | | map<int, string> results = THSActionUtil::getListenL2GPCodes(); |
| | | THSActionUtil::setListenL2GP(index, code, recognitionManager); |
| | | map<int, string> results = THSActionUtil::getListenL2GPCodes(recognitionManager); |
| | | //设置代码 |
| | | for (map<int, string>::iterator ele = results.begin();ele != results.end();ele++) { |
| | | int key = (*ele).first; |
| | |
| | | if (!capture->isRunning()) { |
| | | |
| | | try { |
| | | map<int, string> result = THSActionUtil::getListenL2GPCodes(); |
| | | map<int, string> result = THSActionUtil::getListenL2GPCodes(recognitionManager); |
| | | //设置代码 |
| | | for (map<int, string>::iterator ele = result.begin();ele != result.end();ele++) { |
| | | int key= (*ele).first; |
| | |
| | | for (list<CString>::iterator ele = paths.begin();ele != paths.end();ele++) { |
| | | CString path = *ele; |
| | | std:string p = cstring2String(path); |
| | | std::list<string> resultList = THSActionUtil::recognitionGPCode(cv::imread(p)); |
| | | std::list<string> resultList = THSActionUtil::recognitionGPCode(cv::imread(p), recognitionManager); |
| | | for (std::list<string>::iterator ele1 = resultList.begin();ele1 != resultList.end();ele1++) { |
| | | bool contains = false; |
| | | for (std::list<string>::iterator e = fResultList.begin();e != fResultList.end();e++) { |
| | |
| | | for (list<CString>::iterator ele = paths.begin();ele != paths.end();ele++) { |
| | | CString path = *ele; |
| | | std:string p = cstring2String(path); |
| | | std::list<string> resultList = THSActionUtil::recognitionGPCode(cv::imread(p)); |
| | | std::list<string> resultList = THSActionUtil::recognitionGPCode(cv::imread(p), recognitionManager); |
| | | for (std::list<string>::iterator ele1 = resultList.begin();ele1 != resultList.end();ele1++) { |
| | | bool contains = false; |
| | | for (std::list<string>::iterator e = fResultList.begin();e != fResultList.end();e++) { |