Machine Vision Transportation Informatics Group University of Klagenfurt Alireza Fasih, 2009 12/24/2009 1 Address: L4.2.02, Lakeside Park, Haus B04, Ebene 2, Klagenfurt-Austria
Image Processing & Transforms Most image transform of interests are invertible the original image can be reconstructed from the transform without loss of information. 12/24/2009 2 Ref: CCU Vision Laboratory
Image Transformations 1. Image Transformation are alternative ways of representing the information in an image To exploit some image properties which are not available in the image domain. Most commonly used in image processing, image compression, image editing. 2. Common image transforms: Fourier transform Cosine transform Wavelet transform The most commonly used is the Fourier Transform! 12/24/2009 3
Fast Fourier Transform The image is represented as a weighted set of spatial frequency. The individual spatial frequencies are know as basis function. There is no information lost in transforming an image into the Fourier domain. One point in the Fourier domain representation of an image contains information about the entire image. The value of the point tells us how much of spatial frequency is in the image. 12/24/2009 4
Fourier Transform You should have learned the basic of fourier transform from the course such as signals and systems, differential equations and Electronic Circuit Only discrete Fourier transformation transform (DFT) related to 2-D image processing will be taught in detail DFT 12/24/2009 5
Introduction Almost every function of practical interest can be expressed as a superposition of sinusoids The form taken by superposition into sinusoidal components depends on whether the signal is periodic Fourier series for periodic signal Fourier transformation for aperiodic signals 12/24/2009 6
Fourier Transformation 12/24/2009 7
fft2 (x) FFT in Matlab This function return the two-dimensional discrete Fourier transformation of x. 12/24/2009 8
Filtering in Fourier Domain 12/24/2009 9
High-Pass Filtering by FFT Input Image High frequency domain Mask Mask Input Image FFT Result after using Inverse FFT 12/24/2009 10
Low-Pass Filtering by FFT Input Image FFT Filtering Result after using Inverse FFT Input Image FFT 12/24/2009 11
Low-Pass Filtering by FFT 12/24/2009 12
Shape Matching Correlation Based Template Matching FFT Based Template Matching Geometric Based Shape Matching (Scale variant and Rotation Variant ) Geometric Based Shape Matching 12/24/2009 13
Template Matching 12/24/2009 14
FFT in Matlab and Template matching Read in the sample image. bw = imread('text.png'); Create a template for matching by extracting the letter "a" from the image. a = bw(32:45,88:98); You can also create the template image by using the interactive version of imcrop. The following figure shows both the original image and the template. imshow(bw); figure, imshow(a); 12/24/2009 15
FFT in Matlab and Pattern matching C = real(ifft2( fft2(bw).* fft2(rot90(a,2),256,256) )); figure, imshow(c,[]) % Scale image to appropriate display range. 12/24/2009 16
FFT in Matlab and Pattern matching To view the locations of the template t in the image, find the maximum pixel value and then define a threshold value that is less than this maximum. The locations of these peaks are indicated by the white spots in the threshold correlation image. (To make the locations easier to see in this figure, the thresholded image has been dilated to enlarge the size of the points.) max(c(:)) ans = 68.0000 thresh = 60; % Use a threshold that's a little less than max. figure, imshow(c > thresh)% Display showing pixels over threshold. h 12/24/2009 17
Thank you for your attention ti 12/24/2009 18
Appendix 12/24/2009 19
Discrete Fourier Transform 12/24/2009 20
2D - DFT 12/24/2009 21