| | |
| | | ImgUtil::init(); |
| | | OpenCLExcuter* openCLExcuter = new OpenCLExcuter(); |
| | | openCLExcuter->init(); |
| | | cv::Mat img = cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade\\Snipaste_2023-01-13_18-23-34.png"); |
| | | cv::Mat img = cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\demo\\24084.jpg"); |
| | | uchar* datas = (uchar*)malloc(sizeof(uchar) * img.rows * img.cols); |
| | | if (img.channels() == 4) |
| | | { |
| | |
| | | cv::Mat binary; |
| | | threshold(img1, binary, 96, 255, cv::THRESH_BINARY); |
| | | |
| | | cv::imwrite("C:\\Users\\Administrator\\Desktop\\ocr\\trade\\Snipaste_2023-01-13_18-23-34_gray.png", img1); |
| | | cv::imwrite("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\demo\\24084_gray.png", img1); |
| | | |
| | | } |
| | | |
| | | void testSplit() { |
| | | |
| | | ImgUtil::init(); |
| | | L2TradeQueueUtil::splitElements(cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\l2_trade_queue_2.png", cv::IMREAD_GRAYSCALE)); |
| | | //list<ImgArea> areas = L2TradeQueueUtil::splitBuyQueue(cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\demo\\test.png", cv::IMREAD_GRAYSCALE),0); |
| | | |
| | | list<ImgArea> areas = L2TradeQueueUtil::splitViewElements(cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\demo\\7_19353.png", cv::IMREAD_GRAYSCALE)); |
| | | } |
| | | |
| | | void testCaptureL2Trade() { |
| | |
| | | OpenCLExcuter* openCLExcuter = new OpenCLExcuter(); |
| | | openCLExcuter->init(); |
| | | L2DataCapture *capture = new L2DataCapture(); |
| | | cv::Mat img = cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\l2_trade_queue_3.png"); |
| | | L2TradeQueue tradeQueue = capture->captureLevel2TradeQueueData(openCLExcuter, img, 0); |
| | | cv::Mat img = cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\Snipaste_2023-02-02_15-32-01.png"); |
| | | //L2TradeQueue tradeQueue = capture->captureLevel2TradeQueueData(openCLExcuter, img, 0); |
| | | printf("\n"); |
| | | } |
| | | |
| | |
| | | capture->captureTradeSuccessInfo(cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade\\Snipaste_2022-12-23_09-39-02.png")); |
| | | } |
| | | |
| | | void markImg() { |
| | | cv::Mat mat = cv::imread("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\Snipaste_2023-02-02_15-22-58.png", cv::IMREAD_GRAYSCALE); |
| | | mat = ImgUtil::markMat(mat,cv::Rect(60,50,100,10),255,1); |
| | | cv::imwrite("C:\\Users\\Administrator\\Desktop\\ocr\\trade_queue\\mark.png", mat); |
| | | } |
| | | |
| | | |
| | | int main() { |
| | | grayImg(); |
| | | markImg(); |
| | | return 1; |
| | | //testL2(); |
| | | //if (TRUE) { |