[ANN] TemplateMatching.jl

I’m thrilled to announce the release of my very first package called TemplateMatching.jl, a native Julia implementation for template matching functionalities, inspired by those available in OpenCV.

Although slightly trailing behind OpenCV in terms of speed, TemplateMatching.jl is significantly faster than a naive Julia implementation (e.g. on my machine, the SquareDiff method is about 10 times faster than the naive implementation presented in ImageFiltering.jl here )

It uniquely supports n-dimensional arrays unlike the 2-dimensional focus in OpenCV.

Since it’s not yet registered, you can install TemplateMatching.jl through the Julia package manager using the URL of the repository

Basic Usage:

TemplateMatching.jl aims to be straightforward, where most tasks can be achieved with the match_template function or its in-place counterpart match_template!:

using TemplateMatching

source = rand(1000, 1000)
template = source[400:500, 100:150]

result = match_template(source, template, SquareDiff)

best_match = argmin(result) # Expecting CartesianIndex(400, 100)

As my inaugural package, I’m eager to hear your thoughts, suggestions, and criticisms, especially concerning the code’s quality and the package’s interface. I’m particularly interested in feedback on the method and package names, as I strive for clarity and ease of use. Your insights will be invaluable in guiding the package’s future development direction.

Thank you for taking the time to consider TemplateMatching.jl. I’m excited to contribute to our community and look forward to your feedback and suggestions for improvement!

7 Likes