Lecture 16: (11/12) Some Tech Tricks

by Mike Gleicher on November 12, 2012

  1. Distance Transform Algorithm – to think about GPUs, parallelism
  2. Distance Transform Applications – to think about AI
  3. Noise – a useful topic, but cute tricks

Distance Transform Algorithm

Review Danielson EDT (linear time)

  • linear but serial (and linear in # of pixels, not edge size)

equivalence to vornoi diagrams

Introduce propagation algorithm

  1. fast implementations with priority queues
  2. parallel implementation (flooding)
  • look at neighbors (local computation)
  • edge length passes (as opposed to #pixels)
  • makes sense if you have a massively parallel machine
  • jump flooding
    • doubling (1,2,4) – log N fill
    • halving (8,4,3,1) – log N fill (if you start with log N)
    • jump flood (x+i, y+i) I in (log N … 1)
    • not exact (gets some edge cases wrong)
    • provably very close – extra pass or two gets very close
    • log N passes (each one linear in pixels amount of work)
    • http://www.comp.nus.edu.sg/~tants/jfa.html

    What might you use this for?

    • gradients – tell you how to get away (avoid)
    • collisions
      • grow obstacles, shrink objects (point querries)
    • navigation
    • find low cost paths (draw lines and adapt)
    • influence maps

    Perlin Noise

    Print Friendly, PDF & Email

    Previous post:

    Next post: