https://github.com/mkht/templatematching
PowerShell cmdlet for Template matching
https://github.com/mkht/templatematching
Last synced: 10 months ago
JSON representation
PowerShell cmdlet for Template matching
- Host: GitHub
- URL: https://github.com/mkht/templatematching
- Owner: mkht
- License: mit
- Created: 2018-01-27T14:52:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-06T15:05:47.000Z (over 8 years ago)
- Last Synced: 2025-06-13T11:07:39.276Z (about 1 year ago)
- Language: C#
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
TemplateMatching
====
Powershell cmdlet for template matching.
You can find out where the template image is in the target image.
## Install
You can install from [PowerShell Gallery](https://www.powershellgallery.com/packages/TemplateMatching).
```PowerShell
Install-Module -Name TemplateMatching
```
## Cmdlet
* Invoke-TemplateMatching
## Parameter
### Target
**_(Type = string, Mandatory = True, Positional = False)_**
Specifies the image file in which you expect to find a match to the template image.
### Template
**_(Type = string, Mandatory = True, Positional = False)_**
Specifies the patch image which will be compared to the target image.
The image must be smaller than the target image.
### Threshold
**_(Type = double, Mandatory = False, Positional = False)_**
Specifies similarity threshold for image matching.
This cmdlet returns all matched points that has more similar than the threshold.
You can specifies threshold between `0.1` to `1.0` (greater is best match)
The default threshold is `0.95`
## Example
* Template image

* Target image

* Command
```PowerShell
PS C:\> Invoke-TemplateMatching -Target ".\target.png" -Template ".\template.png"
Rect Similarity
---- ----------
(x:720 y:101 width:74 height:66) 0.9999997
```
The template image found in the target image.
The coordinate of the image is `(x=720, y=101)`.
Similarity is `0.9999997`, it's nearly equal `1`. that indicates perfect match.
----
## License
TemplateMatching is released under the MIT License. See [LICENSE](/LICENSE).
This module includes these libraries.
* [OpenCV](https://opencv.org/)
Licensed under the [BSD 3-Clause](https://opencv.org/license.html)
* [OpenCvSharp](https://github.com/shimat/opencvsharp)
Licensed under the [BSD 3-Clause](https://github.com/shimat/opencvsharp/blob/master/LICENSE)