Today, I swiped a post to a website, which can be recognized by OCR for free, but I didn’t calculate the specific number of times, and there is no specific description in the document, so let’s take a look together.
First of all, the URL is here: click me directly
1. We need to register an account to obtain very important parameters【ColaKey
】
2. Next, let's take a look at the document description (skipable), click me to go directly
3. Instructions for use
1、URL,
POST请求
:https://luckycola.com.cn/aiTools/imgOcr2. Parameters: Important reminder ⚠️: The interface request parameters are in multipart/form-data format ⚠️
serial number | parameter | Is it necessary | illustrate |
1 | ColaKey | yes | The unique verification ColaKey can be obtained from the official website (http(s): //luckycola.com.cn (opens new window)) |
2 | file | yes | The image resource (png, jpg, jpeg format) that needs to be identified, note: the interface request parameter is in multipart/form-data format |
3 | lang | no | Whether the content of the currently detected picture is Chinese or English, if it is Chinese, the parameter value can not be passed, if it is English, pass in "eng", be sure to set the value correctly |
3. I used Postman to test, the following is my original image and recognition effect
ok The recognition is successful, but the accuracy is not very accurate
4. Code, you can directly use Postman to generate code! !
import requests
url = "https://luckycola.com.cn/aiTools/imgOcr"
payload = {
'ColaKey': '写上自己的'}
files=[
('file',('img.png',open(r'd:/user/桌面/img.png','rb'),'image/png'))
]
headers = {
'Cookie': '会自动生成'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)