5/12/2015© 2009 Raymond P. Jefferis III Lect 07 - 1 Geographic Information Processing Data Analysis Watersheds Gradient path - Valleys - Ridges Flow analysis.

Slides:



Advertisements
Similar presentations
Convolution. Why? Image processing Remove noise from images (e.g. poor transmission (from space), measurement (X-Rays))
Advertisements

4/20/2015© 2009 Raymond P. Jefferis III Lect Geographic Information Processing Terrain Mapping and Analysis Contour map after Gaussian filtering.
Spatial Filtering (Chapter 3)
Instructor: Mircea Nicolescu Lecture 6 CS 485 / 685 Computer Vision.
Concept 2: Contour maps and topographic maps
5/24/2015© 2009 Raymond P. Jefferis III Lect Geographic Image Processing Data Transformation and Filtering Noise in data Arrays Digital filtering.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Edge Detection CSE P 576 Larry Zitnick
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 4 Edge Detection
Canny Edge Detector.
1 Image filtering Hybrid Images, Oliva et al.,
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
Announcements Mailing list: –you should have received messages Project 1 out today (due in two weeks)
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Canny Edge Detector1 1)Smooth image with a Gaussian optimizes the trade-off between noise filtering and edge localization 2)Compute the Gradient magnitude.
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
1 Image filtering
Filters and Edges. Zebra convolved with Leopard.
Some Potential Terrain Analysis Tools for ArcGIS David G. Tarboton
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Scale-Invariant Feature Transform (SIFT) Jinxiang Chai.
3-D Computational Vision CSc Canny Edge Detection.
From Topographic Maps to Digital Elevation Models Daniel Sheehan IS&T Academic Computing Anne Graham MIT Libraries.
Coordinate System Unit 1: Mapping the Earth
Terrain Mapping and Analysis
8/23/2015© 2009 Raymond P. Jefferis III Lect Geographic Information Processing Spatial Interpolation Freed, et al, Magnetometer field readings of.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
G52IIP, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
Edge Detection (with implementation on a GPU) And Text Recognition (if time permits) Jared Barnes Chris Jackson.
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Image Processing Edge detection Filtering: Noise suppresion.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski, Ch 4.1.2, From Sandlot.
Chapter 10 Image Segmentation.
G52IVG, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
EECS 274 Computer Vision Segmentation by Clustering II.
Chapter 8 – Geographic Information Analysis O’Sullivan and Unwin “ Describing and Analyzing Fields” By: Scott Clobes.
6/4/2016© 2009 Raymond P. Jefferis III Lect Geographic Information Processing Attribute Plotting Extracting data features Calculating derivatives.
CVPR 2003 Tutorial Recognition and Matching Based on Local Invariant Features David Lowe Computer Science Department University of British Columbia.
Adding the third dimension In high relief areas variables such as altitude, aspect and slope strongly influence both human and physical environments –a.
CS654: Digital Image Analysis Lecture 24: Introduction to Image Segmentation: Edge Detection Slide credits: Derek Hoiem, Lana Lazebnik, Steve Seitz, David.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
CSE 185 Introduction to Computer Vision Edges. Scale space Reading: Chapter 3 of S.
EE 4780 Edge Detection.
Many slides from Steve Seitz and Larry Zitnick
Optical Flow. Distribution of apparent velocities of movement of brightness pattern in an image.
L7 - Raster Algorithms L7 – Raster Algorithms NGEN06(TEK230) – Algorithms in Geographical Information Systems.
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Edge Detection.
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
DTM Applications Presentation.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Computer Vision Image Features Instructor: Dr. Sherif Sami Lecture 4.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Lecture 8: Edges and Feature Detection
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
Winter in Kraków photographed by Marcin Ryczek
Edge Detection slides taken and adapted from public websites:
CS262: Computer Vision Lect 09: SIFT Descriptors
Terrain modelling: the basics
Edge Detection CS 678 Spring 2018.
Computer Vision Lecture 9: Edge Detection II
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Dr. Chang Shu COMP 4900C Winter 2008
Digital Image Processing
Canny Edge Detector.
Edge Detection Today’s readings Cipolla and Gee Watt,
IT472 Digital Image Processing
IT472 Digital Image Processing
Presentation transcript:

