Finding angle of rotation of an image after comparing with the target image

The above image is the target and below is the detected image.
obj