I have an image with white arrows and a contour of 1 such an arrow. See here:

Now I want to rotate and translate this contour such that it fits as well as possible. In this specific case the goals is thus to fit the blue contour around the bottom arrow.
My current approach is to select a raster of (x, y) coordinates. On each of these coordinates I rotate the contour in 360 directions, each time measuring the summed pixel values contained within this contour. The position & angle with the highest value is then chosen as the most likely position & angle for this contour to be correctly fitted.
However, this is a pretty slow procedure and the quality strongly depends on the raster density. Is there a better way to do this?
General advice would be welcome as would any packages/code in python providing examples of how to do this.