Frequency Domain Processing (part 2) and Filtering C. Andrés Méndez 03/04/2013.

Slides:



Advertisements
Presentazioni simili
Trieste, 26 novembre © 2005 – Renato Lukač Using OSS in Slovenian High Schools doc. dr. Renato Lukač LinuxDay Trieste.
Advertisements

L’esperienza di un valutatore nell’ambito del VII FP Valter Sergo
Cache Memory Prof. G. Nicosia University of Catania
Teoria e Tecniche del Riconoscimento
Parametri Acustici (ISO 3382)
EBRCN General Meeting, Paris, 28-29/11/20021 WP4 Analysis of non-EBRCN databases and network services of interest to BRCs Current status Paolo Romano Questa.
DG Ricerca Ambientale e Sviluppo FIRMS' FUNDING SCHEMES AND ENVIRONMENTAL PURPOSES IN THE EU STRUCTURAL FUNDS (Monitoring of environmental firms funding.
La stenosi carotidea a rischio: evoluzione dell’inquadramento US
Each student will be able to ask an adult or stranger: What do you like to do? and What dont you like to …?
1.E un algoritmo ricorsivo: Tutti le istanze di oggetti raggiungibili da un oggetto persistente diventano anchessi persistenti.
piacere The verb to like does not have a direct equivalent in Italian.
© and ® 2011 Vista Higher Learning, Inc.4B.1-1 Punto di partenza Italian uses two principal tenses to talk about events in the past: the passato prossimo.
Cancer Pain Management Guidelines
A. Nuzzo U.O. di Oncologia Medica ospedale Renzetti di Lanciano (CH)
Che ore è? Che ore Sono?.
Punto di partenza Reciprocal verbs are reflexives that express a shared or reciprocal action between two or more people or things. In English we often.
Il presente del congiuntivo (the present subjunctive)
Il presente del congiuntivo (the present subjunctive)
Dipartimento di Matematica Applicata Università di Firenze Multiband transport models for semiconductor devices Giornata di lavoro sulle Nanoscienze Firenze.
1 A neural approach to the analysis of CHIMERA experimental data CHIMERA Collaboration S.Aiello 1, M. Alderighi 2,3, A.Anzalone 4, M.Bartolucci 5, G.Cardella.
J0 1 Marco Ronchetti - Corso di Formazione Sodalia – Febbraio 2001 – Modulo Web Programming Tomcat configuration.
Biometry to enhance smart card security (MOC using TOC protocol)
Costruzione di Interfacce Lezione 10 Dal Java al C++ parte 1
TIPOLOGIA DELLE VARIABILI SPERIMENTALI: Variabili nominali Variabili quantali Variabili semi-quantitative Variabili quantitative.
Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations?
Metodi di simulazione numerica in Chimica Fisica Dario Bressanini Universita degli Studi dellInsubria III anno della Laurea triennale in Scienze Chimiche.
2000 Prentice Hall, Inc. All rights reserved. 1 Capitolo 3 - Functions Outline 3.1Introduction 3.2Program Components in C++ 3.3Math Library Functions 3.4Functions.
Laurea specialistica in Scienza e Ingegneria dei Materiali
Magnetochimica AA Marco Ruzzi Marina Brustolon
Queuing or Waiting Line Models
DISSIMILARITIES AND MATCHING BETWEEN SYMBOLIC OBJECTS Prof. Donato Malerba Department of Informatics, University of Bari, Italy ASSO.
DISSIMILARITIES AND MATCHING BETWEEN SYMBOLIC OBJECTS Prof. Donato Malerba Department of Informatics, University of Bari, Italy ASSO.
Chistmas is the most loved holiday of the years. Adults and children look forward to Chistmas and its magical atmosphere. It is traditional to decorate.
Le regole Giocatori: da 2 a 10, anche a coppie o a squadre Scopo del gioco: scartare tutte le carte per primi Si gioca con 108 carte: 18 carte.
Compito desame del Svolgimento della Sezione 5: CONTROLLORI Esempio preparato da Michele MICCIO.
Morphological Image Processing
Francesca Pizzorni Ferrarese 05/05/2010
Histogram and region based processing
Ischia, giugno 2006Riunione Annuale GE 2006 Exploiting the Body Effect to Improve Analog CMOS Circuit Performances *P. Monsurrò, **S. Pennisi, *G.
UNIVERSITÀ DEGLI STUDI DI PAVIA FACOLTÀ DI ECONOMIA, GIURISPRUDENZA, INGEGNERIA, LETTERE E FILOSOFIA, SCIENZE POLITICHE. Corso di Laurea Interfacoltà in.
Guardate le seguenti due frasi:
Microsoft Kinect IR PATTERN PROJECTOR IR CAMERA RGB CAMERA.
Motor Sizing.
My Italian Experience By Ryan Davidson. My daily routine in Urbino If there was no field trip in the morning, my daily routine in Urbino was very basic.
Frequency Domain Processing
UG40 Energy Saving & Twin Cool units Functioning and Adjustment
EMPOWERMENT OF VULNERABLE PEOPLE An integrated project.
Warehousing Market 25 March 2014 Elena Di Biase. Contesto L’economia europea continua a mostrare segnali di ripresa e gli indicatori economici di fiducia.
A PEACEFUL BRIDGE BETWEEN THE CULTURES TROUGH OLYMPICS OLYMPIC CREED: the most significant thing in the olympic games is not to win but to take part OLYMPIC.
Passato Prossimo. What is it?  Passato Prossimo is a past tense and it is equivalent to our:  “ed” as in she studied  Or “has” + “ed” as in she has.
Lezione n°27 Università degli Studi Roma Tre – Dipartimento di Ingegneria Corso di Teoria e Progetto di Ponti – A/A Dott. Ing. Fabrizio Paolacci.
Italian 1 -- Capitolo 2 -- Strutture
Scenario e Prospettive della Planetologia Italiana
Well and Truly by Roni Horn. Mind map Artist’s name Techniques Life Groupworks Artworks My opinion Her message My artwork inspiried by…
The food Pyramid The breakfast. Food pyramid gives us instructions on how to eat well and stay healthy!!!
I giorni della settimana
Accoppiamento scalare
Filtri del primo ordine
RIEPILOGO Transistor JFET
SUMMARY Different classes and distortions RIEPILOGO Le diverse classi e le distorsioni RIEPILOGO Le diverse classi e le distorsioni.
Filtri del secondo ordine e diagrammi di Bode
Buon giorno, ragazzi oggi è il quattro aprile duemilasedici.
SUMMARY Checking RIEPILOGO Verifiche RIEPILOGO Verifiche.
Do You Want To Pass Actual Exam in 1 st Attempt?.
AusTel by taha.a.
Accesso al corpus it. / ing. parola cercata sintagmi preposizioni.
Directions: Create six trading cards related to the Muslim Empire
The effects of leverage in financial markets Zhu Chenge, An Kenan, Yang Guang, Huang Jiping. Department of Physics, Fudan University, Shanghai, ,
Information In March we decided to start to work on this topic in strong collaboration with Roma 1 group: Ferrante (50-70%), Braccini (50-70%), Torre (100%),
Transcript della presentazione:

