1 / 80

Introduction to Computer Vision

Lecture 6 Roger S. Gaborski. Introduction to Computer Vision. Quiz Today. Noise Issues. g(x,y) = f(x,y) + n(x,y) Where f(x,y) is the original image n(x,y) is the noise term (see text, page 143 for different types of noise) How does noise affect the image?

mikasi
Télécharger la présentation

Introduction to Computer Vision

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 6 Roger S. Gaborski Introduction to Computer Vision Roger S. Gaborski

  2. Quiz Today Roger S. Gaborski

  3. Noise Issues • g(x,y) = f(x,y) + n(x,y) • Where • f(x,y) is the original image • n(x,y) is the noise term (see text, page 143 for different types of noise) • How does noise affect the image? • Can we remove the effects of noise?

  4. Sources of Noise • Sensor (thermal, other) • Electronic circuitry noise • Transmission noise

  5. Standard Deviation • Statistics – analyzing data sets in terms of the relationships between the individual points • Standard Deviation is a measure of the spread of the data [0 8 12 20] [8 9 11 12] • Calculation: average distance from the mean of the data set to a point s = Σi=1n(Xi – X)2 (n -1) • Denominator of n-1 for sample and n for entire population

  6. Standard Deviation • For example [0 8 12 20] has s = 8.32 [8 9 11 12] has s = 1.82 [10 10 10 10] has s = 0

  7. Variance • Another measure of the spread of the data in a data set • Calculation: s2 = Σi=1n(Xi – X)2 (n -1) Why have both variance and SD to calculate the spread of data? Variance is claimed to be the original statistical measure of spread of data. However it’s unit would be expressed as a square e.g. cm2, which is unrealistic to express heights or other measures. Hence SD as the square root of variance was born.

  8. Gaussian Noise

  9. Histogram of Noise n(x) = (1 / 22 ) * exp( -(x-u)2 / 2) where  is standard deviation and u the mean

  10.  Controls the Width of the Bell-shaped Curve • Integral under curve is 1 Small  Large 

  11. 2 D Gaussian

  12. Data sig=ones([1 1000]); figure, stem(sig(1:15)),axis([0 15 0 2])

  13. Data + Gaussian Noise

  14. Data + Gaussian Noise

  15. Averaging • Averaging will smooth the signal • smoothData(i) = noisyData(i-1)+noisyData(i)+noisyData(i+1) 3

  16. Result of 3 Point Averaging Noisy Input Averaging with 3 Components First two responses due to edge effects (padded with zeros)

  17. Image + Noise

  18. Data from Row 300 Note: Noise values (amplitude) varies rapidly – high frequency component

  19. Can We Recover the Original Image from the Noisy Image? Noisy Input Three Point Averaging

  20. Smoothed Noisy Image

  21. Simple Averaging Filter • Averaging is effective a low pass filter. High frequency noise fluctuations are ‘blocked’ by the filter. • This can be an issue for fine detail. Fine detail in image will also be smoothed. • Tradeoff between keeping fine details in image and reducing noise.

  22. Compare Original and Filtered Images

  23. Absolute Value of Original and Filtered Images

  24. Thresholded Diff Image Details lost by low pass filtering

  25. ‘Smart’ SmoothingorNoise Filtering

  26. Nagao-Matsuyama FilterAn Attempt to Keep Fine Detail • Uses 9 5x5 windows (defined on next slide). • Each 5x5 window has a distinct subwindow defined • Calculate the variance for the pixels in each subwindow • Output is the mean of the pixels in the subwindow that has the lowest variance

  27. Nagao-Matsuyama Filter Average pixel values under red pixels. Calculate the corresponding variance. Use the filter with the smallest variance.

  28. Nagao-Matsuyama Filter • Why does this make sense?? • Why minimum variance?? • When would a block of image data have high variance?? • Low variance??

  29. How Could You Implement This Filter? Want to calculate variance of pixels in image where 1’s are located in filter Cannot use imfilter

  30. Implementation • B = NLFILTER(Image,[5 5],FUN) applies the function FUN to each 5-by-5 sliding block of A. FCN 1.Calculate variance for each filter 2.Choose filter with smallest variance 3.Calculate average with chosen filter (scaled by number of 1’s )

  31. Recall: Variance • Calculation: s2 = Σi=1n(Xi – X)2 (n -1)

  32. Edges • We would like to develop algorithms that detect important edges in images • The ‘quality’ of edges will depend on the image characteristics • Noise can result in false edges

  33. Profiles of an Ideal Edge

  34. Profile of Edge - Analysis • Same gray level input range [0,1] • Edge is located at ‘peak’ of first derivative • Cannot choose only one threshold value because range of first derivative depends on slope of gray level values • The edge is located where the second derivative goes through zero-independent of slope of gray level signal

  35. Edge Detection is Not Simple

  36. The derivative operation can be used to detect edgesHow can the derivative operator be approximated in a digital image??

  37. MATLAB Examples • Approximation to derivative – difference of adjacent data values • data = [ .10 .14 .13 .12 .11 .10 .11 .34 .33 .32 .35 .10 .11 .12 .12 .12]; • diff operator: second- first data value (.14-.10) • diff(data) = 0.04 -0.01 -0.01 -0.01 -0.01 0.01 0.23 -0.01 -0.01 0.03 -0.25 0.01 0.01 0 0 diff operator is approximation to first derivative

  38. Estimate of Second Derivative • diff(diff( data)) • -0.05 0 0.0 0 0.02 0.22 -0.24 0 0.04 -0.28 0.26 0 -0.0100 0

  39. Simulated Data data diff(data) diff(diff(data))

  40. How would you implement in a filter? • diff: second value – first value [ -1 +1 ] (could also use [+1 -1]) • Could also represent as: [-1 0 +1] • Use in correlation filter – same results

  41. Actual Image Data

  42. Row 80

  43. diff Operator

  44. Smooth Image First

  45. Gradient of a 2D Function Gradient is defined by a vector (see pg 366): Δ f = gx = f / x gy f / y The magnitude of the vector: mag( f) =[ gx2 + gy2 ]1/2 Δ

  46. Direction of Gradient • The gradient points in the direction of maximum change of intensity α(x,y) = tan-1 (gy / gx)

  47. Partial Derivatives in Vertical and Horizontal Directions • Vertical (y direction) • Horizontal (x direction)

More Related