nbg15 Posted July 31, 2016 Share Posted July 31, 2016 (edited) Hello everybody.. i have this picture here *attached* and this script here: $ImageToReadPath = @MyDocumentsDir & "\GDIPlus_Image2.jpg" $ResultTextPath = @MyDocumentsDir & "\Result" $OutPutPath = $ResultTextPath & ".txt" $TesseractExePath = @MyDocumentsDir & "\Tesseract.exe" ShellExecuteWait($TesseractExePath, '"' & $ImageToReadPath & '" "' & $ResultTextPath & '"', "", "", @SW_HIDE) If @error Then Exit MsgBox(0, "Error", @error) EndIf MsgBox(0, "Result", FileRead($OutPutPath)) FileDelete($OutPutPath) but tesseract doesnt recognized the correct word... and gives me trash back... this is the image >> and the result was >> "samm" the image was an normal jpg and generated with this code here: _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image2.jpg", 712,268,853,284) Could anybody give me a hint what i can do better to get this easy image to text? thank u very much!!! Edit: i also tried to capture the screen as bmp with a higher resolution... nothing changed... _ScreenCapture_SetBMPFormat(4) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image.bmp", 712,279,853,295) Edited July 31, 2016 by nbg15 Link to comment Share on other sites More sharing options...
LarsJ Posted August 1, 2016 Share Posted August 1, 2016 You can open the image in Paint, double the width and height, save the image and try again. It's a small image, and there is a risk that there simply are too few pixels to recognize the characters. It usually helps to make the image larger. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
nbg15 Posted August 3, 2016 Author Share Posted August 3, 2016 (edited) Hey LarsJ, good idea but I need an automatism, to resize my images to 200% but everything i found on this forum wasnt helpful... https://www.autoitscript.com/autoit3/docs/libfunctions/_GDIPlus_ImageResize.htm Edited August 3, 2016 by nbg15 Link to comment Share on other sites More sharing options...
Pain Posted August 3, 2016 Share Posted August 3, 2016 Hi nbg15, You should be able to resize your image with this script: #include <GDIPlus.au3> ; init _GDIPlus_Startup() ; get file $sFile = FileOpenDialog("Select an image (non JPG)", "", "Images (*.bmp;*.png;*.gif;*.tif)") $hImage = _GDIPlus_ImageLoadFromFile($sFile) ; size $width = _GDIPlus_ImageGetWidth($hImage) $height = _GDIPlus_ImageGetHeight($hImage) ; resize image 200% $hBitmap_Scaled = _GDIPlus_ImageResize($hImage, $width * 2, $height * 2) ; save file _GDIPlus_ImageSaveToFile($hBitmap_Scaled, @ScriptDir & "\resized.png") ; clean up _GDIPlus_ImageDispose($hImage) _GDIPlus_BitmapDispose($hBitmap_Scaled) ; done _GDIPlus_Shutdown() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now