Vis2 - Image to Text OCR()

Post your working scripts, libraries and tools for AHK v1.1 and older
iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: Vis2 - Image to Text OCR()

Post by iseahound » 03 Jul 2022, 11:39

You would use the built in command FileAppend for that

https://www.autohotkey.com/docs/commands/FileAppend.htm

Code: Select all

text := OCR()
FileAppend % text . "`n", C:\My Documents\Test.txt

dkdurfee
Posts: 1
Joined: 09 Jul 2022, 13:49

Re: Vis2 - Image to Text OCR()

Post by dkdurfee » 09 Jul 2022, 13:52

Hey! Awesome script! How do I make the OCR([coordinates], eng) command scan a specific window's coordinates instead of the entire screen? Thanks for the help!

User avatar
boiler
Posts: 16774
Joined: 21 Dec 2014, 02:44

Re: Vis2 - Image to Text OCR()

Post by boiler » 09 Jul 2022, 14:04

@dkdurfee - Get the location and size of the window using WinGetPos to determine the coordinates you want to use for your capture.

Krd
Posts: 405
Joined: 10 Mar 2020, 02:46

Re: Vis2 - Image to Text OCR()

Post by Krd » 18 Jul 2022, 12:51

@ahk7

Thank you for clarification to a noob. Thats first now I do understand how to use it :D

Shajirr
Posts: 5
Joined: 21 Jul 2022, 05:56

Re: Vis2 - Image to Text OCR()

Post by Shajirr » 21 Jul 2022, 06:15

If I need to identify page elements such as various buttons, or just some pieces of text just to confirm that the currently open view in a program is correct,
is this tool suitable or would it be better to compare images instead.
Like, first save an image from specific area to a file, and then when my script is running save a new image from the same area and compare the two?
The advantage of image comparison would be that it doesn't need any text at all, but I don't know which programs can do visual comparison and if it will be faster than OCR of this program.

Shajirr
Posts: 5
Joined: 21 Jul 2022, 05:56

Re: Vis2 - Image to Text OCR()

Post by Shajirr » 21 Jul 2022, 06:58

If I enable #Warn, this script throws a ton of warnings, both on start and on using specific functions, which makes debugging my own script very annoying.
Is there a way to receive warnings originating only from your script?

fiendhunter
Posts: 133
Joined: 24 Jul 2019, 15:27

Re: Vis2 - Image to Text OCR()

Post by fiendhunter » 22 Jul 2022, 19:26

Can we set color of the letters with tolerance? it cannot read well with noisy backgrounds.

Code: Select all

buf := ImagePutBuffer([ocrX, ocrY, 227, 49]) ; maybe we can add color eg.#ff00ff with 20 tolerance?
ImageShow(buf) ; 
clipboard := OCR(buf)

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: Vis2 - Image to Text OCR()

Post by iseahound » 22 Jul 2022, 22:06

Probably isn't possible at the moment. Manual thresholding is straightforward, but the included adaptive binarization is superior. Personally, unless you're trying to solve a captcha the background shouldn't be noisy - unless it's a game overlay

xInDiGo
Posts: 2
Joined: 03 Jul 2019, 19:01

Re: Vis2 - Image to Text OCR()

Post by xInDiGo » 04 Aug 2022, 18:50

hello really cool project here! is it still being worked on? i'm having a small issue with zero's sometimes returning blank. the zeros do have lines thru them. if there is any support still i'd be happy to provide more information thank you

wertiq
Posts: 4
Joined: 29 Jul 2022, 11:19

Re: Vis2 - Image to Text OCR()

Post by wertiq » 05 Aug 2022, 08:34

Good afternoon, I liked your project very much, but there were difficulties with the localization. I downloaded two files for rus, put them in the correct folders. I edited line

Code: Select all

#c:: OCR(, "rus") 
but when I select text I get an error
Image
I don't even know what I'm doing wrong.

User avatar
10basetom
Posts: 2
Joined: 10 Aug 2022, 08:06

Re: Vis2 - Image to Text OCR()

Post by 10basetom » 10 Aug 2022, 08:17

This seems like it might be able to do what I've been trying to do for a long time -- can someone please confirm if this is indeed possible?

1. Read an amount from the screen (e.g., $100) within a rectangular selection
2. Send mouse click event at screen coordinates x/y if amount meets a certain condition

User avatar
boiler
Posts: 16774
Joined: 21 Dec 2014, 02:44

Re: Vis2 - Image to Text OCR()

Post by boiler » 10 Aug 2022, 09:14

@10basetom

Item 1 is exactly what this library is meant to do. You would have to try it to see how reliably it performs this task for your specific situation.

