Giter VIP home page Giter VIP logo

texturesynthesis's Introduction

Texture Synthesis by Non-parametric Sampling

This project implements Efros and Leung's 'Texture Synthesis by Non-parametric Sampling' (1999).

The algorithm synthesizes a new texture from an existing input by sampling the center pixel from a local neighborhood of the sample that best "matches" a local neighborhood in the current state of the synthesized texture.

Usage

python synthesis.py --sample_path=<input_path> --out_path=[output_path] --window_height=[win_height] --window_width=[win_width] --kernel_size=[ksize] --visualize

  • input_path - Path to the input texture sample.
  • output_path - (Optional) Output path for the synthesized texture.
  • win_height - (Optional) Height of the synthesized texture. 50 pixels is the default.
  • win_width - (Optional) Width of the synthesized texture. 50 pixels is the default.
  • ksize - (Optional) Width of a square synthesis kernel. Each synthesized pixel value is selected by computing a distance metric between local neighborhoods of height and width ksize between the current state of the synthesized texture and the input texture sample. 11 pixels is the default, but this value can be raised (lowered) to increase (decrease) the regularity of the synthesized texture.
  • visualize - (Optional) Visualize an in-progress texture synthesis.

Dependencies

  • Python - Tested on version 3.7.0
  • OpenCV - Tested on version 3.4.1
  • NumPy - Tested on version 1.15.0

Results

The following are selected results of this procedure. The leftmost column contains input texture samples and the rightmost column contains output synthesized textures. The middle column shows the completion of "layers" of the synthesis process.

Input Sample

Synthesis Process

Output Texture

161 Input

161 Synthesis

161 Output

D3 Input

D3 Synthesis

D3 Output

Wood Input

Wood Synthesis

Wood Output

texturesynthesis's People

Contributors

goldbema avatar

Watchers

James Cloos 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.