Did this very quickly last night.
Continuing from last year , this link :
https://forum.thegamecreators.com/thread/227725#msg2665296
You have to install Tesseract from here:
https://tesseract-ocr.github.io/tessdoc/Home.html
// Project: OCR_Tesseract_1
// Created: 2022-09-18
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "OCR_Tesseract_1" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
appid=RunApp("C:/Program Files (x86)/Tesseract-OCR/tesseract.exe","media/BCCI-Stadium-Jersey.jpg test")
txt as string
txt = ReadTextFromFile(test.txt")
do
Print( ScreenFPS() )
Printc( "Appid: " ) : Printc(appid ): Print('')
Printc ( "Text: ") : printc(txt)
Sync()
loop
function ReadTextFromFile(f as string)
t as String
t="Didn't work"
fileID = OpenToRead(f)
t=ReadString(fileID)
closefile(fileID)
endfunction t
I'll probably use other languages, Python , c+ etc to use the API, but thought this might be useful to someone who wants to use only Tier1 , maybe.
Don't forget to add the path of your Tesseract.exe to the system environment vars (PATH).
Pro Programmer / Data Scientist, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others