1 / 27

Spatial Filtering (Applying filters directly on Image)

Spatial Filtering (Applying filters directly on Image). By Engr. Muhammad Saqib. Two types of filtering Linear Filtering Non Linear Filtering. High Frequency and Low frequency components in Image.

horace
Télécharger la présentation

Spatial Filtering (Applying filters directly on Image)

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. Spatial Filtering(Applying filters directly on Image) By Engr. Muhammad Saqib

  2. Two types of filtering • Linear Filtering • Non Linear Filtering

  3. High Frequency and Low frequency components in Image • Fundamentally, the frequencies of an image are the amount by which grey values change with distance High frequency components are characterized by large changes in grey values over small distances; example of high frequency components are edges and noise. • Low frequency components, on the other hand, are parts of the image characterized by little change in the grey values.

  4. Convolution by example

  5. Output Image

  6. The filter2 function does the job of linear filtering for us; its use is filter2(filter,image,shape) and the result is a matrix of data type double. The parameter shape is optional, it describes the method for dealing with the edges

  7. filter2(filter,image,'same') is the default; it produces a matrix of equal size to the original image matrix. It uses zero padding:

  8. filter2(filter,image,'valid') applies the mask only to inside pixels. We can see that the result will always be smaller than the original:

  9. Using Padding • Obtaining a Full image using zero padding

  10. Built in Command

  11. Filtering in matlab

  12. High Pass filter (Laplacian and Laplacian of gaussian)

  13. Gaussian filter (low pass filter) • Using fspecial we can create Gaussian filter • Different gaussian filter

  14. Applying Gaussian filter

  15. Assignment#3 • Question#1 Apply these filters on image and discuss the results

  16. Non Linear Filters

  17. Salt and pepper noise Also called impulse noise, shot noise, or binary noise. This degradation can be caused by sharp, sudden disturbances in the image signal; its appearance is randomly scattered white or black (or both) pixels over the image.

  18. Demonstration of Salt and Pepper noise • To add Salt and Pepper noise

  19. Cleaning Salt and Pepper • Using Averaging filter • Using a filter of 7 by 7 and see the result

  20. Median Filtering • Using Median Filtering • Adding more noise • See the effect of Applying 5x5 filter

  21. Edge Detection • Edges contain some of the most useful information in an image. We may use edges to measure the size of objects in an image; to isolate particular objects from their background; to recognize or classify objects. There are a large number of edge-nding algorithms in existence, and we shall look at some of the more straightforward of them.

  22. Using Prewitt Filter • Reading Image • Applying Px • Applying Py

  23. Using Prewitt Filter • Creating Image containing all the edges • Binary Image can be created as follow • Single Command for applying Prewitt Filter

  24. Robert Cross and Sobel filters

More Related