Item 2 is trivial AHK code that is outside the scope of this thread. Post a new thread in “Ask For Help” if you need assistance with this after reviewing the AHK documentation and attempting to write a script to do that yourself.

User avatar
10basetom
Posts: 2
Joined: 10 Aug 2022, 08:06

Re: Vis2 - Image to Text OCR()

Post by 10basetom » 10 Aug 2022, 09:40

boiler wrote:
10 Aug 2022, 09:14
@10basetom —

Item 1 is exactly what this library is meant to do. You would have to try it to see how reliably it performs this task for your specific situation.

Item 2 is trivial AHK code that is outside the scope of this thread. Post a new thread in “Ask For Help” if you need assistance with this after reviewing the AHK documentation and attempting to write a script to do that yourself.
Hi, I was just figured out how to do both things above. Thanks for the reply.

Albert Schenning
Posts: 23
Joined: 03 Jan 2022, 14:40

Re: Vis2 - Image to Text OCR()

Post by Albert Schenning » 01 Sep 2022, 15:13

Is this tool also working under AHKv2 ?

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: Vis2 - Image to Text OCR()

Post by iseahound » 09 Sep 2022, 11:38

The goal is to convert it to v2. Both TextRender (shows text on screen) and ImagePut (screen capture + more) are currently v2 compatible.

User avatar
vSky
Posts: 80
Joined: 30 May 2022, 10:13

Re: Vis2 - Image to Text OCR()

Post by vSky » 30 Sep 2022, 12:36

Hi, I've been using this library for a long time, but today I ran into a problem. It gets stuck when the mouse cursor changes to select the area and doesn't recover until I close it. I'm not sure what the problem is. Can you help?

I use "Vis2.ahk" ;
Vis2.ahk
(122.38 KiB) Downloaded 248 times

The location of the error in the records;

Code: Select all

