zavolokas/Inpainting
关于
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.
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Inpainting
.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 |
|---|---|
![]() |
![]() |
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 |
|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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
探索相关项目
加载中…















