1 / 26

Advanced Topics in Computer Graphics

Understand and implement a Poisson seamless cloning image editing tool for smooth completion and cloning. Use Euler-Lagrange equations and sparse algebraic systems to solve for unknown areas. Guide completion using gradients from another image. Program generates output images.

dunavant
Download Presentation

Advanced Topics in Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Topics in Computer Graphics Exercise 1 Poisson Image Editing Due date: 17.05.05 Presentation by: Tommer Leyvand

  2. General Description The purpose of this exercise is to understand and implement a Poisson seamless cloning image editing tool. Part 1: Smooth image completion Part 2: Poisson seamless cloning

  3. Input Images source image target image

  4. Simple Cloning Result

  5. Poisson Seamless Cloning Result

  6. Some More Results target image source images

  7. Some More Results simple cloning source images

  8. Some More Results Poisson seamless cloning source images

  9. Part 1 Smooth Completion

  10. Image as a 2D Function

  11. Smooth Image Completion What if there is a missing area ? f* – the known image Scalar 2D function from (x,y) to grayscale value. f - the image in the unknown area Ω– the unknown area (domain of f) Will complete the area as smoothly as possible.

  12. Smooth Image Completion(Cont.) Finding the minimum: Euler-Lagrange Discrete Aprx:

  13. Discrete Derivate in 1D • Given a discrete function f(xi)=fi f f(xi) f(xj) x

  14. Smooth Image Completion(Solving) • Each fx,y is an unknown variable xi, total of N variables (covering the unknown pixels) • Reduces to the sparse algebraic system: fx,y-1+fx-1,y-4fx,y+fx+1,y+fx,y+1=0 => xi-w+xi-1-4xi+xi+1+xi+w=0 x1 x2 … xN 0 0 b1 b2 0 0 0 b3 0 1 1 -4 1 1 Known values of f() contribute to the left side 1 1 -4 1 1 xi-w+xi-1-4xi+xi+1=-f(x,y+1) 1 1 -4 1 1 = N x N

  15. Program Usage The program generates one output image • Ex1 –complete <input image> R G B <output> Where R,G,B are the RGB values [0..255] of the unknown color (usually best as black 0,0,0) • Example: • Ex1 –complete in1.bmp 0 0 0 out1.bmp

  16. Wow result ground truth result input

  17. Part 2 Poisson Cloning

  18. Poisson Cloning:“Guiding” the completion • We can guide the completion from part1 to fill the hole using gradients from another source image • Reverse: Seek a function f whose gradients are closest to the gradients of the source image

  19. Poisson Cloning (forward difference) (backward difference)

  20. Poisson Cloning (Solving) • Each fx,y is a variable xi as before, solving • As before this reduces to a sparse algebraic system fx,y-1+fx-1,y-4fx,y+fx+1,y+fx,y+1=divG(x,y) => xi-w+xi-1-4xi+xi+1+xi+w=divG(x,y)

  21. Program Usage The program generates one output image • Ex1 –clone <source image> <source mask> <target image> x y <output> Where x y are the offset for the paste

  22. General Guidelines

  23. Important Remarks • You should write the programs in C or C++ or Matlab. • Document your program thoroughly. • In this assignment there is no need to open a window or use OpenGL in any way. • Visit the exercise web-page http://www.cs.tau.ac.il/~tommer/adv-graphics/ex1.htm

  24. Important Remarks • The work can be done in pairs. • Submit your work on diskettes (or CD’s). Hardcopy of the documentation. • Do not print the source-code • In the documentation: Answer the questions from exercise website • Points will be rewarded for nice and original images.

  25. More Important Remarks • Don't forget to check the number of parameters that your program receives. • Don't forget to check memory allocations, if they succeeded or failed. • Pay attention to the borders of the image. • Visualize the gradients/div to better understand what is going on

  26. A Little Help • IrfanView – An image viewer, editor. • FreeImage/CxImage – Open source libraries (C/C++) for working with images. • TAUCS – Sparse solver • See links on the exercise webpage • Important questions: • Email me tommer -a--t- tau.ac.il http://www.cs.tau.ac.il/~tommer/adv-graphics/ex1.htm

More Related