Img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # If your image is not already grayscale : Print(tti2("C:\\Users\\Utilisateur\\Pictures\\greenshot\\flea market sniper\\TESTbis.png"))Ĭode of "test" (it's for the thresholding) : import cv2 Test.th("C:\\Users\\Utilisateur\\Pictures\\greenshot\\flea market sniper\\TEST.png") Pyt.tesseract_cmd = 'C:/Program Files/Tesseract-OCR/tesseract.exe'įor character in "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ*^&\n" : Isn't any way to force pytesseract to read only numbers or simply use something that works better than pytesseract?įrom pytesseract import pytesseract as pyt It can read 1 000 000 as 1 aaa eee for example, or 585 as 5385r (yes it even adds characters without any reason) for example, with this image:Īnd it reads 5852 instead of 585, which is understandable, but sometimes it can be way worse with different thresholding. The thing is, even though it works, it works slowly and doesn't give good results at all. I'm trying to read numbers on the screen and for that I'm using pytesseract.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |