Photos taken by amateur photographers often contain slanted buildings, walls and horizon lines due to improper camera rotations.
Reshooting the rectified image using another camera placed at a possibly different position with novel orientation, automatically by creating 4 energy terms: Picture frame alignment, Eye level alignment, Image distortion and Focal length difference, and then minimizing the sum of the energy terms