Frequency Domain Processing (part 2) and Filtering C. Andrés Méndez 03/04/2013

Where to find the presentations?

Elaborazione nel dominio della frequenza The general idea is that the image (f(x,y) of size M x N) will be represented in the frequency domain (F(u,v)). The equation for the two-dimensional discrete Fourier transform (DFT) is: The concept behind the Fourier transform is that any waveform that can be constructed using a sum of sine and cosine waves of different frequencies. The exponential in the above formula can be expanded into sines and cosines with the variables u and v determining these frequencies. The inverse of the above discrete Fourier transform is given by the following equation: Thus, if we have F(u,v), we can obtain the corresponding image (f(x,y)) using the inverse, discrete Fourier transform.

Visualizzazione dello spettro Esercizio 1 –Creare un step 2D binario –Calcolare la DFT e visualizzare lo spettro di ampiezza (fft2) –Shiftare la componente zero al centro dello spettro (fftshift) –Per migliorare la visualizzazione usare la funzione log Suggerimento per la visualizzazione usare imshow(f,'InitialMagnification','fit')

Visualizzazione dello spettro Esercizio 2 –Creare unimmagine 30x30 con un rettangolo bianco su sfondo nero –Calcolare la DFT e visualizzare lo spettro di ampiezza (fft2) –Aggiungere dello zero padding per migliorare il calcolo della DFT –Shiftare la componente zero al centro dello spettro (fftshift) –Per migliorare la visualizzazione usare la funzione log Suggerimento per la visualizzazione usare imshow(f,'InitialMagnification','fit')

