U
U
UserKolya2020-05-30 12:45:14
Python
UserKolya, 2020-05-30 12:45:14

Script for pressing keys through OpenCV?

Hello! please tell me a text script that will allow the OpenCV program, given a certain image, to give a command to Python, and that in turn will display it on the keyboard with a keyboard shortcut through the Python module pyautogui?
Here is an example: The Open CV program through a mini computer (Rasberry PY3) saw an orange and needs to press the keys I, T, S, O, R, A, N, G, E on the keyboard using the pyautogui keyboard simulator installed in Python .
There are also a number of questions:
1) Do I need to install additionally any of the drivers not listed above? if so what?
2) Have you seen any article, similar question, YouTube video where I can find the answer to my question? if there is, throw a link

PS Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Tropanets, 2020-05-30
@nazartropanets

If you need a ready-made code, go to freelance sites, they will make a ready-made code for you for 2k.
You will not find ready-made code on the Internet on this topic.
Make the code yourself. I'm not sure if opencv is suitable for recognition. There is a ready-made model and weights on the Internet for recognizing objects using coco dataset (it seems to be called that), just connect the weights and the model (there is a ready-made code for recognizing objects on the Internet). Then you check whether it recognizes a tangerine or an apple or something else, if so, press the keys through pyautogui. In general, not everything is so simple and you need to use asynchronous for simultaneous recognition and verification. You don't need anything from drivers. If you don’t understand anything in neural networks, you are on the usual habr, there are a lot of articles. Hope it helped somehow.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question