| | |
| | | //同花顺(v9.10.50) - 深圳Level-2分时走势 |
| | | //同花顺(v9.10.50) - pppp |
| | | list<TradeData> map = creenDataCapture->captureLevel2TradeData(cv::imread( "C:\\Users\\Administrator\\Desktop\\ocr\\demo\\0_388.jpg"),p); |
| | | //break; |
| | | break; |
| | | } |
| | | |
| | | return 0L; |
| | |
| | | */ |
| | | |
| | | int main() { |
| | | |
| | | |
| | | //THSActionUtil::openSecondScreen(); |
| | | RecognitionUtil::init(); |
| | | CaptureUtil::init("同花顺(v9.10.50) - 热门股888");// 热门股888 |
| | | ImgUtil::init(); |
| | | ths(); |
| | | |
| | | /* |
| | | RecognitionManager* recognitionManager = new RecognitionManager(); |
| | | |
| | | for (int i = 1;i < 14;i++) |
| | | { |
| | | string path = "C:\\Users\\Administrator\\Desktop\\ocr\\split\\"; |
| | | path.append(to_string(i)).append("_1.jpg"); |
| | | list<cv::Mat> list1 = ImgUtil::splitNum(cv::imread(path.c_str(), cv::IMREAD_GRAYSCALE)); |
| | | list<uchar> resultList= recognitionManager->recognitionGPCode(list1); |
| | | list<uchar>::iterator ele; |
| | | for (ele = resultList.begin();ele != resultList.end();++ele) { |
| | | printf("%d",*ele); |
| | | } |
| | | printf("\n"); |
| | | } |
| | | */ |
| | | |
| | | |
| | | cv::waitKey(0); |
| | | cv::destroyAllWindows(); |
| | | return 0; |
| | | /* |
| | | |
| | | |
| | | |
| | | string path = "C:\\Users\\Administrator\\Desktop\\ocr\\temp.jpg"; |
| | | |
| | |
| | | cv::Mat img = CaptureUtil::capture(HWND(0x00010CA6)); |
| | | cv::imwrite(path, img); |
| | | |
| | | */ |
| | | |
| | | |
| | | //return 0; |
| | | |
| | |
| | | RecognitionUtil::init(); |
| | | CaptureUtil::init("同花顺(v9.10.50) - 热门股888");// 热门股888 |
| | | ImgUtil::init(); |
| | | for (int i = 0;i < 8;i++) |
| | | for (int i = 0;i < 1;i++) |
| | | { |
| | | int* params =(int*) malloc(sizeof(int)); |
| | | *params = i; |
| | |
| | | |
| | | void ths() { |
| | | //00421530 |
| | | cv::Mat img = CaptureUtil::capture(HWND(0x00161728)); |
| | | cv::Mat img = CaptureUtil::capture(HWND(0x00040CAE)); |
| | | img=ImgUtil::grayImage(img); |
| | | cv::imwrite("C:\\Users\\Administrator\\Desktop\\ocr\\bk.jpg",img); |
| | | std::list<GPCodeArea> list= THSActionUtil::recognitionGPCode(img); |
| | | //cv::imwrite("C:\\Users\\Administrator\\Desktop\\ocr\\bk.jpg",img); |
| | | std::list<GPCodeArea> list= THSActionUtil::recognitionGPArea(img); |
| | | std::list<GPCodeArea>::iterator ele; |
| | | RecognitionManager* recognitionManager = new RecognitionManager(); |
| | | int index = 0; |
| | | for (ele = list.begin();ele != list.end();ele++) { |
| | | index++; |
| | | GPCodeArea codeArea = *ele; |
| | | if (codeArea.type == IMG_TYPE_GP) { |
| | | cv::Mat nums = cv::Mat(img,cv::Rect( codeArea.startx, codeArea.starty, codeArea.endx- codeArea.startx+1, codeArea.endy- codeArea.starty+1)); |
| | | std::list<cv::Mat> list2 = ImgUtil::splitNum(nums); |
| | | std::list<uchar> resultList = recognitionManager->recognitionGPCode(list2); |
| | | std::list<uchar>::iterator ele1; |
| | | printf("%d-", index); |
| | | for (ele1 = resultList.begin();ele1 != resultList.end();++ele1) { |
| | | printf("%d", *ele1); |
| | | } |
| | | printf("\n"); |
| | | } |
| | | |
| | | continue; |
| | | |
| | | SetForegroundWindow(HWND(0x00161728)); |
| | | SetFocus(HWND(0x00161728)); |
| | | GPCodeArea codeArea = *ele; |
| | | if (codeArea.type == IMG_TYPE_ADD) { |
| | | RECT rc; |
| | | GetWindowRect(HWND(0x00161728), &rc); |