1 / 82

Introduction to Computer Vision

Lecture 6 Roger S. Gaborski. Introduction to Computer Vision. Exam 1 Grades (out of 50). Grades = 46.5000 44.0000 34.0000 31.0000 25.0000 46.5000 28.0000 38.0000 29.0000 47.0000 31.5000 35.5000 38.5000 39.0000 46.0000. **.

olesia
Download Presentation

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. Exam 1 Grades (out of 50) Grades = 46.5000 44.0000 34.0000 31.0000 25.0000 46.5000 28.0000 38.0000 29.0000 47.0000 31.5000 35.5000 38.5000 39.0000 46.0000 Roger S. Gaborski

  3. ** 4 out of top 5 had notes Roger S. Gaborski

  4. Exam 1 Corrections • For each question that you lost points, correct your answer. • Explain why your original answer was incorrect and why your revised answer is correct- don’t simply provide the correct answer • Turn in original exam and corrected questions (on a separate piece of paper) on Thursday (3/28) Roger S. Gaborski

  5. 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?

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

  7. 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

  8. 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

  9. 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.

  10. Gaussian Noise

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

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

  13. 2 D Gaussian

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

  15. Data + Gaussian Noise

  16. Data + Gaussian Noise

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

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

  19. Image + Noise

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

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

  22. Smoothed Noisy Image

  23. 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.

  24. Compare Original and Filtered Images

  25. Absolute Value of Original and Filtered Images

  26. Thresholded Diff Image Details lost by low pass filtering

  27. ‘Smart’ SmoothingorNoise Filtering

  28. 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

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

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

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

  32. 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 )

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

  34. 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

  35. Profiles of an Ideal Edge

  36. 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

  37. Edge Detection is Not Simple

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

  39. 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

  40. 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

  41. Simulated Data data diff(data) diff(diff(data))

  42. 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

  43. Actual Image Data

  44. Row 80

  45. diff Operator

  46. Smooth Image First

  47. 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 Δ

More Related