1 / 17

Approximating image by relaxation

Approximating image by relaxation. Approximating Images by Relaxation. General idea. candidate fitness function Look at the candidate and assigns it a numerical score High score to a better candidate than to a less one If instead a better candidate gets a lower score -> penalty function.

avel
Download Presentation

Approximating image by relaxation

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. Approximating image by relaxation

  2. Approximating Images by Relaxation

  3. General idea • candidate • fitness function • Look at the candidate and assigns it a numerical score • High score to a better candidate than to a less one • If instead a better candidate gets a lower score -> penalty function

  4. The process best candidate <- initial candidate best score <- score(best candidate) while (!enough) { new candidate <- purburbing(best candidate) new score <- score(new candidate) if (best score > new score) { best score <- new score best candidate <- new candidate } }

  5. Basic loop of the algorithm Candidate PertubStep(double *bestScore, Candidate bestC, Procs procs) { Candidate newC = procs->perturb(bestC); double newScore = prcs->score(newC); if (newScore < *bestScore) { procs->save(newC); bestC = newC; *bestScore = newScore; } return(bestC); }

  6. Functions • Cadidate init() • Called before the optimizer runs, this sets up any required storage, and generates and returns the first candidate • Candidate perturn(Candidate c) • Perturb the input and return the perturbed version • double score(Candidate c) • Compute the penalty score for this candidate • void save(Candidate c) • Save the image specified by this candidate

  7. Scoring • Basic error measure • Importance weighted error measure • Two more measure • Overlap penalty • Gap penalty

  8. Scoring • Input • rImage: the reference image • cImage: the candidate image • The error at each pixel • Ep = Δr2 + Δg2 + Δb2 • The total error is the result of summing up this measure

  9. Scoring • Optional importance measure • iImage: importance image • Hand-painted or edge detected image • s: overall scale factor • I: the value of iImage at a specific pixel [0,1] • Importance-weighted error • Ei = s*I*Ep

  10. Scoring • Overlap penalty • Count how many times a given pixel is written to over the course of rendering the image • c: counter • Po: overlap penalty value • Constant for the whole image • Measure: (c -1)*Po

  11. Scoring • Gap penalty • If a given pixel has a count value c == 0 • Then add the score the value of a gap penalty value Pg • Constant for the whole image • The idea • To try to get all the pixels covered by at least one object, so that most of the background is covered

  12. Scoring • Etotal = Σ Ei • Ei = s*I*Ep + (c -1)*Po + (c==0) ? Pg : 0

  13. Perturbing • Swap the geometry • Picks a piece and changes it

  14. Perturbing • ξ: random number, [0, 1] • t: probability of swapping, (0.05 ~ 0.1) • if (ξ < t) swaps a random pair of objects & returns else picks a pieces & changes it • Swapping • None of the shape change, but their order is altered

  15. Perturbing • Shape change • Use permutation array • P: an array of integers that has as many entries as there are pieces of geometry • Initialize Pi = I • Scramble order of P • Modification of shape • As the simulation continues, the changes get smaller as pieces jostle into their best settings

  16. Examples Initial image 9970th image

  17. Examples Initial image 9917th image

More Related