Lore

If it's worth remembering, it's worth writing down, if I find the time, and remember...

User Tools

Site Tools


imagesearch

This is an old revision of the document!


Image Search with AutoIt

Overview

For years, I've been using AutoIt to accomplish all sorts of automation, and it has proven to be a very capable tool. However, one feature it is missing, which I recently found necessary, is image search. Essentially, I wanted to be able to look for something on the screen that matched an image, and, if possible, with tolerance for imperfect matches.

After some time searching around, I ran in to this thread, which pretty much took me 95% of the way to my desired solution. The key is the AutoHotkey ImageSearch function. Someone capable extracted the ImageSearch function from the AutoHotkey and packed it up in to convenient DLLs, this started the ball rolling. With the contributions of some other users, a UDF 1) with wrapper functions was put together, and then packaged with all the necessary DLLs for convenience.

Missing from the wrapper functions was the ability to search within a specific window. Instead, the choices were to search the entire desktop or a specified area. I modified the code and added an optional parameter for a window handle, which will supply coordinates and dimensions for the search area. I also made the tolerance parameter optional, defaulting to exact match if omitted.

Syntax

Coming soon™…

Download

ImageSearch is the package with the original DLLs, and my modified ImageSearch.au3 include library.

1)
User Defined Function library, in AutoIt.
imagesearch.1522868035.txt.gz · Last modified: 2018/04/04 14:53 by thekojukinator