Image recognition software with Python

2022-06-05 0 By

Life is short. I learned Python. Python is popular because it is powerful and easy to use.Write a python program to realize the text recognition function of the screenshot content to show the powerful functions of Python.Here is the final product: realize the recognition of the text in the screenshot, and then print the recognition on the screen.So you can baidu library above the need for VPI to use the file paste copy operation.Image requiring text recognition: Perform the following steps: 1. Install the following modules: Keyboard,PIL2.Download a screenshot software :Snipaste3.Import keyboardfrom PIL import ImageGrab3.2 Keyboard.wait (hotkey=’F1′)Keyboard. wait(hotkey=’ CTRL + C ‘)The third-party SDK is used here, and the text recognition function of Baidu AI Development platform (https://ai.baidu.com/) is used this time, as shown in the picture below.Baidu has provided the call method, you can write the call method by viewing the relevant technical documents.Here you must apply for a Baidu account, and create a new application, get the corresponding APP_ID, API_KEY, SECRET_KEY can be called.”””with open(’01.jpg’,’rb’) as fp:image = fp.read()””” text = client.basicaccurate (image)for I intext[‘words_result’]:print(i[‘words’])4.Once the program is written, it can be packaged as an application for use.PIP Install PyInstaller install PyInstaller. Then go to CMD and run PyInstaller.py.After running, a file named dist will be generated in the program directory. Open the file and click the EXE file to run the program directly.Go and try it if you like.Use Python to realize image recognition software zero basic learning Python newknowledge list 29.9 yuan purchase column