Visualizzazione dello spettro (2) originalDFT Zero-padded DFTCentered and Log

Relazione fra DFT e filtraggio nel dominio spaziale The following convolution theorem shows an interesting relationship between the spatial domain and frequency domain: and, conversely, the symbol "*" indicates convolution of the two functions. The important thing to extract out of this is that the multiplication of two Fourier transforms corresponds to the convolution of the associated functions in the spatial domain.

Correlazione MATLAB uses one of two methods, correlation or convolution, to filter various images. The two operations are identical except correlation rotates the filter matrix 180 o before filtering, while convolution keeps it the same. The Fourier transform can also be used to perform correlatio. Correlation can be used to locate features within an image; in this context correlation is often called template matching.

Correlazione Esercizio 3 –Caricare limmagine text.png –Estrarre la lettera a dallimmagine e creare un template –Calcolare la correlazione C = ifft2(fft2(A).*fft2(B)); –Visualizzare la localizzazione nellimmagine della lettera a

Filtering Procedure in MatLab For a M x N size image. –Determine the padded size P x Q needed (P = 2M and Q = 2N is the most common method) –Multiply image f(x,y) by (–1)(x+y) to get fc(x,y) –Zero pad fc(x,y) then take DFT to get FZP(u,v) in FD –Create centered H(u,v) filter function in FD of the proper padded size P x Q –Point by point multiply FZP(u,v) by H(u,v) –Take the inverse DFT of the result in (5) –Obtain real part of result in (6) –Crop filtered image from the UL corner of array –Multiply result in (8) by (–1)(x+y) –You now have a filtered image of the same size as the original image

Spatial vs Frequency domain

Specific Frequency Domain Filters As you have already seen, based on the property that multiplying the FFT of two functions from the spatial domain produces the convolution of those functions, you can use Fourier transforms as a fast convolution on large images. Note that on small images it is faster to work in the spatial domain. However, you can also create filters directly in the frequency domain. There are three commonly discussed filters in the frequency domain: Lowpass filters, sometimes known as smoothing filters Highpass filters, sometimes known as sharpening filters Notch filters, sometimes known as band-stop filters

Low-Pass filters Lowpass filters: –create a blurred (or smoothed) image –attenuate the high frequencies and leave the low frequencies of the Fourier transform relatively unchanged Three main lowpass filters are discussed in Digital Image Processing Using MATLAB: –Ideal lowpass filter (ILPF) –Butterworth lowpass filter (BLPF) –Gaussian lowpass filter (GLPF)

Low-Pass filters

function H = lpfilter(type, M, N, D0, n) %LPFILTER Computes frequency domain lowpass filters % H = LPFILTER(TYPE, M, N, D0, n) creates the transfer function of a lowpass filter, H, of the specified TYPE and size (M-by-N). To % view the filter as an image or mesh plot, it should be centered using H = fftshift(H). % Valid values for TYPE, D0, and n are: % 'ideal' Ideal lowpass filter with cutoff frequency D0. n need not be supplied. D0 must be positive % 'btw' Butterworth lowpass filter of order n, and cutoff D0. The default value for n is 1.0. D0 must be positive. % 'gaussian' Gaussian lowpass filter with cutoff (standard deviation) D0. n need not be supplied. D0 must be positive. % Use function dftuv to set up the meshgrid arrays needed for computing the required distances. [U, V] = dftuv(M, N); % Compute the distances D(U, V). D = sqrt(U.^2 + V.^2); % Begin fiter computations. switch type case 'ideal' H = double(D <=D0); case 'btw' if nargin == 4 n = 1; end H = 1./(1 + (D./D0).^(2*n)); case 'gaussian' H = exp(-(D.^2)./(2*(D0^2))); otherwise error('Unknown filter type.') end