5/12/2015© 2009 Raymond P. Jefferis III Lect Geographic Information Processing Data Analysis Watersheds Gradient path - Valleys - Ridges Flow analysis Contours Chester County, PA Watersheds, Chester County Board of Commissioners

5/12/2015© 2009 Raymond P. Jefferis III Lect Computing Watersheds Gradient-following –Locating valleys –Locating ridges

5/12/2015© 2009 Raymond P. Jefferis III Lect Gradient-Following Methods Spatial derivatives computed in both x- and y-directions Vector addition of derivatives produces gradient vectors Negative gradients point “down” Positive gradients point “up” Follow gradients to valleys or peaks

5/12/2015© 2009 Raymond P. Jefferis III Lect Data Preparation Gradient-following methods become “stuck” at local minima DTED Level 2 data has had pockets filled [filled DEM data] Use digital filtering to smooth contours before computing gradients. Gaussian filtering is best for band-limited random noise.

5/12/2015© 2009 Raymond P. Jefferis III Lect Following the Gradient Perform Gaussian filtering of data Compute gradient at all points, using Savitsky and Golay (or other) filter Start at any point Move in direction of desired gradient Stop when gradient is zero (This can be minimum or maximum point)

5/12/2015© 2009 Raymond P. Jefferis III Lect Notes Two derivatives computed for each point –x-direction derivative –y-direction derivative Gradient is vector sum of x- and y- derivative at each point (Result will have Magnitude and Direction)

5/12/2015© 2009 Raymond P. Jefferis III Lect Gradient Computation For data field, f(x,y), the gradient vector is a vector of spatial derivatives defined as: Where,

5/12/2015© 2009 Raymond P. Jefferis III Lect Note Geographic pixels are of finite extent (not infinitesimal), thus the gradients must be computed by finite difference methods that only approximate the derivative definitions above.

5/12/2015© 2009 Raymond P. Jefferis III Lect Computational Notes G x can be computed by convolution, using a kernel that gives the x-gradient G y can be computed by convolution, using a kernel that gives the y-gradient The actual gradient is vector sum of these (See next slide for polar coordinate vector)

5/12/2015© 2009 Raymond P. Jefferis III Lect Derivative Magnitude and Direction Can produce gradient vector at each point.

5/12/2015© 2009 Raymond P. Jefferis III Lect Computing Gradients Nearest neighbor differencing –Follows the finite approximation –Amplifies data noise (no smoothing) Convolution –Uses special kernels –Can do smoothing of entire image –Rapid computations (parallel processing)

5/12/2015© 2009 Raymond P. Jefferis III Lect Problems with Gradient Methods Local minima –Gradient gets “stuck” in a local minimum –Level 2 DTED data should eliminate this –Filter data for smooth contours Data resolution limits –Resolution of  1 meter makes valleys flat –Adds Uniform random noise –Results in big “puddles” (See following:)

5/12/2015© 2009 Raymond P. Jefferis III Lect Altitude Resolution Problem Gradient-following result Filtering: 7x7 Gaussian convolute Altitude resolution: 1 meter Note flat areas where gradient cannot be resolved (black)

5/12/2015© 2009 Raymond P. Jefferis III Lect Solutions More smoothing (15x15 convolute) [use Gaussian convolution kernel] Use 11x11 convolute for derivatives More complex descent algorithms Using surveyed stream/river data and connecting descending flows to these streams/rivers

5/12/2015© 2009 Raymond P. Jefferis III Lect Malvern Gradient Vectors Heights convolution filtered Gaussian filter 15 x 15 kernel Gradients by convolution Savitsky & Golay 11 x 11 kernels Gradients shown at every 7th point

