1 / 31

240-373 Image Processing

Explore different image filtering techniques such as multi-image averaging, recursive filtering, median filtering, and k-closest averaging in image processing. Learn how these methods enhance images.

esilverman
Download Presentation

240-373 Image Processing

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. 240-373 Image Processing Montri Karnjanadecha montri@coe.psu.ac.th http://fivedots.coe.psu.ac.th/~montri 240-373: Chapter 5: Image Filtering

  2. Chapter 5 Image Filtering 240-373: Chapter 5: Image Filtering

  3. Filter Image Filtering • Filtering can be use to enhance some features and de-enhance others. • Usually used as a pre-processing step. • 4 basic types of filters (1) Low-pass filter (2) High-pass filter (3) Band-pass filter (4) Band-stop filter 240-373: Chapter 5: Image Filtering

  4. Multi-image averaging • A series of poor images of the same scene can be used to find a better image. • Averaging or filtering can be used to enhance the picture. 240-373: Chapter 5: Image Filtering

  5. Multi-image Averaging Techniques • Multi-image modal filtering • Chose the most popular gray level for each corresponding pixel in a sequence of images • Multi-image median filtering • Similar to modal filtering, except the middle value is chosen • sorting is needed • Multi-image averaging filtering • Using a weighted averaging technique 240-373: Chapter 5: Image Filtering

  6. Recursive Filtering Technique 9: Recursive filtering USE: To improve a sequence of still images--reducing noise by producing new images that correspond to weighted averages of previous images. OPERATION: It is assumed that newly collected images are available from a frame store with a fixed delay between each image. 240-373: Chapter 5: Image Filtering

  7. Recursive Filtering (cont’d) 1. Setting up: • copy an image into a separate frame store, dividing all the gray levels by an integer, n. Add to that image n-1 subsequent images, the gray levels of which are also divided by n. You should now have the average of the first n images in the frame store. 2. Recursion: • For every new image, multiply the contents of the frame store by (n-1)/n and the new image by 1/n, add them together and put the result back into the frame store. 240-373: Chapter 5: Image Filtering

  8. Recursive Filtering (cont’d) THEORY: At setup the frame store contains Then after many images the following steady state is created: 240-373: Chapter 5: Image Filtering

  9. Recursive Filtering cont’d n=10 n=5 n=2 new one 0.100 0.200 0.500 last one 0.090 0.128 0.250 last but 1 0.081 0.102 0.125 last but 2 0.073 0.080 0.063 last but 3 0.066 0.066 0.031 last but 4 0.059 0.052 0.016 last but 5 0.053 0.042 0.008 last but 6 0.048 0.034 0.004 last but 7 0.043 0.027 0.002 last but 8 0.039 0.021 0.001 last but 9 0.035 0.017 0.000 and so on 240-373: Chapter 5: Image Filtering

  10. Median Filtering USE: Noise removal while preserving edges in an image. OPERATION: Median filter is a low-pass filter that attempts to remove noisy pixels while keeping the edges intact. The value of the pixels in the window are sorted and the median--the middle value in the sorted list--is chosen. 240-373: Chapter 5: Image Filtering

  11. Median Filtering Example Example: Noise removal with a 3x3 median filter Image Output 240-373: Chapter 5: Image Filtering

  12. Median Filtering Example Modal filter: similar to median filter except that the most popular value from the set of nine is chosen. 240-373: Chapter 5: Image Filtering

  13. k-closest averaging USE: To preserve the actual values of the pixels without letting the noise get through to the final image OPERATION: • All pixels in the window are sorted • k pixels values closest to the target pixel (center pixel in the window) are averaged. If the target pixel is included, the effect is similar to a low-pass filter • k is constant that is smaller than the area of the window • To avoid pairs or triples of noisy pixels, an extension of this technique can be as follow: • k values nearest to the target, but not including q values closest to and including the target. 240-373: Chapter 5: Image Filtering

  14. Template and convolution • Template operations are very useful as elementary image filters. They can be used to: • enhance certain features, de-enhance others • identifying edge • smooth out noise • discover known shapes in an image 240-373: Chapter 5: Image Filtering

  15. Convolution USE: widely used in many operations OPERATION: • A template is an array of values. • It is placed step by step over the image. • At each step, creating a new window in the image the same size as the template 240-373: Chapter 5: Image Filtering

  16. Convolution (cont’d) OPERATION: • Associating with each element in the template a corresponding pixel in the image • Typically, the template element is multiplied by the corresponding image pixel gray level. The sum of these results, across the whole template, is recorded as a pixel gray level in a new image. • This ‘shift, add, multiply’ operation is called the ‘CONVOLUTION’ of the template with the image. 240-373: Chapter 5: Image Filtering

  17. Convolution (cont’d) If T(x,y) is the template (nxm) and I(X,Y) is the image (NxM), then the convolving of T with I is written as 240-373: Chapter 5: Image Filtering

  18. Convolution (cont’d) Often the template is not allowed to shift off the edge of the image, so the resulting image will be smaller than the original image. For example Template Image Result 1 1 3 3 4 2 5 7 6 * 1 0 1 1 4 4 3 2 4 7 7 * 0 1 2 1 3 3 3 3 2 7 7 * 1 1 1 4 4 * * * * * * = no value 240-373: Chapter 5: Image Filtering

  19. Convolution (cont’d) From the example, the 2x2 template is operating on a 4x5 image, giving a 3x4 result. The value 5 in the result is obtained from (1x1) + (0x3) + (0x1) + (1x4) 240-373: Chapter 5: Image Filtering

  20. Common templates • Low-pass filter (removing noise, blurring) • template 1 1 1 1 1 1 1 1 1 1 • template 2 (weighting with half of result is from the center pixel) 1 3 1 3 16 3 1 3 1 240-373: Chapter 5: Image Filtering

  21. Common templates • High-pass filter (remove gradual change, enhance sudden changes) • Laplacian template (the sample sums to zero) 0 -1 0 -1 4 -1 0 -1 0 240-373: Chapter 5: Image Filtering

  22. Example of low pass and high pass filtering Image After high pass after low pass 0 0 0 0 0 0 1 1 1 0 2 1 2 4 6 4 0 1 1 1 0 1 0 1 6 9 6 0 1 1 1 0 1 0 1 6 9 6 0 1 1 1 0 1 -5 1 11 14 11 0 1 6 1 0 -4 20 -4 11 14 11 0 1 1 1 0 2 -4 2 9 11 9 0 0 0 0 0 240-373: Chapter 5: Image Filtering

  23. Storing the convolution results • Convolution results normally need examination and transformation before storage. • In most applications, images are held as one array of bytes (or three arrays of bytes for color images). Each byte hold 0-255 unsigned integer. • The results of an operation must be transformed to within the range. • Scaling can be done to adjust the result range. • Other method is to use a floating point variable to hold each pixel value. This needs more memory, scaling and rounding. 240-373: Chapter 5: Image Filtering

  24. Interest Points • Interest points are identified by algorithms that can be applied first to images containing a known object, and then to images where recognition of the object is required 240-373: Chapter 5: Image Filtering

  25. Moravec operator Technique 6: Moravec operator USE: To identify a set of points on an image by which the image may be classified or compared OPERATION: • Computing variance where 240-373: Chapter 5: Image Filtering

  26. Moravec operator • Passing a 3x3 window and saving minimum • Passing a 3x3 window and setting to zero the center pixel when its value is not maximum in the window • Simplified formula 240-373: Chapter 5: Image Filtering

  27. Example Image Variances After step 1 After step 2 240-373: Chapter 5: Image Filtering

  28. Correlation Technique 7: Correlation USE: To find where a template matches a window in an image, To determine the existence of a known shape in an image. THEORY: If N x M image is addressed by I(X,Y) and n x m template is addressed by t(i,j) then 240-373: Chapter 5: Image Filtering

  29. Correlation 1 2 3 240-373: Chapter 5: Image Filtering

  30. Correlation 1: is constant across the image, so can be ignored 2: is t convolved with I 3: is constant only if average light from image is constant across image (often approximately true) 240-373: Chapter 5: Image Filtering

  31. Some comments on correlation technique • If overall light intensity across the whole image is fairly constant, it is safe to use convolution instead of correlation. • The object may have any orientation. • The object may have any size. 240-373: Chapter 5: Image Filtering

More Related