Low-Pass filters Ideal –HLPF_ideal=fftshift(lpfilter('ideal', 500, 500, 50)); 0 –mesh(HLPF_ideal(1:10:500,1:10:500)) –colormap([0 0 0]) –axis off –grid off –axis([ ]) –figure, imshow(HLPF_ideal) Butterworth –HLPF_btw=fftshift(lpfilter('btw', 500, 500, 50)); –figure, mesh(HLPF_btw(1:10:500,1:10:500)) –colormap([0 0 0]) –axis off –grid off –axis([ ]) –figure, imshow(HLPF_btw) Gaussian –HLPF_gauss=fftshift(lpfilter('gaussian', 500, 500, 50)); –figure, mesh(HLPF_gauss(1:10:500,1:10:500)) –colormap([0 0 0]) –axis off –grid off –axis([ ]) –figure, imshow(HLPF_gauss)

Low-Pass filters Esercizio 4 Caricare e convertire in scala di grigi limmagine football.jpg e visualizzarla Calcolare il padding adeguato Creare un filtro low-pass gaussiano Calcolare la DFT Applicare il filtro Riconvertire al dominio spaziale Tagliare limmagine per riportarla alle dimensioni originali Visualizzare limmagine e lo spettro

High-Pass filters

function H = hpfilter(type, M, N, D0, n) %HPFILTER Computes frequency domain highpass filters % H = HPFILTER(TYPE, M, N, D0, n) creates the transfer function of % a highpass filter, H, of the specified TYPE and size (M-by-N). % Valid values for TYPE, D0, and n are: % 'ideal' Ideal highpass filter with cutoff frequency D0. n % need not be supplied. D0 must be positive % 'btw' Butterworth highpass filter of order n, and cutoff D0. % The default value for n is 1.0. D0 must be positive. % 'gaussian' Gaussian highpass filter with cutoff (standard deviation) % D0. n need not be supplied. D0 must be positive. % The transfer function Hhp of a highpass filter is 1 - Hlp, % where Hlp is the transfer function of the corresponding lowpass % filter. Thus, we can use function lpfilter to generate highpass % filters. if nargin == 4 n = 1; % Default value of n. end % Generate highpass filter. Hlp = lpfilter(type, M, N, D0, n); H = 1 - Hlp;

High-Pass filters Ideal –HHPF_ideal=fftshift(hpfilter('ideal', 500, 500, 50)); –mesh(HHPF_ideal(1:10:500,1:10:500)) –colormap([0 0 0]) –axis off –grid off –axis([ ]) –figure, imshow(HHPF_ideal) Butterworth –HHPF_btw=fftshift(hpfilter('btw', 500, 500, 50)); –figure, mesh(HHPF_btw(1:10:500,1:10:500)) –colormap([0 0 0]) –axis off –grid off –axis([ ]) –figure, imshow(HHPF_btw) Gaussian –HHPF_gauss=fftshift(hpfilter('gaussian', 500, 500, 50)); –figure, mesh(HHPF_gauss(1:10:500,1:10:500)) –colormap([0 0 0]) –axis off –grid off –axis([ ]) –figure, imshow(HHPF_gauss)

High-Pass filters Esercizio 5 Caricare e convertire in scala di grigi limmagine football.jpg e visualizzarla Calcolare il padding adeguato Creare un filtro high-pass gaussiano Calcolare la DFT Applicare il filtro Riconvertire al dominio spaziale Tagliare limmagine per riportarla alle dimensioni originali Visualizzare limmagine e lo spettro

Aliasing and Interpolation Esercizio 5 Caricare limmagine Barbara.tif Portarla ad ¼ della dimensione originale Ripristinare la dimensione originale Usare un filtro anti-aliasing per ridurre gli artefatti confrontare i risultati