Hi, Community.
I use ImageSearch a lot to automate tasks on my desktop, and I recently wrote a script to play a card game. The player is dealt 5 cards, so I run a loop of 52 ImageSearch commands to recognize the first card, then another loop of 52 to recognize the 2nd...the 3rd...4th...and 5th.
The method works fine, but it takes a little time to run through 260 ImageSearch commands. Is there a way to speed up the process?
Thanks!
Ex.
Loop
{
ImageSearch,FoundX, FoundY, 671, 1030, 764, 1122, C:\Users\Me\Desktop\CardFolder\AceSpades.png
If errorlevel=0
{
break
}
ImageSearch,FoundX, FoundY, 671, 1030, 764, 1122, C:\Users\Me\Desktop\CardFolder\KingSpades.png
If errorlevel=0
{
break
}
.......
.....
}
Speeding up ImageSearch?
Re: Speeding up ImageSearch?
just lolSOBETed wrote:260 ImageSearch commands
this doesnt sound like a task for image search at all. cant u identify the cards by a pixel? post an image of a couple of them. then u could use pixelsearching
as for how to speed up image search in no particular order:
scan a smaller area
look for a smaller image
break up ur search space in chunks and parallelize the task(not always applicable)
parallelize the task itself(ie 1 thread per card)