Docsity

Stroke-Based Rendering - Advanced Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Stroke-Based Rendering - Advanced Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Non-Photorealistic Rendering

Tobias Isenberg

Stroke-Based Rendering

Overview

• introduction and overview

• optimization strategies

• greedy algorithms

Introduction

• stroke as the main primitive

  • (semi-)automatic placement of discrete elements
  • use of objective function to measure placement quality
  • typical goal: represent an image or a 3D shape
  • result: abstracted version of the source image/shape

Introduction

• control of stroke placement

  • automatic
  • semi-automatic
  • interactive

• human control at all levels

  • decision on the stroke set
  • decision on the source image
  • parameters of objective function
  • semi-automatic stroke placement
  • interactive stroke placement

© Gavin Ross, (http://www.gavinross.com/)used with permission

Definitions

• necessary elements for stroke-based rendering:

  • canvas: background color/texture/object
  • ordered list of strokes with parameterization, to be rendered (alpha-blended) onto the background
  • SBR energy function: measurement of image quality

E: I  R; I = set of possible images, R = real numbers

Energy Function E(I)

• measures how closely input image is matched

• also encodes trade-offs

  • e.g., abstraction by enforcing larger strokes
  • otherwise very many (m×n) tiny paint strokes (pixels)

• example for an SBR energy function

  • wabs is a factor to parameterize the influence of Eabs
  • S is the source image

E I I

E I x y S x y

E I E I w E I

abs

xy I

match

match abs abs

( ) number of strokes in

( , )

2

Stroke-Based Rendering Strategies

• optimization strategies

  • Voronoi algorithms: Lloyd’s method and variations
  • trial-and-error algorithms

• greedy algorithms

  • rendering in one go

Stroke-Based Rendering

Optimization Strategies

Voronoi Algorithms

• general class of applications

  • images that contain many non-overlapping strokes
  • only stroke density is constrained

• examples

  • stippling: small black dots
  • mosaics: small colored pieces

• general idea

  • use efficient algorithms from computational geometry
  • place elements evenly, no overlaps
  • use GPU to speed up the process

• note: energy function defined as density, not tone

Lloyd’s Method: Brief Recap

• iterative optimization technique

• minimize energy function describing the distance

between points and their Voronoi region centroids

• estimation of Voronoi regions can be done on GPU

• previously seen two techniques

  • interactive techniques using brushes
  • automatic technique with weighted Voronoi regions

Lloyd’s Method to Create Mosaics

• modifications to Lloyd’s method:

  • use of Manhattan distance to obtain rectangular tiles
  • use an underlying vector field to guide the computation of this metric: derived from the image’s edge information
  • computing the Voronoi diagrams through rendering: pyramids at point positions with ID color, orthographic
  • results in discrete Voronoi diagram

Lloyd’s Method to Create Mosaics

• extension of the basic technique

  • avoiding an edge by affecting the centroid computation: rendering non-ID color over Voronoi diagram affects the centroid computation so that eventually tiles avoid it
  • result: rendering of image edges included, tiles avoid features

Lloyd’s Method to Create Mosaics

Lloyd’s Method to Create Mosaics