Report

University of UD Image processing (spatial &frequency domain) College of Science Computer Science Department 2013-2014 E-mail: [email protected] Computer Graphics Image process inspatial &frequency domain Faculty of Physical and Basic Education Computer Science Dep. 2014-2015 E-mail: [email protected] [email protected] Lecturer: 14 Azhee W. MD. Outline 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 University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2012-2013 3 Image processing 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 University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 4 Image processing(spatial &frequency domain) 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 5 Image processing (Spatial Domain) 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 6 Image Filtering in Spatial Domain 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 7 Image Filtering in Spatial Domain University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 8 Image Filtering in Spatial Domain cont’s 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 9 Image Filtering in Spatial Domain 1- University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Image Filtering in Spatial Domain 2- University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Example University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 12 Example cont’s University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Example cont’s University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Image Filtering in Spatial Domain University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Image Filtering in Spatial Domain Median filter University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Example University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Example cont’s University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Example cont’s University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 1 Example University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2014-2015 20 Image Filtering in Frequency Domain 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 2 Image Filtering in Frequency Domain 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 2 Image processing (frequency domain ) 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 2 Low‐Pass Filtering: 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 2 Gaussian Low pass Filters: 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 2 Example1 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 2 Example1 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 2 Example2 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 2 Example2 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 29