Page 16 of 17

Re: Vis2 - Image to Text OCR()

Posted: 03 Jul 2022, 11:39
by iseahound
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

Re: Vis2 - Image to Text OCR()

Posted: 09 Jul 2022, 13:52
by dkdurfee
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!

Re: Vis2 - Image to Text OCR()

Posted: 09 Jul 2022, 14:04
by boiler
@dkdurfee - Get the location and size of the window using WinGetPos to determine the coordinates you want to use for your capture.

Re: Vis2 - Image to Text OCR()

Posted: 18 Jul 2022, 12:51
by Krd
@ahk7

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

Re: Vis2 - Image to Text OCR()

Posted: 21 Jul 2022, 06:15
by Shajirr
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.

Re: Vis2 - Image to Text OCR()

Posted: 21 Jul 2022, 06:58
by Shajirr
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?

Re: Vis2 - Image to Text OCR()

Posted: 22 Jul 2022, 19:26
by fiendhunter
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)

Re: Vis2 - Image to Text OCR()

Posted: 22 Jul 2022, 22:06
by iseahound
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

Re: Vis2 - Image to Text OCR()

Posted: 04 Aug 2022, 18:50
by xInDiGo
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

Re: Vis2 - Image to Text OCR()

Posted: 05 Aug 2022, 08:34
by wertiq
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.

Re: Vis2 - Image to Text OCR()

Posted: 10 Aug 2022, 08:17
by 10basetom
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

Re: Vis2 - Image to Text OCR()

Posted: 10 Aug 2022, 09:14
by boiler
@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.

Re: Vis2 - Image to Text OCR()

Posted: 10 Aug 2022, 09:40
by 10basetom
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.

Re: Vis2 - Image to Text OCR()

Posted: 01 Sep 2022, 15:13
by Albert Schenning
Is this tool also working under AHKv2 ?

Re: Vis2 - Image to Text OCR()

Posted: 09 Sep 2022, 11:38
by iseahound
The goal is to convert it to v2. Both TextRender (shows text on screen) and ImagePut (screen capture + more) are currently v2 compatible.

Re: Vis2 - Image to Text OCR()

Posted: 30 Sep 2022, 12:36
by vSky
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 259 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.

Re: Vis2 - Image to Text OCR()

Posted: 30 Sep 2022, 12:40
by iseahound
Is there any steps for reproduction? I can't tell by looking at the output

Re: Vis2 - Image to Text OCR()

Posted: 25 Dec 2022, 01:37
by asdzbit
is it possible to use custom fonts for the OCR?

Re: Vis2 - Image to Text OCR()

Posted: 25 Dec 2022, 01:48
by boiler
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.

Re: Vis2 - Image to Text OCR()

Posted: 01 Mar 2023, 23:15
by Ntey
@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* )