150 likes | 455 Views
Distance Measures Tutorial Podcast. CSC 520 Digital Image Processing Dr. Karl Ricanek Jr. Distance Measures Tutorial. Overview City-block measure Chessboard measure Euclidean measure Example Euclidean, D 4 (N 4 ), and D 8 (N D ). Distance Measures Tutorial. Euclidean (L 2 )
E N D
Distance Measures TutorialPodcast CSC 520 Digital Image Processing Dr. Karl Ricanek Jr. Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Overview • City-block measure • Chessboard measure • Euclidean measure • Example • Euclidean, D4 (N4), and D8 (ND) Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Euclidean (L2) • De(p,q) = [(x-s)2 + (y-t)2]1/2 • p & q are pixels with coordinates p(x,y), q(s,t) • measure is a radial measure from center (p) Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • City-block • D4(p,q) = |x-s| + |y-t| • p & q are pixels with coordinates p(x,y), q(s,t) • D4 <= 2 (center) Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Chessboard • D8(p,q) = max(|x-s| , |y-t|) • p & q are pixels with coordinates p(x,y), q(s,t) • D8 <= 2 (center) Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute De for p(2,5) , q(3, 8) • De(p,q) = [(x-s)2 + (y-t)2]1/2 Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute De for p(2,5) , q(3, 8) • De(p,q) = [(x-s)2 + (y-t)2]1/2 Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute De for p(2,5) , q(3, 8) • De(p,q) = [(x-s)2 + (y-t)2]1/2 De(p,q) = [(2-3)2 + (5-8)2]1/2 =[ 1 + 9] ½ = 3.16 Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute D4 for p(2,5) , q(3, 8) • D4(p,q) = |x-s| + |y-t| • N4(p) • {(x+1,y), (x,y-1), (x-1,y),(x,y+1)} Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute D4 for p(2,5) , q(3, 8) • D4(p,q) = |x-s| + |y-t| • Shortest path 4 segments. Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute D4 for p(2,5) , q(3, 8) • D4(p,q) = |x-s| + |y-t| • Alternative shortest path. D4(p,q) = |2-3| + |5-8| = 4 Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute D8 for p(2,5) , q(3, 8) • D8(p,q) = max(|x-s| , |y-t|) • N4(p) • {(x+1,y), (x,y-1), (x-1,y),(x,y+1)} • ND(p) • {(x-1,y-1), (x-1,y-1), (x-1,y+1),(x+1,y+1)} Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute D8 for p(2,5) , q(3, 8) • D8(p,q) = max(|x-s| , |y-t|) • Shortest path 3 Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk
Distance Measures Tutorial • Example • Compute D8 for p(2,5) , q(3, 8) • D8(p,q) = max(|x-s| , |y-t|) • Alternative shortest path D8(p,q) = max(|2-3| , |5-8|) = max( 1 , 3) = 3 Dr. Karl Ricanek Jr. http://people.uncw.edu/ricanekk