C # auxiliary tools (+ image recognition + SEARCH ),
Two days ago, I saw. NET develop a one-hop Helper Program in the blog Park. It was originally possible to connect to the mobile phone through C. Someone in the circle of friends shared the "summit meeting ". The Summit is an online Q & a app. Each time you answer 12 questions, each question has 10 seconds to answer. The total score is 10 thousand or 0.1 million yuan. As a result, I tried to answer a question once. Most of the questions are not difficult. Even if I don't know it, I can easily find the answer through keyword search. However, it takes only 10 seconds to answer questions. So I tried to write an auxiliary tool for answering questions. The basic idea was to use the adb mobile phone and then use the Baidu Image Recognition Development Kit to identify the problem and then automatically search for it.
Refer to the China. NET Research Association's code for developing a one-hop Helper Program in. NET. The adb command is as follows:
Adb shell/system/bin/screencap-p/sdcard/screenshot.png (save to SDCard) adb pull/sdcard/screenshot.png d:/screenshot.png (save to computer)
Adb DRIVER:
http://adbdriver.com/downloads/
Adb shell:
http://adbshell.com/downloads
Image Recognition
Register Baidu AI development platform.
Search for Baidu. AI In NuGet and install it. The code is simple:
// Set APPID/AK/SKvar APP_ID = "your App ID"; var API_KEY = "Your Api Key"; var SECRET_KEY = "your Secret Key "; var client = new Baidu. aip. ocr. ocr (API_KEY, SECRET_KEY); public void GeneralBasicDemo () {var image = File. readAllBytes ("image file path"); // call universal text recognition. If the image parameter is a local image, exceptions such as network exceptions may be thrown. Use try/catch to capture var result = client. generalBasic (image); Console. writeLine (result); // if the optional parameter var options = new Dictionary <string, object >{{ "categorage_type", "CHN_ENG" },{ "detect_direction ", "true" },{ "detect_language", "true" },{ "probability", "true" }}; // call common text recognition with parameters, the image parameter is local image result = client. generalBasic (image, options); Console. writeLine (result );}
Reference http://ai.baidu.com/docs#/OCR-Csharp-SDK/top
Search
Most of the questions are "Internal Affairs" in China, So Baidu is used for search. But Baidu search seems not Yo interface provided, so the use of direct open web http://www.baidu.com/s? Wd = keyword & cl = 3.
It is best to attach
And code: https://gitee.com/roytec/BaiduOCRDemo
Note: This article only applies to adb and Baidu OCR and communication. At present, there are still many limitations. For example, it takes about 4 or 5 seconds to start from recognition to search, and the answer needs to be quickly identified on the web page. There is very little time to choose from. In addition, some answers cannot be searched directly, for example, "Which of the following scenic spots are not in Beijing ?"
If you want to download the APP trial, add an invitation code.580805You and I both have one more chance of resurrection.