I recently wrote a program to align images using OpenCV in Python. I drew a rectangle with ten dots on it and took pictures of it at different angles. I used the locations where each of the corresponding dots moved to find a homography between the straight picture and each angled picture. I then warped the angled pictures using this homography to align them.
Here is a link to download the folder with the images and Python code in it as well as an image of the output. Make sure to download the whole folder and run the python code from within that folder.