Hi everyone,

I am a begginer of python and I start a project for myself. This project is 
for Pokemon games, and i need to get the name of pokemon i am fighting 
against. 
The problem is that sometimes it works very well and if i try another time 
it detects the empty string.
For instance, this is the picture i capture to extract the pokemon name. It 
should extract "cadoizo" and even if it is not accurate, I coded something 
to select the most similar pokemon name. 
I just don't want an empty string. Do you have some solution? 

That's the part of my code doing it:


# Spécifiez les coordonnées de la région de l'écran à capturer (x, y, 
hauteur, largeur)
region = (300, 70, 280, 68)
screenshot = pyautogui.screenshot(region=region)

# Convertissez la capture d'écran en une image Pillow
image = Image.frombytes("RGB", screenshot.size, screenshot.tobytes())
image.show()

# Utilisez pytesseract pour extraire du texte de l'image
text = pytesseract.image_to_string(image)
morceaux = text.split(' ', 1)
text = morceaux[0]
# Affichez le texte extrait
print("Texte extrait de l'image:", text) 

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tesseract-ocr+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/9d429325-20f4-40f8-bd00-6b7c83b391a2n%40googlegroups.com.

Reply via email to