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 traverse the edges to create a gradient template.
This's slow,but less code(use EmguCV's Canny)
Use conditional compilation symbol "FAST" to view an faster but unstable result
Prism
EmguCV
Prof. Dr. Carsten Steger(Halcon)
Some video and publications(At the bottom)