Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation...

21
Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision 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

Transcript of Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation...

Page 1: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Machine VisionMachine VisionTransportation Informatics Group

University of Klagenfurt

Alireza Fasih, 2009

12/24/2009 1Address: L4.2.02, Lakeside Park, Haus B04, Ebene 2, Klagenfurt-Austria

Page 2: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

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 2Ref: CCU Vision Laboratory

Page 3: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Image Transformations

1. Image Transformation are alternative ways of representing the information in an image

To exploit some image properties which are not available inTo exploit some image properties which are not available in the image domain.

Most commonly used in image processing, image compression, image editing.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

Page 4: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

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 imageinformation about the entire image.

The value of the point tells us how much of spatial frequency is in the image.

12/24/2009 4

Page 5: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Fourier Transform

You should have learned the basic of fourier transform from thecourse such as “signals and systems”, “differential equations” andg y“Electronic Circuit”

Only discrete Fourier transformation transform (DFT) related to 2-D image processing will be taught in detail2-D image processing will be taught in detail

DFT

12/24/2009 5

Page 6: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

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 signalFourier series for periodic signal

Fourier transformation for aperiodic signals

12/24/2009 6

Page 7: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Fourier Transformation

12/24/2009 7

Page 8: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

FFT in Matlab

• fft2 (x)This function return the two-dimensional discrete Fourier transformation of x.

12/24/2009 8

Page 9: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Filtering in Fourier Domain

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Filtering in Fourier Domain

12/24/2009 9

Page 10: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

High Pass Filtering by FFT

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

High-Pass Filtering by FFT

Input ImageHigh frequency domain

Mask

Mask

Input Image FFT Result after using Inverse FFT

12/24/2009 10

Page 11: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Low-Pass Filtering by FFTInput Image FFT Filtering Result after using Inverse FFT

Input Image FFT

12/24/2009 11

Page 12: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Low-Pass Filtering by FFT

12/24/2009 12

Page 13: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Shape Matching

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

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

Geometric Based Shape Matching

Page 14: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Template Matching

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Template Matching

12/24/2009 14

Page 15: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

FFT in Matlab and Template matchingRead in the sample imageRead in the sample image.

bw = imread('text.png');

Create a template for matching by extracting the letter "a" from the imageCreate 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 imcropYou 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);imshow(bw);figure, imshow(a);

12/24/2009 15

Page 16: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

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

Page 17: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

FFT i M tl b d P tt t hi

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

FFT in Matlab and Pattern matching

T i th l ti f th t l t i th i fi d th i i l l d th d fi• To view the locations of the template 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.thresh 60; % Use a threshold that s a little less than max.

figure, imshow(C > thresh)% Display showing pixels over

th h ldthreshold.

12/24/2009 17

Page 18: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Th k f tt tiThank you for your attention

12/24/2009 18

Page 19: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

AppendixAppendix

12/24/2009 19

Page 20: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

Discrete Fourier Transform

12/24/2009 20

Page 21: Transportation Informatics Group University of Klagenfurt Vision 7.pdf · Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt Machine Vision Transportation Informatics

Transportation Informatics Group, ALPEN-ADRIA University of Klagenfurt

2D - DFT

12/24/2009 21