Not everybody can be equipped with professional photography skills and sufficient shooting time, and there can be some tilts in the captured images occasionally. In this paper, we propose a new and practical task, named Rotation Correction, to automatically correct the tilt with high content fidelity in the condition that the rotated angle is unknown. This task can be easily integrated into image editing applications, allowing users to correct the rotated images without any manual operations. To this end, we leverage a neural network to predict the optical flows that can warp the tilted images to be perceptually horizontal. Nevertheless, the pixel-wise optical flow estimation from a single image is severely unstable, especially in large-angle tilted images. To enhance its robustness, we propose a simple but effective prediction strategy to form a robust elastic warp. Particularly, we first regress the mesh deformation that can be transformed into robust initial optical flows. Then we estimate residual optical flows to facilitate our network the flexibility of pixel-wise deformation, further correcting the details of the tilted images. To establish an evaluation benchmark and train the learning framework, a comprehensive rotation correction dataset is presented with a large diversity in scenes and rotated angles. Extensive experiments demonstrate that even in the absence of the angle prior, our algorithm can outperform other state-of-the-art solutions requiring this prior. The code and dataset are available at https://github.com/nie-lang/RotationCorrection.
翻译:并非人人都具备专业摄影技巧和充足的拍摄时间,因此捕获的图像偶尔会出现倾斜。本文提出了一项新颖且实用的任务,称为旋转校正,旨在未知旋转角度的条件下自动校正倾斜,同时保持高内容保真度。该任务可轻松集成到图像编辑应用中,使用户无需任何手动操作即可校正倾斜图像。为此,我们利用神经网络预测光流,将倾斜图像扭曲至感知上水平的图像。然而,单张图像的像素级光流估计极不稳定,尤其是在大角度倾斜图像中。为增强其鲁棒性,我们提出了一种简单而有效的预测策略,以构建鲁棒的弹性扭曲。具体而言,我们首先回归网格变形,并将其转化为稳健的初始光流。随后,我们估计残差光流,使网络具备像素级变形的灵活性,从而进一步校正倾斜图像的细节。为建立评估基准并训练学习框架,我们构建了一个涵盖场景和旋转角度多样性的综合旋转校正数据集。大量实验表明,即使在缺乏角度先验的情况下,我们的算法也能优于需要该先验的现有最优方案。代码与数据集可在 https://github.com/nie-lang/RotationCorrection 获取。