Coder Social home page Coder Social logo

alihaider11 / inpainting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zavolokas/inpainting

0.0 1.0 0.0 75.41 MB

Want to remove something(someone) from a photo as it never was there? This is .NET implementation of content-aware fill. It smartly fills in unwanted or missing areas of photographs.

License: MIT License

C# 100.00%

inpainting's Introduction

Inpainting

license Build Status Drone Status Donate Tweet

.NET implementation of content-aware fill (also known as inpainting or image completion) in image processing domain.

What is it for?

Content aware fill is used to fill in unwanted or missing areas of photographs. See an example of such fill below where we don't want to have the man in blue t-shirt on our picture:

Original image Processed image
t009 r009

Try in Docker

docker run -p 5000:80 -it --rm zavolokas/inpainter:latest

Navigate to http://localhost:5000

How to use it?

var inpainter = new Inpainter();
var result = inpainter.Inpaint(imageArgb, markupArgb, donors);
result
    .FromArgbToBitmap()
    .SaveTo(resultPath, ImageFormat.Png)
    .ShowFile();

The Inpainter takes as input

  • an image to inpaint
  • a simitransparent image with a mask
  • optionally it takes a set of simitransparent images that define donor areas for the parts of the area to inpaint.
  • optionally it takes an instance of settings.

Note: the images are not GDI+ images but images in an internal format and can be obtained from GDI+ Bitmaps using extensions.

Examples

Original Markup Process
t009 m009 p009
t020 m020 p020
t023 m023 p023
t058 m058 p058
t067 m067 p067

Settings

The execution of the algorithm can be customized by adjusting the settings.

  • MaxInpaintIterations: determines how many iterations will be run to find better values for the area to fill. The more iterations you run, the better result you'll get.
  • PatchDistanceCalculator: determines algorithm to use for calculating a metrics how much one color is different from another. Possible values are:
    • Cie76 - fastest
    • Cie2000 - more accurate

Donors

Credits

The implementation is based on following publications:

  • Yonatan Wexler, Eli Schechtman and Michal Irani Space-time completion of video IEEE. Trans. Pattern Analysis and Machine Intelligence, 29 (2007)
  • Connelly Barnes, Eli Shechtman, Adam Finkelstein, and Dan B Goldman. PatchMatch: A Randomized Correspondence Algorithm for Structural Image Editing. ACM Transactions on Graphics (Proc. SIGGRAPH) 28(3), August 2009

inpainting's People

Contributors

ferib avatar l4nk4b3l avatar octoate avatar thisgeektweets avatar zavolokas avatar

Watchers

 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.