Giter Club home page Giter Club logo

content-aware-rotation's Introduction

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

  1. Dependency
  2. Formula Derivation
  3. Usage
  4. Results
  5. 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
    eq2
    suppose that :
    eq3,
    then we have :
    eq4
    further, we can get the derivative :
    eq5

  • Line Preservation
    eq7
    suppose that :
    eq8,
    then we have :
    eq9
    further, we can get the derivative :
    eq10

  • Shape Preservation
    eq12
    suppose that :
    eq13,
    then we have :
    eq14
    further, we can get the derivative :
    eq15

  • Boundary Preservation
    eq17
    further, we can get the derivative :
    eq18

  • Optimization

  • Step 1 : Fix θ solve for V
    Sparse Linear System :
    eq19
    V is the minimum point of total energy above, thus, let :
    eq20
    we can get the solution for V.

  • Step 2 : Fix V solve for θ
    Part 1 : Fix Φ, update θ
    eq21
    suppose that :
    eq22
    we have :
    eq23
    then let :
    eq24
    by solving a sparse linear system, we can get the solution of θ :
    eq25
    Part 2 : Fix θ, update Φ
    eq26
    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.

Results

References

Author : Kaiming He, Huiwen Chang, Jian Sun
Matlab Version

content-aware-rotation's People

Contributors

foreverps avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.