Giter VIP home page Giter VIP logo

texture_synthesis's Introduction

texture_synthesis

This is Assignment2 of CS534 computer vision in Rutgers.

  • Part1

    texture synthesis using efros Alg

  • Part2

    picture impainting using efros Alg

  • Part3

    picture impainting after object removal based on criminis's approach.

There are 3 classes,

  • base_op

    Basic operations of images, such as open images, normalization, init mask, init windowsize.

  • efors_algorithm

    Combination of part1 and part2 algorithm.

  • criminis_algorithm

    The implementation of part3

How to run

The main test file is test.py.

If you want to run, you need to uncomment the comment part in the test.py.

The basic idea to run code is first create an object of base_operation with file_name and the window size. Then create different objects for different part, then call the corresponding functions.

  • Part 1:

     base_op =  base_operation('./pics/tT1.gif', 11)
     efros_obj = efros_algorithm(base_op)
     efros_obj.efros_synthesis(200, 200)

    Only change the './pics/tT1.gif' to different files and 11 to different window size.

  • Part 2:

     base_op =  base_operation('./pics/test_im1.bmp', 11)
     efros_obj = efros_algorithm(base_op)
     efros_obj.efros_impainting()

    Only change the './pics/test_im1.bmp' to different files and 11 to different window size.

  • Part 3:

    Criminis

     base_op =  base_operation('./pics/test_im3.jpg', 9)
     # crinimis part
     criminis_obj = criminis_algorithm(base_op)
     # people
     criminis_obj.remove_blocks([(352,485,222,253)])
     criminis_obj.do_criminis()

    Change list in the remove_blocks for different part to remove. Already listed the listes with comment in the code.

    Efros

     base_op =  base_operation('./pics/test_im3.jpg', 9)
     efros_obj = efros_algorithm(base_op)
     #person
     efros_obj.efros_removal([(352,485,222,253)])

    similar to criminis.

Very easy to run the code based on the OO.

  • Part 4:

    run PatchBasedSynthesis.py.

    Because cv2 cannot open gif files, I resaved the gifs to jpgs.

    PatchBasedSynthesis.py /image/source.jpg Patch_Size Overlap_Width Initial_Threshold_error

    For example,

    python PatchBasedSynthesis.py ./pics/T1.jpg 24 4 5.0

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.