Caduel,
Sounds like an image registration problem. There exist libraries for doing this, but if I were you, I'd implement a simple registration algorithm yourself - that way you know exactly what's going on.
1. Iterate over a collection of rotations and translations. Choose the range based on the extent of transformations you wish to correct.
2. For each rotation/translation pair, apply the transformation to your image and compute the cross-correlation of the transformed image with some template image (containing only the markers). Instead of cross-correlation, you can simply use the sum of the product of the pixel intensities.
3. Pick the rotation/translation pair that results in the highest correlation.
JM
Bookmarks