Giter VIP home page Giter VIP logo

meijster-distance's Introduction

Meijster distance

A General Algorithm for Computing Distance Transforms in Linear Time The Meijster distance computes a distance field from a boolean image. A boolean image is made up of zeros and ones, where zero means background (empty space) and one foreground. The resulting distance field is an image whose pixels store distance to foreground.

A distance field can be used for stroking shapes, computing Voronoi diagrams, pathfinding, or performing mathematical morphology operators. The distance field changes depending on the distance function used. Each distance function uses a different shape to compute distance, hold down option โŒฅ to reveal it.

This is the most commonly used distance function. Given a distance field (x,y) and an image (i,j) the distance field stores the euclidean distance : sqrt((x-i)2+(y-j)2)

Pick a point on the distance field, draw a circle using that point as center and the distance field value as radius. The circle will hit the closest foreground point.

Manhattan distance (Taxicab geometry)

The distance field stores the Manhattan distance : abs(x-i)+abs(y-j)

Pick a point on the distance field, draw a diamond (rhombus) using that point as center and the distance field value as radius. The diamond will hit the closest foreground point.

The distance field stores the chessboard distance : max(abs(x-i),abs(y-j))

Pick a point on the distance field, draw a square using that point as center and the double distance field value as edge length. The square will hit the closest foreground point.

meijster-distance's People

Contributors

parmanoir avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.