These differences can write less code and use opencv acceleration
The reference article implements the Canny algorithm itself.
Inserts the operation that creates the gradient template into it.
The implementation here is different.
First use Canny algorithm to find the edges.
Then use FindContours find the edges to create a gradient template.
Referencing the article by traversing the calculation magnitude.
Here use the opencv's CartToPolar to get the magnitude and direction directly
Prism.Core
OpenCvSharp4.Windows
MaterialDesignThemes
PropertyTools.Wpf
Prof. Dr. Carsten Steger(Halcon)
Some video and publications(At the bottom)
shape_based_matching