I have had good success using the Distance Transform and Chamfer Matching to locate a template in an edge image. Is there a recommended technique to then find the actual edges that match the template?
For example, in the image below, the template is shown in blue at the location found by chamfer matching. The image edges are shown in red and green, where the green edges are the edges that I would like to extract because they best match the template.
I have tried techniques involving finding the Euclidean distance from every edge pixel to the template edge and taking the edge with the smallest total distance, but this technique often finds incorrect edges. I think I need something that compares the "shape" of the edges with the shape of the template edges and am wondering if there is a standard technique.