Download - distance transform 21
![Page 1: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/1.jpg)
Presentation by:
![Page 2: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/2.jpg)
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.
![Page 3: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/3.jpg)
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”.
![Page 4: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/4.jpg)
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
![Page 5: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/5.jpg)
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
![Page 6: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/6.jpg)
Comparison between Euclidean & Geodesic distances
![Page 7: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/7.jpg)
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.
![Page 8: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/8.jpg)
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.
![Page 9: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/9.jpg)
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.
![Page 10: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/10.jpg)
• 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
![Page 11: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/11.jpg)
Chessboard distance transform on a binary image
![Page 12: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/12.jpg)
Manhattan distance transform on a binary image
Binary input image.Black is background, white is object.
Output distance map using Manhattan distance.
![Page 13: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/13.jpg)
Applications
Applications are
• digital image processing (e.g., blurring effects, skeletonising)
• motion planning in robotics
• path finding
![Page 14: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/14.jpg)
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.
![Page 15: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/15.jpg)
Illustrations
The binary image when a distance transform is applied (scaled by a factor of 5) :
![Page 16: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/16.jpg)
The distance transform is sometimes very sensitive to small changes in the object.
![Page 17: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/17.jpg)
• 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.
![Page 18: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/18.jpg)
Real world image -> Binary Image -> Distance Map
real world image
threshold the image at a value of 100
The scaled (factor 6) distance transform
![Page 19: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/19.jpg)
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.
![Page 20: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/20.jpg)
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
![Page 21: distance transform 21](https://reader034.vdocuments.us/reader034/viewer/2022051411/543dba5ab1af9f310a8b4b48/html5/thumbnails/21.jpg)
Thank You