Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spatial Filtering (Applying filters directly on Image) By Engr. Muhammad Saqib.

Similar presentations


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

5 Convolution by example

6

7 Output Image

8 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

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

10

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

12 Using Padding Obtaining a Full image using zero padding

13 Built in Command

14 Filtering in matlab

15 High Pass filter (Laplacian and Laplacian of gaussian)

16 Gaussian filter (low pass filter) Using fspecial we can create Gaussian filter Different gaussian filter

17 Applying Gaussian filter

18 Assignment#3 Question#1 Apply these filters on image and discuss the results

19 Non Linear Filters

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

21 Demonstration of Salt and Pepper noise To add Salt and Pepper noise

22 Cleaning Salt and Pepper Using Averaging filter Using a filter of 7 by 7 and see the result

23 Median Filtering Using Median Filtering Adding more noise See the effect of Applying 5x5 filter

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

25 Using Prewitt Filter Reading Image Applying Px Applying Py

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

27 Robert Cross and Sobel filters


Download ppt "Spatial Filtering (Applying filters directly on Image) By Engr. Muhammad Saqib."

Similar presentations


Ads by Google