content-aware-rotation
content-aware-rotation copied to clipboard
Implementation of Kaiming He's Paper Content-Aware Rotation on ICCV 2013
Content-Aware-Rotation
- Reproduction of Kaiming He's Paper Content-Aware Rotation on ICCV 2013.
- I just test this project on Windows 10, there may be something wrong on Linux system.
Contents
- Dependency
- Formula Derivation
- Usage
- Results
- References
Dependency
Python 3.6 or newer
pillow == 5.1.0
numpy == 1.14.5
opencv == 4.2.0
matplotlib == 2.2.2
tensorflow == 1.10.0
Formula Derivation
-
Rotation Manipulation

suppose that :
,
then we have :
further, we can get the derivative :
-
Line Preservation

suppose that :
,
then we have :
further, we can get the derivative :
-
Shape Preservation

suppose that :
,
then we have :
further, we can get the derivative :
-
Boundary Preservation

further, we can get the derivative :
-
Optimization
-
Step 1 : Fix θ solve for V
Sparse Linear System :
V is the minimum point of total energy above, thus, let :

we can get the solution for V. -
Step 2 : Fix V solve for θ
Part 1 : Fix Φ, update θ

suppose that :
we have :
then let :
by solving a sparse linear system, we can get the solution of θ :

Part 2 : Fix θ, update Φ

the solution of Φ can be easily approximately reached by enumeration based on iteration methods(increase β gradually).
Usage
- How to Use : download the whole project and run main.py
- folder ep : images which are used for formula derivation and some results.
- folder image : images which are used in original paper.
- folder lsd : line segment detection algorithm in python version.
- warp_mesh.py : image warping method realized by embedded function in tensorflow.