5/12/2015© 2009 Raymond P. Jefferis III Lect Note Inspect Savitsky & Golay derivative convolution kernels at this point. (Handout)

5/12/2015© 2009 Raymond P. Jefferis III Lect Savitsky & Golay Kernels Polynomial based User selects polynomial type –Quadratic,Cubic, Quartic, Quintic, etc. User selects number of terms –Number of data points used in filter calculation –Varies degree of smoothing (more points means more smoothing - more information used from surrounding points for each point at which derivative is calculated)

5/12/2015© 2009 Raymond P. Jefferis III Lect x15 Gaussian Filter Kernel Array[c, 16, 16]; n = 15; sm = ; c = {{1, 2, 3, 5, 6, 7, 8, 9, 8, 7, 6, 5, 3, 2, 1}, {2, 3, 5, 8, 10, 13, 14, 15, 14, 13, 10, 8, 5, 3, 2}, {3, 5, 8, 12, 16, 20, 22, 23, 22, 20, 16, 12, 8, 5, 3}, {5, 8, 12, 18, 23, 29, 32, 34, 32, 29, 23, 18, 12, 8, 5}, {6, 10, 16, 23, 31, 38, 43, 45, 43, 38, 31, 23, 16, 10, 6}, {7, 13, 20, 29, 38, 47, 53, 55, 53, 47, 38, 29, 20, 13, 7}, {8, 14, 22, 32, 43, 53, 60, 62, 60, 53, 43, 32, 22, 14, 8}, {9, 15, 23, 34, 45, 55, 62, 65, 62, 55, 45, 34, 23, 15, 9}, {8, 14, 22, 32, 43, 53, 60, 62, 60, 53, 43, 32, 22, 14, 8}, {7, 13, 20, 29, 38, 47, 53, 55, 53, 47, 38, 29, 20, 13, 7}, {6, 10, 16, 23, 31, 38, 43, 45, 43, 38, 31, 23, 16, 10, 6}, {5, 8, 12, 18, 23, 29, 32, 34, 32, 29, 23, 18, 12, 8, 5}, {3, 5, 8, 12, 16, 20, 22, 23, 22, 20, 16, 12, 8, 5, 3}, {2, 3, 5, 8, 10, 13, 14, 15, 14, 13, 10, 8, 5, 3, 2}, {1, 2, 3, 5, 6, 7, 8, 9, 8, 7, 6, 5, 3, 2, 1}}/sm;

5/12/2015© 2009 Raymond P. Jefferis III Lect Derivative Kernels (S & G) Array[cx, 12, 12]; n = 11; sm = 110.0; cx = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}/sm; Array[cy, 12, 12]; n = 11; sm = 110.0; cy = {{0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, -4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0}}/sm;

5/12/2015© 2009 Raymond P. Jefferis III Lect Finding Valleys Smooth data, using Gaussian convolution filtering Compute gradient at all points, using Savitsky & Golay derivative kernel Select starting points Follow gradient downward Stop when gradient is zero or path reverses

5/12/2015© 2009 Raymond P. Jefferis III Lect Malvern Flow Tracks Heights convolution filtered Gaussian filter 15 x 15 kernel Gradients by convolution Savitsky & Golay 11 x 11 kernel Tracks follow gradients, starting from every 8th pixel

5/12/2015© 2009 Raymond P. Jefferis III Lect Gradient-Following Code For[jx = 7, jx < nx - 10, jx += 5,{ For[jy = 7, jy < ny - 10, jy += 5, { kx = jx; ky = jy; exit = False; While[ kx > 6 && ky > 6 && kx < (nx - 10) && ky < (ny - 10) && ! Exit, zr = gx[[kx - 6, ky - 6]]; zi = gy[[kx - 6, ky - 6]]; zc = 1.0*RandomInteger[{-1, 1}] + ArcTan[zi, zr]/Degree; If[zc < 0.0, zc = zc]; rzc = 1 + Mod[(Round[zc/22.5](*+RandomInteger[{-1,1}]*)), 16]; vec = dxy[[rzc]]; kx = kx +vec[[1]]; ky = ky + vec[[2]]; If[((kx < 1) || (ky < 1) || y[[ kx, ky]] < 0.0), exit = True]; y[[ kx, ky]] = -1.0; sd[[ kx + 7, ky + 7]] = -1.0; ]; }] }]

