Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunsided/convolution-template-matching
Template Matching by Convolution in MATLAB
https://github.com/sunsided/convolution-template-matching
feature-detection image-processing matlab template-matching
Last synced: 4 months ago
JSON representation
Template Matching by Convolution in MATLAB
- Host: GitHub
- URL: https://github.com/sunsided/convolution-template-matching
- Owner: sunsided
- Created: 2016-08-18T00:22:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-19T14:42:09.000Z (over 8 years ago)
- Last Synced: 2024-10-11T02:31:12.769Z (4 months ago)
- Topics: feature-detection, image-processing, matlab, template-matching
- Language: Matlab
- Size: 325 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Template Matching by Convolution
*Template matching* attempts to find instances of a given template in an existing image by finding areas of maximum correspondence. While this can be done in terms of a cross correlation, care has to be taken to normalize both input and template, as cross correlation by itself is not invariant to mean shifts.
This experiment follows the idea that **convolution** is the same operation as **cross correlation**, when all axes of the template (i.e. the kernel) have been flipped; in terms of a two-dimensional correlation with a template, this results in a two-dimensional convolution of the same template, rotated by 180°; so
```matlab
xcorr2(image, template)
```is conceptually the same as
```matlab
conv2(image, fliplr(flipud(template)) % or
conv2(image, rot90(template, 2))
```Finding the template matches is then a question of finding the local minima (i.e. areas of maximum correspondence).