image processing (spatial &frequency domain) image processing (spatial &frequency domain)...

29
Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail: [email protected] University of UD

Upload: keila-blount

Post on 16-Dec-2015

273 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image processing(spatial &frequency

domain)

College of Science Computer Science Department

2013-2014

E-mail: [email protected]

University of UD

Page 2: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Computer Graphics

Image process inspatial &frequency domainFaculty of Physical and Basic Education

Computer Science Dep. 2014-2015

Lecturer: 14Azhee W. MD.

E-mail: [email protected]@gmail.com

Page 3: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Outline

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2012-2013

3

Image processing

Image processing(spatial &frequency domain)

Spatial Domain

frequency domain

Image Filtering in Spatial Domain

Linear spatial filtering

nonlinear spatial filtering

median filter

Image Filtering in Frequency Domain

Low Pass Filtering

Gaussian Low pass Filters

Page 4: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image processing

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

4

A technique in which the data from an image are digitized and various mathematical operations are applied to the data.

generally with a digital computer, in order to create an enhanced image that is more useful or

for special purpose like security , traffic , face recoganization ).

or to perform some of the interpretation and recognition tasks usually performed by humans, also known as picture processing

Page 5: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image processing(spatial &frequency domain)

5

The following diagram shows the image processing method in both spatial and frequency domain.

LPF = Low Pass Filter (like, Ideal, Gaussian) HPF= High Pass Filter (like, Ideal, Laplacian) BPF= Band Pass Filter (like, Ideal, Stop)

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 6: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image processing (Spatial Domain)

6

Spatial domain processing means that we are performing operations on the intensity values f(x, y) on the image .

Two principle categories: Intensity transformation (Point

independent) Spatial filtering (Point dependent)

Intensity transformation works on single pixels independent of other pixels.

Spatial filtering works on a neighborhood of every pixel. University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 7: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain

7

The value of a pixel with coordinates (x,y) in the enhanced image is the result of performing some operation on the pixels in the neighborhood of (x,y) in the input image.

F. Spatial filtering is performed by convolving the image with a mask or a kernel. Spatial filters include sharpening, smoothing, edge detection, noise removal, etc.

In general, linear filtering of an image f of size M x N with filter size m x n is given by the expression, where g(x,y) is enhanced image, f(x,y) is input image and w(s,t) is mask or filter which is applying on input image.

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 8: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain

8University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep.

2014-2015

Page 9: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain cont’s

9

The general block diagram of image filtering in spatial domain illustrates below:

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 10: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain

10

1-

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 11: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain

11

2-

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 12: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

12

Example

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 13: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example cont’s

13

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 14: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example cont’s

14

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 15: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain

15

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 16: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Spatial Domain Median filter

16

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 17: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example

17

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 18: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example cont’s

18

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 19: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example cont’s

19

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 20: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example

20University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep.

2014-2015

Page 21: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Frequency Domain

21

In frequency domain, the low frequency components are generally the approximation and while high frequency components are generally details, edges, and/or noise.

One can take the discrete Fourier transform of an image, modify the Fourier transform, and take the inverse discrete Fourier transform to obtain the modified image according to the following model.

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 22: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image Filtering in Frequency Domain

22

The general block diagram of image filtering in frequency domain illustrates as:

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 23: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Image processing (frequency domain )

23

The coefficients corresponding to the new domain (frequency domain) are the transform coefficients.

Image processing operations that process transform coefficients are called transform domain processing.

Low frequency means that the sine/cosine curves are slowly varying (or even constant).

High frequency means that the sine/cosine curves are rapidly changing. University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 24: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Low‐Pass Filtering:

24

ILPF: The Ideal Low-pass Filter is the simplest low pass filter that “cuts off” all high frequency component of the DFT that are at a certain distance from the center of the DFT.

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 25: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Gaussian Low pass Filters:

25

The Gaussian Lowpass Filter (GLPF) with cutoff frequency at distance D0 is defined as:

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 26: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example1

26

Find the output of applying smoothing filter on the pixel (2,2) shown in block of image:

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 27: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example1

27

Solution: since the index of image width and height starts with (0,0), then the value of pixel (2,2)= 9. Now the smoothing filter must be centered on this value to change its value.

Pixel(2,2)= (1/9)*(8*1+5*1+5*1+2*1+9*1+4*1+2*1+9*1+4*1)=round(48/9)=5

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 28: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example2

28

Find the output of applying sharpening filter on the pixel (3,4) shown in block of image:

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015

Page 29: Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail:

Example2

29

Solution: since the index of image width and height strats with (0,0), then the value of pixel (4,3)= 3. Now the sharpening filter must be centered on this value to change its value

Pixel(3,4)=(1/9)*(4*-1+4*-1+6*-1+3*-1 +3*8+5*-1+2*-1+3*-1+4*-1)

round(abs((-7/9))=1

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015