[Class] graphicsearch.ahk (ImageSearch strings)
Re: [Class] graphicsearch.ahk (ImageSearch strings)
You could create a thread in the Wish List sub-forum. However, I don’t think asking lexikos to change the language will yield results based on his statements regarding his focus on v1 vs. v2. Perhaps it would be considered for v2. It certainly wouldn’t be implemented soon in any case, so I wouldn’t go that route if you’re looking for a near-term solution.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
IMHO AHK v2 if ever will be finished long time will be less popular than Ahk v1 (more complex syntax, less user libraries).
But add possibility to use pBitmap in imagesearch - it is a couple lines of code.
But add possibility to use pBitmap in imagesearch - it is a couple lines of code.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
0.3.3 is now on npm and github.
FeiYue answered my question about joinqueries/joinText which is now described in the documentation as: Whether or not to search each query in succession. Queries must be in close proximity (like characters in a string)
The code has reverted to this being defaulted to 0
I will make a tutorial on this in more detail in the future.
FeiYue answered my question about joinqueries/joinText which is now described in the documentation as: Whether or not to search each query in succession. Queries must be in close proximity (like characters in a string)
The code has reverted to this being defaulted to 0
I will make a tutorial on this in more detail in the future.
-
- Posts: 2
- Joined: 20 Jun 2021, 06:56
Re: [Class] graphicsearch.ahk (ImageSearch strings)
Thanks for the script. It looks great, but I couldn't install it. Would it be possible to provide an easier installation rather than npm?
When I tried to open test-all.ahk it said Include file C:\xx\node_modules\graphicsearch.ahk\node_modules cannot be opened. The program will exit.
When I tried to open test-all.ahk it said Include file C:\xx\node_modules\graphicsearch.ahk\node_modules cannot be opened. The program will exit.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
I will update the README to read:
Hopefully this is more clear.In your code only export.ahk needs to be included:
You may also review or copy the library from ./export.ahk on GitHub; #Incude as you would normally when manually downloading.
-
- Posts: 2
- Joined: 20 Jun 2021, 06:56
Re: [Class] graphicsearch.ahk (ImageSearch strings)
Sorry, somehow I missed that part, my bad. I can confirm including export.ahk made it work. Excellent stuff, thanks Chunjee
Re: [Class] graphicsearch.ahk (ImageSearch strings)
There is a v0.4.0 on github.
Someone was reporting an issue with a 2nd monitor. This should fix that but I wasn't able to reproduce it exactly so I'm hoping some people will test it and give the green light for better 2nd monitor support.
Someone was reporting an issue with a 2nd monitor. This should fix that but I wasn't able to reproduce it exactly so I'm hoping some people will test it and give the green light for better 2nd monitor support.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
Hi Guys,
I have a sort of different problem scenario would like to seek your help.
Is it possible to:
(1) Capture any type of notifications (either Yellow Warning or Pink Error) that appears on screen, for any type of contents in the notification (i.e. images are not exactly the same every time).
(2) Recognize the content of the image (i.e. text recognition or find text).
Any hint on the direction how I may achieve the above will be super appreciated. Is there any existing function can achieve it, as ImageSearch needs exact match…
Thank you so much!
I have a sort of different problem scenario would like to seek your help.
Is it possible to:
(1) Capture any type of notifications (either Yellow Warning or Pink Error) that appears on screen, for any type of contents in the notification (i.e. images are not exactly the same every time).
(2) Recognize the content of the image (i.e. text recognition or find text).
Any hint on the direction how I may achieve the above will be super appreciated. Is there any existing function can achieve it, as ImageSearch needs exact match…
Thank you so much!
Last edited by rc76 on 23 Sep 2021, 00:39, edited 1 time in total.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
@rc76 I think you would probably be better off with GDIP to capture the image and one of the Optical Character Recognition (OCR) packages to parse the text. I've never used those.
Another thread about trying to gather the notification text: viewtopic.php?t=76103&p=331628
graphicsearch.ahk doesn't really have much to do with understanding the text on the screen unless you painstakingly search for each word. Would be so complicated I doubt it would work well.
To answer your questions
1) yes, you can probably detect a notification
2) no, you can't recognize the content of the notification with this package
Another thread about trying to gather the notification text: viewtopic.php?t=76103&p=331628
graphicsearch.ahk doesn't really have much to do with understanding the text on the screen unless you painstakingly search for each word. Would be so complicated I doubt it would work well.
To answer your questions
1) yes, you can probably detect a notification
2) no, you can't recognize the content of the notification with this package
Re: [Class] graphicsearch.ahk (ImageSearch strings)
Thank you so much @Chunjee !
Re: [Class] graphicsearch.ahk (ImageSearch strings)
I'm not very smart and I'm not able to make this work.
Is there any video tutorials?
I downloaded graphicsearch.ahk-master.zip
and extracted it, I capture a part of the screen but when I trigger the the hotkey LControl & LShift it says not found.
Anyone think can help? What I'm doing wrong?
Is there any video tutorials?
I downloaded graphicsearch.ahk-master.zip
and extracted it, I capture a part of the screen but when I trigger the the hotkey LControl & LShift it says not found.
Code: Select all
~LControl & LShift:: ; intro 1.
; #Include graphicsearch.ahk\export.ahk
;#Include %A_ScriptDir%\graphicsearch.ahk\export.ahk
;#Include %A_ScriptDir%\export.ahk
t1 := A_TickCount, X := Y := ""
graphicsearch_query := "|<>*183$29.ztzXtznzDsQ60sUsA1k1kM3k3Uz3w71y3yC300wQ60EssA1llkTvz3UzlwU"
resultObj := graphicsearch.search(GraphicSearch_query)
if (resultObj) {
X := resultObj.1.x, Y := resultObj.1.y, Comment := resultObj.1.id
; Click, %X%, %Y%
}
MsgBox, 4096, Tip, % "Found :`t" Round(resultObj.MaxIndex())
. "`n`nTime :`t" (A_TickCount-t1) " ms"
. "`n`nPos :`t" X ", " Y
. "`n`nResult:`t" (resultObj ? "Success !" : "Failed !")
for i,v in resultObj
if (i<=2)
graphicsearch.mouseTip(resultObj[i].x, resultObj[i].y)
return
~RControl & numpad0::
Reload
Return
Re: [Class] graphicsearch.ahk (ImageSearch strings)
v0.4.0 has been published to npm
It was on github for a while and seems like people are having much better luck with that version.
It was on github for a while and seems like people are having much better luck with that version.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
I love the class but is there an easy way to create search queries from just .png or .jpg files? so i don't have to manually use the tool to capture, crop etc.?
Re: [Class] graphicsearch.ahk (ImageSearch strings)
Is there a built in tool to apply color masking to the screenshot before the library tries to find matches?
I'm guessing .scan with its screenshot argument set to zero will use whatever is on the clipboard? And if this is so, I could use other tools to apply a color mask. As long as the data on the clipboard is in bmp format it will work?
edit 9/6. I missed that this doesn't work for V2 And as such I'll stop pursuing this.
I'm guessing .scan with its screenshot argument set to zero will use whatever is on the clipboard? And if this is so, I could use other tools to apply a color mask. As long as the data on the clipboard is in bmp format it will work?
edit 9/6. I missed that this doesn't work for V2 And as such I'll stop pursuing this.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
Sorry I couldn't fully understand what the clipboard means in this case.
The screenshot argument:
The screenshot argument:
Whether or not to capture a new screenshot. When the value is 0, the last captured screenshot will be used
Last edited by Chunjee on 06 Jun 2024, 13:52, edited 1 time in total.
Re: [Class] graphicsearch.ahk (ImageSearch strings)
v0.5.0 has been published
it is a direct fork of FindText v9.6 with graphicsearch's convenient methods.
Not included in the main package:
classes; Class Thread, Class GuiCreate, Class Control
functions; Gui(), GuiFromHwnd(), GuiCtrlFromHwnd(), GuiCreate_Close(), GuiCreate_ContextMenu(), GuiCreate_DropFiles(), GuiCreate_Escape(), GuiCreate_Size(), GuiCreate_G()
methods; .help, .code
arguments; OutputX, OutputY
it is a direct fork of FindText v9.6 with graphicsearch's convenient methods.
Not included in the main package:
classes; Class Thread, Class GuiCreate, Class Control
functions; Gui(), GuiFromHwnd(), GuiCtrlFromHwnd(), GuiCreate_Close(), GuiCreate_ContextMenu(), GuiCreate_DropFiles(), GuiCreate_Escape(), GuiCreate_Size(), GuiCreate_G()
methods; .help, .code
arguments; OutputX, OutputY
Re: [Class] graphicsearch.ahk (ImageSearch strings)
If I try to test with the test-all.ahk file from the test folder from the github I have this error:
---------------------------
test-all.ahk
---------------------------
Error at line 3.
#Include file "C:\graphicsearch.ahk-0.5.0\graphicsearch.ahk-0.5.0\test\..\node_modules" cannot be opened.
The program will exit.
Do I need to leave just the first include and comment the 2 next ?
---------------------------
test-all.ahk
---------------------------
Error at line 3.
#Include file "C:\graphicsearch.ahk-0.5.0\graphicsearch.ahk-0.5.0\test\..\node_modules" cannot be opened.
The program will exit.
Do I need to leave just the first include and comment the 2 next ?
Re: [Class] graphicsearch.ahk (ImageSearch strings)
dev dependencies are listed in package.json:
if you have npm installed you can install it to the correct location with simply: npm install
It is not the easiest test to run however:
Code: Select all
"dependencies": {},
"devDependencies": {
"unit-testing.ahk": "github:chunjee/unit-testing.ahk"
},
It is not the easiest test to run however:
Code: Select all
; this testing should be performed with image.png open in mspaint. 1920x1080 if it matters
Re: [Class] graphicsearch.ahk (ImageSearch strings)
I edited test-all.ahk to be indeterminant on the user's current screen size for sorting. The defaults measure from the center of a_screenwidth/height so depending on the desktop size the outputs could differ.
v0.5.0 was re-published. I noticed a small bug in an undocumented part of the code. graphicsearch.ahk allows you to define a different return value on zero matches found and this could sometimes go back to false
v0.5.0 was re-published. I noticed a small bug in an undocumented part of the code. graphicsearch.ahk allows you to define a different return value on zero matches found and this could sometimes go back to false