Presentation is loading. Please wait.

Presentation is loading. Please wait.

5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 1 Geographic Image Processing Data Transformation and Filtering Noise in data Arrays Digital filtering.

Similar presentations


Presentation on theme: "5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 1 Geographic Image Processing Data Transformation and Filtering Noise in data Arrays Digital filtering."— Presentation transcript:

1 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 1 Geographic Image Processing Data Transformation and Filtering Noise in data Arrays Digital filtering Filter coefficients Convolution Topographic map Gaussian Convolution Filter Coefficients

2 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 2 Types of Image Noise Distributed random (altitude uncertainty) –Gaussian (many physical measurements) –Uniform (useful for models and tests) Impulse noise (natural data disturbances) Salt-and-Pepper (random 0s and 1s)

3 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 3 Noisy Data In the slide to follow, –the first image shows DTED raw data, as distributed –the second image shows the same data corrupted by uniform random noise of ± 5 meters Note: Raw DTED data has noise of less than ±1 meter

4 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 4 Uniform Random Data Noise Normal DTED DataNoisy DTED Data

5 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 5 Effects of Noise Greater uncertainty in data Cascading uncertainty in computations performed on data: –Topographical maps –Attribute contours (contour maps) –Watershed gradients

6 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 6 Effect of Noise on Contour Plot Normal data contoursNoisy data contours

7 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 7 Gaussian Noise (Mean=0, StdDev=5) Noisy DTED DataNoisy data contours

8 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 8 Gaussian Noise - Filtereed Gaussian Noise - (Mean=0, StdDev=5) Image has been filtered 7x7 Gaussian convolution filter used to remove noise

9 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 9 Notes on Noise Contour maps frequently give contours 25 - 50 meters apart. If data points are not smoothed to this distance, contours will appear jagged Data points are on 10-meter centers, depending on type of noise, a recommended convolution array might be at least 11x11.

10 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 10 Raw and Averaged Contours Raw Data - Malvern3x3 Convolution

11 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 11 Effect of 7x7 vs 15x15 Convolutes 15x15 Gaussian filter 7x7 Gaussian filter

12 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 12 Reasons for Digital Filtering Reduction of random noise Smoothing of topological contours Smoothing topological cross-sections Smoothing of attribute contours (rainfall, etc.) Smoothing of data for gradient calculations To extract image features or attributes To enhance image features or attributes

13 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 13 What is digital filtering? Processing of raw data Uses filter algorithms Filters typically require coefficients to control the data processing Convolution methods frequently used for image processing (can be parallelized) Data combined from multiple points/sources

14 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 14 The Meaning of Digital Filtering Points in an image field contain noise Each single point is physically related to its surrounding points, so that sudden spatial changes are improbable Digital filtering exploits this relationship by adding information from surrounding points to the central points by means of a weighted summation process - convolution.

15 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 15 Convolution Filter Uses an array of filter weights Operated incrementally over entire data field, except near edges of data Each resulting point is sum of weighted data surrounding it, divided by sum of weights (normalized weights, shifted for convolution) ( ∑ Data*Weights / ∑ Weights )

16 Normalized Weights Each weight is normalized – dividing it by the sum of all the weights Normalized weights are assumed in the following two slides 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 16

17 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 17 Discrete Convolution

18 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 18 Example (normalized weights) d11d12d13d14d15 d21d22d23d24d25 d31d32d33d34d35 d41d42d43d44d45 d51d52d53d54d55 h33=(d22*w33+ d23*w32+ d24*w31+ d32*w23+ d33*w22+ d34*w21+ d42*w13+ d43*w12+ d44*w11) Data Weights Result w33w32w31 w23w22w21 w13w12w11

19 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 19 Example: Gaussian Image Filter Determine filter coefficients from spatial Gaussian function. Form convolution matrix Normalize coefficients Convolve matrix with spatial data Obtain filtered result for each image pixel

20 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 20 Result Convolution operation performed Gaussian filter kernel (square matrix with odd number of rows and columns) Gauss filter smooths or blurs an image

21 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 21 Gaussian Filter Coefficients Here σ is the standard deviation of the Mean. x and y are the spatial dimensions.

22 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 22 Calculation of Gaussian Weights s = 1.52; im = 3; nrm = 0; For[j = -im, j < im + 1, j++, For[i = -im, i < im + 1, i++, g = Exp[-((i^2 + j^2)/(2.0* s^2))]; gr = Round[g*67]; Print[gr]; nrm = nrm + gr; ] ] Print[nrm] Notes: See Models file for program. Degree of smoothing determines by value of “s”

23 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 23 Choice of Parameters Pick (odd) number of samples Pick σ to broaden filter to desired number of samples Pick multiplier (67 in example) to give unity coefficients at edges. Repeat until filter exhibits desired smoothing

24 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 24 Gaussian Convolution Matrix

25 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 25 Notes Central points have higher weight Diagonal points have weights reduced (distance to central point is longer) Whole number weights used, though NOT necessary. Normalized weights are Real numbers.

26 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 26 Comments Coefficients are typically whole numbers Sum of coefficients normalizes them, resulting in array of Real numbers Example filter gives most weight to central data (little blurring)

27 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 27 Mathematica ® Programming y = ListConvolve[c, sampledelev]; “c” is the convolution kernel array “sampledelev” is data table “y” is filtered data array (can be plotted as filtered topographic map)

28 Note If data matrix is m x m, and Convolution kernel is (2n+1) x (2n+1), then The filtered result will be (m-n) x (m-n) Example: m = 480 2n +1 = 17 Result is (480 - 8) x (480 - 8) 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 28

29 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 29 Filtering Malvern Data Normal DTED DataFiltered DTED Data

30 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 30 Comments on Filtering Gaussian filtering will remove some degree of random noise Resulting image will have some blurring, when compared with (noise-free) unfiltered data Convolution filtering with n x n kernel will reduce image size by 2*(n-1) pixels in both horizontal and vertical directions.

31 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 31 Filtering A Noisy Image ±5m Noisy DTED DataFiltered Noisy Data

32 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 32 High Noise Levels Gaussian filtering can remove a lot of noise! Resulting image may look quite sharp or may be blurred

33 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 33 Filtering Very Noisy Image ±10m Noisy DTED DataFiltered Very Noisy Data

34 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 34 Topographic Map Shows contours of equal altitude Fixed contour spacing Similar to horizontal “slices” through the topography Requires smooth (filtered) data

35 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 35 Filtered Topographic Map Malvern quadrangle Filtered data used Gaussian 7 x 7 convolution filter (s = 1.52) Contour lines at 20- meter intervals

36 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 36 Comment on Contour Map Edges are a little jaggy More filtering (smoothing) would be preferable, to get smooth contours 11x11 or 15x15 convolution kernels would be preferred

37 Questions? 5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 37


Download ppt "5/24/2015© 2009 Raymond P. Jefferis III Lect 05 - 1 Geographic Image Processing Data Transformation and Filtering Noise in data Arrays Digital filtering."

Similar presentations


Ads by Google