Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rparrett/template-match
A slightly rusty alternative to ImageSearchDLL
https://github.com/rparrett/template-match
Last synced: 5 days ago
JSON representation
A slightly rusty alternative to ImageSearchDLL
- Host: GitHub
- URL: https://github.com/rparrett/template-match
- Owner: rparrett
- License: mit
- Created: 2017-12-29T21:52:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-02T17:35:55.000Z (almost 7 years ago)
- Last Synced: 2024-10-15T08:26:40.342Z (30 days ago)
- Language: Rust
- Size: 828 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Template Match
A slghtly rusty alternative to [ImageSearchDll](https://github.com/MyBotRun/Libraries/blob/master/ImageSearchDLL) for AutoIt3.
Relies on [imageproc](https://github.com/PistonDevelopers/imageproc) and a lot of `unsafe`.
### Why?
If you currently rely on ImageSearchDll and want something with a different license, this may interest you.
### Build
Tested with
```
stable-x86_64-pc-windows-gnu / rustc 1.22.1
nightly-x86_64-pc-windows-gnu / rustc 1.24.0-nightly
``````
cargo build --release
cp target/release/template_match.dll autoit_project_directory
cp au3/template-match.au3 autoit_project_directory
```### Usage
```AutoIt
; usage.au3#include
Func Main()
Local $result = TemplateMatch("needle.png")
; $error = TemplateMatchRect("needle.png", $x, $y, $w, $h);If ($result[3] <> 0) Then
ConsoleWrite("Error #" & $result[3] & @CRLF)
Return
EndIfConsoleWrite("Best X " & $result[0] & @CRLF)
ConsoleWrite("Best Y " & $result[1] & @CRLF)
ConsoleWrite("Root Mean Square Error " & $result[2] & @CRLF)If ($result[2] < 10.0) Then
ConsoleWrite("Found a good match!" & @CRLF)
EndIf
EndFuncMain()
```### TODO
* Some way to return multiple matches with a threshold
* Optionally pass a HWND
* What's the situation with multiple displays?
* Transparency