Man-made structures often appear to be distorted in photos captured by casual photographers, as the scene layout often
conflicts with how it is expected by human perception. In this paper, we propose an automatic approach for straightening up slanted
man-made structures in an input image to improve its perceptual quality. We call this type of correction upright adjustment. We
propose a set of criteria for upright adjustment based on human perception studies, and develop an optimization framework which
yields an optimal homography for adjustment. We also develop a new optimization-based camera calibration method that performs
favorably to previous methods and allows the proposed system to work reliably for a wide range of images. The effectiveness of our
system is demonstrated by both quantitative comparisons and qualitative user study.