5/12/2015© 2009 Raymond P. Jefferis III Lect Possible Applications Watershed analysis Finding wetlands Predicting path of HAZMAT spill Back-tracing contaminants to source(s)

5/12/2015© 2009 Raymond P. Jefferis III Lect Visualization

5/12/2015© 2009 Raymond P. Jefferis III Lect Flow Analysis Gradients direct flow to adjacent cells Flows merge and add (volumetric flow) Show on plot when flow volume exceeds a given threshold Note - Possible improvement: Add to altitude as flow volume increases May require re-computation of gradients

5/12/2015© 2009 Raymond P. Jefferis III Lect Merging Flows Set starting point flow to unity Move one pixel along gradient Merge, adding flows Plot when flow > threshhold

5/12/2015© 2009 Raymond P. Jefferis III Lect Finding Ridge Lines Smooth data, using Gaussian convolution kernel Compute gradients at all points, using Savitsky & Golay derivative kernel Select starting points Follow against gradient to ridge line

5/12/2015© 2009 Raymond P. Jefferis III Lect Malvern Ridge Lines Ridge lines found by following gradient backward to maximum Starting point every 5 pixels.

5/12/2015© 2009 Raymond P. Jefferis III Lect Gradient-Following Code For[jx = 7, jx 6 && ky > 6 && kx < (nx - 10) && ky < (ny - 10) && ! exit, zr = gx[[kx - 6, ky - 6]]; zi = gy[[kx - 6, ky - 6]]; zc = 1.0*RandomInteger[{-1, 1}] + ArcTan[zi, zr]/Degree; If[zc < 0.0, zc = zc]; rzc = 1 + Mod[(Round[zc/22.5](*+RandomInteger[{-1,1}]*)), 16]; vec = dxy[[rzc]]; kx = kx - vec[[1]]; ky = ky - vec[[2]]; If[((kx < 1) || (ky < 1) || y[[ kx, ky]] < 0.0), exit = True]; y[[ kx, ky]] = -1.0; sd[[ kx + 7, ky + 7]] = -1.0; ]; }] }]

5/12/2015© 2009 Raymond P. Jefferis III Lect Possible Application Locating watershed ridge lines Locating source of contamination

5/12/2015© 2009 Raymond P. Jefferis III Lect Max., Min., and Curvature Gradient minimum and maximum points - Filter: S&G 15-point - Point selection; Gradient < 0.4 Curvature > 240

5/12/2015© 2009 Raymond P. Jefferis III Lect Contours Contour map after Gaussian filtering Malvern Quadrangle USGS DEM Data Contours appear as horizontal slices through topography. Contour spacing can be controlled by software.

5/12/2015© 2009 Raymond P. Jefferis III Lect Data Preparation Bad data points are removed Data is smoothed (Gaussian filter) Contour interval is selected (or specific contour set is selected) Color scheme is selected

5/12/2015© 2009 Raymond P. Jefferis III Lect Plotting Contours ListContourPlot[y, AspectRatio -> / , Contours -> {40, 80, 120, 160, 200, 240, 280, 320}, ColorFunction -> "Topographic"] Notes: Contours produced at indicated heights (meters). Aspect ratio corrects image for latitude Other color functions possible

5/12/2015© 2009 Raymond P. Jefferis III Lect Contour Plot Problems Digital filtering required to insure smooth contours BEWARE! Contour plots require a LOT of memory in computer.

5/12/2015© 2009 Raymond P. Jefferis III Lect Discussion