Presentation by:
Oct 14, 2014
Presentation by:
Introduction
• A distance transform is a representation of a distance function to an object, as an image.
• It is also known as distance map or distance field.
Basics
• A connected space is a topological space which cannot be represented as the disjoint union of two or more nonempty open subsets.
• We often call a connected space an “object”.
Euclidean distance
• The Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, which can be proven by repeated application of the Pythagorean theorem.
• In Euclidean n-space, it is defined as:
√(∑(xi -yi )^2
Geodesic distance
• the distance between two vertices in a graph is the number of edges in a shortest path connecting them.
• to determine a geodesic distance in a connected space of this image:
each point - node of a graph,
each linkage - an arc
Comparison between Euclidean & Geodesic distances
Manhattan distance
• It is also known as rectilinear distance, L1 distance or city block distance.
• D = |x1 – x2 | + |y1 - y2|
• The red, blue, and yellow lines
have the same length (12) using
both Euclidean and Manhattan
distance.
• Using Euclidean geometry, the green
line is the unique shortest path.
Chessboard Distance
• The chessboard distance is a metric defined on a vector space where the distance between two vectors is the greatest of their differences along any coordinate dimension.
• The chessboard distance is the
number of moves a king requires
to move between spaces.
Distance map
• A distance transform, also known as distance map or distance field, is a derived representation of a digital image.
• The distance map labels each pixel of the image with the distance to the nearest obstacle pixel.
• A most common type of obstacle pixel is a boundary pixel in a binary image.
• Usually the transform/map is qualified with the chosen metric.
• Common metrics are:
Euclidean distance
Taxicab geometry, also known as City block distance or Manhattan distance
Chessboard distance
Chessboard distance transform on a binary image
Manhattan distance transform on a binary image
Binary input image.Black is background, white is object.
Output distance map using Manhattan distance.
Applications
Applications are
• digital image processing (e.g., blurring effects, skeletonising)
• motion planning in robotics
• path finding
Skeleton ExtractionShape -> DT -> Medial Axis
• The medial axis of an object is the set of all points having more than one closest point on the object's boundary.
• It is a tool for biological shape recognition.
Illustrations
The binary image when a distance transform is applied (scaled by a factor of 5) :
The distance transform is sometimes very sensitive to small changes in the object.
• This can be of advantage when we want to distinguish between similar objects like the two different rectangles above.
• However, it can also cause problems when trying to classify objects into classes of roughly the same shape.
• It also makes the distance transform very sensitive to noise.
Real world image -> Binary Image -> Distance Map
real world image
threshold the image at a value of 100
The scaled (factor 6) distance transform
What we learn from the illustration
• Distance transform gives a rough measure for the width of the object at each point.
• But is quite inaccurate at places where the object is incorrectly segmented from the background.
• Also the binary input image must be a good representation of the object that we want to process.
• Simple thresholding is often not enough. It might be necessary to further process the image before applying the distance transform.
References
• Technical Report on Distance Transform by Etienne Folio
• Distance Transform by David Coeurjolly
• HIPR2 Image Processing Learning Resources
• http://www.desmith.com/MJdS/DT1.htm
• http://www.cs.auckland.ac.nz/~rklette/TeachAuckland.html/mm/MI30slides.pdf
• http://www.tele.ucl.ac.be/PEOPLE/OC/these/node10.html#eq:def_chamfer34
Thank You