364: {
---- C:\Users\*********\OneDrive\Masaüstü\Vis2-Master\Lib\Vis2.ahk
011: Vis2.stdlib.setSystemCursor(32515)  
2397: Loop,Parse,SystemCursors,,
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2405: }
015: {
020: {
027: {
034: {
039: {


Full Log;

Code: Select all

Script lines most recently executed (oldest first).  Press [F5] to refresh.  The seconds elapsed between a line and the one after it is in parentheses to the right (if not 0).  The bottommost line's elapsed time is the number of seconds since it executed.

---- C:\Users\*********\OneDrive\Masaüstü\Vis2-Master\Lib\Gdip_All.ahk
7402: {
7407: {
7415: {
7442: {
7481: {
7495: {
7547: {
7588: {
7613: {
7618: {
7764: {
7808: {
7814: {
7998: {
8090: {
8140: {
8181: {
8229: {
8325: {
8536: {
8657: {
8677: {
8710: {
8739: {
8769: {
8803: {
8863: {
8883: {
8931: {
8957: {
8966: {
---- C:\Users\*********\OneDrive\Masaüstü\Vis2-Master\Lib\ImagePut.ahk
014: {
019: {
024: {
029: {
036: {
042: {
047: {
054: {
060: {
067: {
072: {
079: {
086: {
093: {
098: {
108: {
118: {
122: {
126: {
130: {
134: {
138: {
154: {
231: {
352: {
464: {
535: {
611: {
640: {
664: {
722: {
774: {
808: {
831: {
838: {
862: {
866: {
870: {
906: {
958: {
1012: {
1044: {
1065: {
1072: {
1130: {
1149: {
1161: {
1168: {
1177: {
1185: {
1196: {
1203: {
1209: {
1216: {
1222: {
1239: {
1257: {
1327: {
1404: {
1471: {
1487: {
1492: {
1498: {
1506: {
1513: {
1557: {
1627: {
1632: {
1637: {
1642: {
1649: {
1656: {
1694: {
1783: {
1928: {
1966: {
1991: {
2042: {
2070: {
2105: {
2125: {
2147: {
2158: {
2162: {
2173: {
2177: {
2194: {
2203: {
2248: {
2253: {
2268: {
2275: {
2287: {
2320: {
2354: {
2422: {
2438: {
2474: {
2489: {
2499: {
2553: {
2614: {
---- C:\Users\*********\OneDrive\Masaüstü\Vis2-Master\Lib\JSON.ahk
045: {
176: {
199: {
232: {
251: {
316: {
355: {
364: {
---- C:\Users\*********\OneDrive\Masaüstü\Vis2-Master\Lib\Vis2.ahk
011: Vis2.stdlib.setSystemCursor(32515)  
2397: Loop,Parse,SystemCursors,,
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2399: Type := "SystemCursor"
2400: CursorHandle := DllCall( "LoadCursor", "uInt",0, "Int",CursorID )
2401: %Type%%A_Index% := DllCall( "CopyImage", "uInt",CursorHandle, "uInt",0x2, "Int",cx, "Int",cy, "uInt",0 )
2402: CursorHandle := DllCall( "CopyImage", "uInt",%Type%%A_Index%, "uInt",0x2, "Int",0, "Int",0, "Int",0 )
2403: DllCall( "SetSystemCursor", "uInt",CursorHandle, "Int",A_Loopfield)  
2404: }
2405: }
015: {
020: {
027: {
034: {
039: {
049: {
067: {
098: {
125: {
156: {
173: {
188: {
261: {
326: {
365: {
412: {
430: {
447: {
472: {
488: {
493: {
498: {
000: {
512: {
528: {
532: {
541: {
545: {
549: {
553: {
557: {
572: {
587: {
599: {
606: {
611: {
616: {
621: {
630: {
654: {
668: {
677: {
695: {
718: {
758: {
785: {
848: {
884: {
893: {
897: {
904: {
913: {
919: {
924: {
928: {
932: {
936: {
940: {
944: {
972: {
980: {
985: {
996: {
1000: {
1010: {
000: {
1032: {
1046: {
1050: {
1056: {
1065: {
1070: {
1075: {
1083: {
1087: {
1118: {
000: {
1140: {
1158: {
1162: {
1170: {
1176: {
1181: {
1186: {
1191: {
1195: {
1202: {
1218: {
1575: {
1595: {
1611: {
1619: {
1623: {
1633: {
1648: {
1655: {
1670: {
1707: {
1735: {
1770: {
1925: {
1929: {
1933: {
1937: {
1941: {
1945: {
000: {
1973: {
2005: {
2011: {
2050: {
000: {
2077: {
2081: {
2100: {
2106: {
2129: {
2133: {
2137: {
2141: {
2166: {
2170: {
2201: {
2222: {
2234: {
2242: {
2252: {
2260: {
2332: {
2345: {
2352: {
2372: {
2394: {
2413: {
2498: {
2579: {
2593: {
2603: {
2608: {
2681: {
2687: {
---- C:\Users\*********\OneDrive\Masaüstü\Vis2-Master\Translate_v2.ahk
010: SetBatchLines,-1
011: CoordMode,ToolTip,Screen
012: Menu,Tray,Icon,shell32.dll,24
014: Gui,-MinimizeBox -MaximizeBox +AlwaysOnTop
015: Gui,Font,s14
016: Gui,Add,Text,x10 y16 w120 h23 +0x200,English
017: Gui,Font
018: Gui,Font,s14
019: Gui,Add,Text,x448 y16 w120 h23 +0x200,Turkish
020: Gui,Font
021: Gui,Font,s12
022: Gui,Add,Edit,vtxtEN x8 y48 w425 h131 +Multi
023: Gui,Font
024: Gui,Font,s12
025: Gui,Add,Edit,vtxtTR x449 y48 w425 h131 +Multi (0.02)
026: Gui,Font
030: Return (36.84)
031: MouseGetPos,ABC,ABD
032: Return (0.86)

Press [F5] to refresh.

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: Vis2 - Image to Text OCR()

Post by iseahound » 30 Sep 2022, 12:40

Is there any steps for reproduction? I can't tell by looking at the output

asdzbit
Posts: 1
Joined: 24 Dec 2022, 01:07

Re: Vis2 - Image to Text OCR()

Post by asdzbit » 25 Dec 2022, 01:37

is it possible to use custom fonts for the OCR?

User avatar
boiler
Posts: 16774
Joined: 21 Dec 2014, 02:44

Re: Vis2 - Image to Text OCR()

Post by boiler » 25 Dec 2022, 01:48

asdzbit wrote: is it possible to use custom fonts for the OCR?
Do you mean can it read/interpret custom fonts? The success depends on the details of the font. The only way to find out is to try it. The more “standard” it looks, the better chance it will have. If you mean can you use custom fonts for the output, that is just text. It has no font associated with it.

Ntey
Posts: 2
Joined: 01 Mar 2023, 23:08

Re: Vis2 - Image to Text OCR()

Post by Ntey » 01 Mar 2023, 23:15

@iseahound
Good sir, can you tell if some function can be done in a way to vis2 pull an image from clipboard to recognize? Im very new to ahk coding myself :?
The situation is I have an app with popup, and popup only here for a split second while im mousing over an item, and when I try to make ocr area to recognize its not fast enough to pull a text for seraching. Thanks in advance.

Code: Select all

F1:: OCR( *some function* )

Post Reply

Return to “Scripts and Functions (v1)”