UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet...

21
UNIVERSIDAD DE VIGO PROGRAMA DE DOCTORADO Ingeniería del Software basada en componentes reutilizables, aplicaciones en Interfaces Hombre-Máquina Bienio.- 2007/2009 Curso de Doctorado Algoritmos y Aplicaciones en el Análisis y Gráficos de Interfaz Código del curso: 091T151B011 Profesores : Dr. María José Lado Touriño Dr. Arturo José Méndez Penín INFORME PRÁCTICAS : Transformada de Wavalet 2007/2008 Alumno: Ing. Marciszack, Marcelo Martín

Transcript of UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet...

Page 1: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

UNIVERSIDAD DE VIGO

PROGRAMA DE DOCTORADO

Ingeniería del Software basada en componentes reutilizables, aplicaciones en Interfaces Hombre-Máquina

Bienio.- 2007/2009

Curso de Doctorado Algoritmos y Aplicaciones en el Análisis y Gráficos de Interfaz Código del curso: 091T151B011

Profesores:

Dr. María José Lado Touriño

Dr. Arturo José Méndez Penín

INFORME PRÁCTICAS : Transformada de Wavalet 2007/2 008

Alumno: Ing. Marciszack, Marcelo Martín

Page 2: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 2/21

Práctica Nro 1: Instalación de WaveLab850

Acciones realizadas

• Descargamos el fichero Wavelab850.zip de la dirección indicada

• Descomprimimos los ficheros en ..\MATLAB\r2007a \toolbox\

• Copiamos el archivo Wavepath a la carpeta Local.

• Preparamos la instalación de la Librería. Renombrando Startup y agregando la línea de comando.

Respuesta a Cuestionario:

a) ¿Qué función permite calcular TW real? ¿Cuáles son sus argumentos?

RWT -- Real Wavelet Transform

Page 3: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 3/21

Forma utilización

rwt = RWT(x,nvoice,wavelet)

Salida:

rwt matrix n by nscale where

nscale = nvoice .* noctave

Argumentos:

X � signal, dyadic length n=2^J, real-valued

nvoice � number of voices/octave

wavelet � string 'Gauss', 'DerGauss','Sombrero', 'Morlet'

Dentro de la Librería Wavelet disponemos de la función alternativa equivalente cwt

Ejemplo de Uso:

coefs = cwt(SIG,scales,WAV,plotmode,xlim)

CWT Real or Complex Continuous 1-D wavelet coefficients.

COEFS = CWT(S,SCALES,'wname') computes the continuous

wavelet coefficients of the vector S at real, positive

SCALES, using wavelet whose name is 'wname'.

The signal S is real, the wavelet can be real or complex.

b) ¿Qué rutinas de WaveLab nos permiten leer una imagen desde un archivo?¿Cómo podemos visualizarla? Para señales unidimensionales, ¿Cómo podríamos leerlas y verlas gráficamente?

Leer una imagen:

Image = ReadImage(Name) Read Image file in 8-bit raw binary format

Page 4: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 4/21

Usage Image = ReadImage(Name) Inputs Name 'Barton', 'Canaletto', 'Coifman', ' Daubechies', 'Fingerprint', 'Lincoln', 'Lenna', 'MRIScan', 'Phone' Outputs Image 2-d signal, n by n, n dyadic

Visualización de la Imagen:

AutoImage(img,x,y) AutoImage -- Image display of object assuming arbit rary values Usage AutoImage(img [,x,y]) Inputs img 2-d image x,y where x and y are vectors, specifies the labeling of X- and Y-axes, but produces the same image as AutoImage(img). Side Effects The object img, assuming arbitrary values, is scale d to the range (0,255) and displayed as an image with 256 sh ades of gray. Description If the object is already scaled to the range (0,255 ) you may use GrayImage. Puede Usarse GrayImage -- Standard gray-scale image display Usage GrayImage(img,ngray) Inputs img a 2-d image, n by n ngray optional. number of gray levels in c olormap, default 255 Ejemplo de Utilización :

IMG = ReadImage('Barton');

AutoImage(IMG);

Page 5: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 5/21

Para señales Unidimensionales:

Leer una Señal:

Signal = ReadSignal(Name) ReadSignal -- Read 1-d signal from file in ascii fo rmat Usage signal = ReadSignal(Name) Inputs Name 'Caruso', 'ESCA', 'Greasy', 'HochNMR', 'Seismic', 'Laser', 'RaphaelNMR', 'Sunspots', 'Transients', 'Tweet' Outputs signal 1-d signal

Visualizar una Señal:

Puede ser visualizada con plot

PLOT(Y) plots the columns of Y versus their inde x. If Y is complex, PLOT(Y) is equivalent to PLOT(r eal(Y),imag(Y)). In all other uses of PLOT, the imaginary part is ignored.

Ejemplo de Utilización :

Page 6: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 6/21

SIG = ReadSignal('Caruso');

plot(SIG)

c) Si pretendiésemos analizar una señal mediante el cálculo de su TW analítica, ¿qué función deberíamos emplear, de las proporcionadas por la librería WaveLab?

AWT (Analytical Wavelet Transform)

awt = AWT(x,nvoice,Name,sigma2,par2) Usage awt = AWT(x,nvoice,Name,sigma2,par2); Inputs x signal, could be complex nvoice number of voices default = 12 Name Type of Window function, so far only "Gauss ian" window available sigma2 first parameter, for Gaussian window, it could be variance, default = 1 par2 another parameter, for Gaussian, it's xi(sh ifting frequency) default = 5 Examples n = 1024; t = ((1:n)./n - .5).*pi;

Page 7: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 7/21

f = exp(i*t.^2); awt = AWT(f); ImageCWT(awt,'Individual','hot'); ix = [((n/2+1):n),(1:n/2)]; plot(abs(awt(ix,1))) % should looks Gaussian hold on plot(abs(awt(ix,13))) % should looks Gaussian plot(abs(awt(ix,25))) % should looks Gaussian

d) Dada una imagen, por tanto, una señal bidimensional, el cálculo de su TW se debe realizar mediante la función FWT2_PO. Indica cómo trabaja esta función, y a qué corresponden sus argumentos. ¿Cómo variamos el filtro empleado para el cálculo de la wavelet en cada caso?

La función FWT2_PO calcula la transformada bidimensional desde la imagen cuadrada (o array) "x".

Sus argumentos son:

wc = FWT2_PO(x,L,qmf)

Siendo:

x La imagen bidimensional (Un array n por n)

L El nivel de definición

qmf el filtro de cuadratura a utilizar

Para variar el filtro, utilizaremos diferentes filtros según sea el más adecuado. Podremos seleccionar: Haar, Beylkin, Coiflet, Daubechies, Symmlets, Vaidyanathan, Battle-Lemarie, etc. Por ejemplo:

qmf=MakeONFilter('Daubechies',4);

e) ¿ Cómo podemos reconstruir una imagen a partir de su TW?

Aplicando la transformada inversa.

Por ejemplo si nuestra transformada fué X:

XRecontruida=IWT2_PO(X,L,qmf);

Page 8: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 8/21

Práctica Nro 2: Cálculo de alguna TW

1) Vamos a calcular diversas TW de varias imágenes. Para ello, deberemos empezar leyendo la imagen deseada. Estas imágenes se encuentran en el directorio Wavellab/Datasets.

Disponemos de las siguientes imágenes

barton.raw mriscan.raw peppers256.raw phone.raw lenna.raw lincoln.raw fingerprint.raw

coifman.raw daubechies.raw canaletto.raw barb.raw

2) Seleccionamos ‘daubechies.raw’

3) lectura de la Imagen

IMG1 = ReadImage('Daubechies');

MATLAB Responde : >> IMG1 = ReadImage('Daubechies'); Reading D:\Program Files\MATLAB\R2007a\toolbox\Wavelab850\Datasets\dau bechies.raw It is an array of size [ 256, 256] daubechies.raw -- Gray-scale image of Ingrid Daubec hies Access Ingrid = ReadImage('Daubechies'); Size 256 by 256 Gray Levels 256

4) Visualización de la Imagen

Imagesc(IMG1);

Page 9: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 9/21

5) El cálculo computarizado de una TW implica el cálculo previo del filtro que se desea aplicar. Vamos a calcular con la rutina correspondiente (MakeONFilter) filtros diversos. Al menos, deberemos calcular tres filtros distintos, uno de coiflets, otro de Daubechies y otro se symlets, cada uno de ellos con un número de componentes diferentes. Por ejemplo, calculamos Daubechies4, symlets8,...

Filtros a calcular

a) qmf1 = MakeONFilter('Coiflet',2)

b) qmf2 = MakeONFilter('Daubechies',4)

c) qmf3 = MakeONFilter('Symmlet',8)

a) >> qmf1 = MakeONFilter('Coiflet',2)

qmf1 =

Columns 1 through 8

0.0164 -0.0415 -0.0674 0.3861 0.8127 0.4170 -0.0765 -0.0594

Columns 9 through 12

Page 10: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 10/21

0.0237 0.0056 -0.0018 -0.0007

b) >> qmf2 = MakeONFilter('Daubechies',4)

qmf2 =

0.4830 0.8365 0.2241 -0.1294

c) >> qmf3 = MakeONFilter('Symmlet',8)

qmf3 =

Columns 1 through 8

0.0019 -0.0003 -0.0150 0.0038 0.0491 -0.0272 -0.0519 0.3644

Columns 9 through 16

0.7772 0.4814 -0.0613 -0.1433 0.0076 0.0317 -0.0005 -0.0034

6-7) Aplicamos cada uno de los filtros anteriores a nuestra imagen, empleando una TW ortogonal periodizada. Realizamos este cálculo para distintas escalas.

a) Tomamos qmf1 y calculamos TW para las escalas 3,5,7

WT13 = FWT2_PO(IMG1,3,qmf1);

WT15 = FWT2_PO(IMG1,5,qmf1);

WT17 = FWT2_PO(IMG1,7,qmf1);

Y graficamos el resultado

figure, Imagesc(WT13), figure, Imagesc(WT15), figure, Imagesc(WT17);

Page 11: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 11/21

b) Tomamos qmf2 y calculamos TW para las escalas 3,5,7

WT23 = FWT2_PO(IMG1,3,qmf2);

WT25 = FWT2_PO(IMG1,5,qmf2);

WT27 = FWT2_PO(IMG1,7,qmf2);

Y graficamos el resultado

figure, Imagesc(WT23), figure, Imagesc(WT25), figure, Imagesc(WT27);

Page 12: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 12/21

c) Tomamos qmf3 y calculamos TW para las escalas 3,5,7

WT33 = FWT2_PO(IMG1,3,qmf3);

WT35 = FWT2_PO(IMG1,5,qmf3);

WT37 = FWT2_PO(IMG1,7,qmf3);

Y graficamos el resultado

figure, Imagesc(WT33), figure, Imagesc(WT35), figure, Imagesc(WT37);

8) Reconstruimos, a partir de la TW en cada caso, la imagen original, aplicando una TW inversa.

Aplicamos en cada caso

RecI13 = IWT2_PO(WT13,3,qmf1);

RecI15 = IWT2_PO(WT15,5,qmf1);

RecI17 = IWT2_PO(WT17,7,qmf1);

RecI23 = IWT2_PO(WT23,3,qmf2);

RecI25 = IWT2_PO(WT25,5,qmf2);

RecI27 = IWT2_PO(WT27,7,qmf2);

Page 13: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 13/21

RecI33 = IWT2_PO(WT33,3,qmf3);

RecI35 = IWT2_PO(WT35,5,qmf3);

RecI37 = IWT2_PO(WT37,7,qmf3);

9) Visualizamos el resultado, y nos aseguramos de que hemos reconstruido la imagen original. Por ejemplo, podemos restar la imagen reconstruida de la original, punto a punto, y comprobar que el resultado de la resta es 0.

Calculamos la Diferencia de la Imagen reconstruida con la imagen original, la visualizamos y calculamos el error medio cuadrático.

DIF13 = IMG1- RecI13;

>> % Cálculo del error cuadrático medio:

>> E13 = ( IMG1- RecI13).^2;

>> MSE13 = sum(E13(:))/prod(size(IMG1));

El error cuadrático medio nos dá un valor muy bajo, lo que hace pensar que el método fue lo bastante preciso:

MSE13 = 1,3853 e-016

Y la Imagen de la diferencia nos queda:

Page 14: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 14/21

Calculamos la Diferencia para todos los casos y nos queda la siguiente Tabla:

DIF15 = IMG1- RecI15;

E15 = ( IMG1- RecI15).^2;

MSE15 = sum(E15(:))/prod(size(IMG1));

DIF17 = IMG1- RecI17;

E17 = ( IMG1- RecI17).^2;

MSE17 = sum(E17(:))/prod(size(IMG1));

DIF23 = IMG1- RecI23;

E23 = ( IMG1- RecI23).^2;

MSE23 = sum(E23(:))/prod(size(IMG1));

DIF25 = IMG1- RecI25;

E25 = ( IMG1- RecI25).^2;

MSE25 = sum(E25(:))/prod(size(IMG1));

DIF27 = IMG1- RecI27;

E27 = ( IMG1- RecI27).^2;

MSE27 = sum(E27(:))/prod(size(IMG1));

DIF33 = IMG1- RecI33;

E33 = ( IMG1- RecI33).^2;

MSE33 = sum(E33(:))/prod(size(IMG1));

DIF35 = IMG1- RecI35;

E35 = ( IMG1- RecI35).^2;

MSE35 = sum(E35(:))/prod(size(IMG1));

DIF37 = IMG1- RecI37;

E37 = ( IMG1- RecI37).^2;

MSE37 = sum(E37(:))/prod(size(IMG1));

Page 15: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 15/21

Imagen

Reconstruida

Filtro

Escala

Error Medio

Cuadrático

RecI13 'Coiflet',2 3 1,3853 e016

RecI15 'Coiflet',2 5 5,1451 e017

RecI17 'Coiflet',2 7 5,7831 e018

RecI23 'Daubechies',4 3 3,5456 e019

RecI25 'Daubechies',4 5 1,3101 e019

RecI27 'Daubechies',4 7 1,4686 e020

RecI33 'Symmlet',8 3 2,5285 e020

RecI35 'Symmlet',8 5 9,5954 e021

RecI37 'Symmlet',8 7 1,1225 e021

10) Reconstruimos ahora únicamente a escala 1, lo hacemos con los distintos filtros y analizamos las diferencias en los resultados.

%Escala 1

WT11 = FWT2_PO(IMG1,1,qmf1);

WT21 = FWT2_PO(IMG1,1,qmf2);

WT31 = FWT2_PO(IMG1,1,qmf3);

%Reconstruimos aplicando la Inversa

RecI11 = IWT2_PO(WT11,1,qmf1);

RecI21 = IWT2_PO(WT21,1,qmf2);

RecI31 = IWT2_PO(WT31,1,qmf3);

% calculamos la Diferencia y el Error

DIF11 = IMG1- RecI11;

E11 = ( IMG1- RecI11).^2;

MSE11 = sum(E11(:))/prod(size(IMG1));

Page 16: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 16/21

DIF21 = IMG1- RecI21;

E21 = ( IMG1- RecI21).^2;

MSE21 = sum(E21(:))/prod(size(IMG1));

DIF31 = IMG1- RecI31;

E31 = ( IMG1- RecI31).^2;

MSE31 = sum(E31(:))/prod(size(IMG1));

Imagen

Reconstruida

Filtro

Escala

Error Medio

Cuadrático

RecI11 'Coiflet',2 1 2,6417 e016

RecI21 'Daubechies',4 1 1,3853 e017

RecI31 'Symmlet',8 1 5,1451 e018

Vemos que si bien el Error medio cuadrático medio es bajo, va disminuyendo a medida que la escala va en aumento.

Mostraremos ahora Imágenes de las diferencia de Imágenes con la Original para la escala 1 y con los diferentes filtros.

figure, Imagesc(DIF11), figure, Imagesc(DIF21), figure, Imagesc(DIF31);

Page 17: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 17/21

11) Repetir todo el proceso con otra imagen diferente.

Seleccionamos ahora la Imagen

>> IMG2 = ReadImage('Canaletto');

La visualizamos

>> Imagesc(IMG2);

% Filtros Calculados

qmf1 = MakeONFilter('Coiflet',2);

qmf2 = MakeONFilter('Daubechies',4);

qmf3 = MakeONFilter('Symmlet',8);

% Calculamos las Trasformadas

WT213 = FWT2_PO(IMG2,3,qmf1);

WT215 = FWT2_PO(IMG2,5,qmf1);

WT217 = FWT2_PO(IMG2,7,qmf1);

Page 18: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 18/21

WT223 = FWT2_PO(IMG2,3,qmf2);

WT225 = FWT2_PO(IMG2,5,qmf2);

WT227 = FWT2_PO(IMG2,7,qmf2);

WT233 = FWT2_PO(IMG2,3,qmf3);

WT235 = FWT2_PO(IMG2,5,qmf3);

WT237 = FWT2_PO(IMG2,7,qmf3);

% Reconstruimos la Imagen

RecI213 = IWT2_PO(WT213,3,qmf1);

RecI215 = IWT2_PO(WT215,5,qmf1);

RecI217 = IWT2_PO(WT217,7,qmf1);

RecI223 = IWT2_PO(WT223,3,qmf2);

RecI225 = IWT2_PO(WT225,5,qmf2);

RecI227 = IWT2_PO(WT227,7,qmf2);

RecI233 = IWT2_PO(WT233,3,qmf3);

RecI235 = IWT2_PO(WT235,5,qmf3);

RecI237 = IWT2_PO(WT237,7,qmf3);

% Vemos las Diferencias y Calculamos MSE

DIF13 = IMG2- RecI213;

E13 = ( IMG2- RecI213).^2;

MSE13 = sum(E13(:))/prod(size(IMG2));

DIF15 = IMG2- RecI215;

E15 = ( IMG2- RecI215).^2;

MSE15 = sum(E15(:))/prod(size(IMG2));

DIF17 = IMG2- RecI217;

E17 = ( IMG2- RecI217).^2;

MSE17 = sum(E17(:))/prod(size(IMG2));

Page 19: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 19/21

DIF23 = IMG2- RecI223;

E23 = ( IMG2- RecI223).^2;

MSE23 = sum(E23(:))/prod(size(IMG2));

DIF25 = IMG2- RecI225;

E25 = ( IMG2- RecI225).^2;

MSE25 = sum(E25(:))/prod(size(IMG2));

DIF27 = IMG2- RecI227;

E27 = ( IMG2- RecI227).^2;

MSE27 = sum(E27(:))/prod(size(IMG2));

DIF33 = IMG2- RecI233;

E33 = ( IMG2- RecI233).^2;

MSE33 = sum(E33(:))/prod(size(IMG2));

DIF35 = IMG2- RecI235;

E35 = ( IMG2- RecI235).^2;

MSE35 = sum(E35(:))/prod(size(IMG2));

DIF37 = IMG2- RecI237;

E37 = ( IMG2- RecI237).^2;

MSE37 = sum(E37(:))/prod(size(IMG2));

Page 20: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 20/21

Imagen

Reconstruida

Filtro

Escala

Error Medio

Cuadrático

RecI213 'Coiflet',2 3 5,8512 e016

RecI215 'Coiflet',2 5 2,6811 e016

RecI217 'Coiflet',2 7 6,8137 e017

RecI223 'Daubechies',4 3 1,4978 e018

RecI225 'Daubechies',4 5 6,8275 e019

RecI227 'Daubechies',4 7 1,7336 e019

RecI233 'Symmlet',8 3 1,0441 e019

RecI235 'Symmlet',8 5 4,9936 e020

RecI237 'Symmlet',8 7 1,3255 e020

%Escala 1

WT211 = FWT2_PO(IMG2,1,qmf1);

WT221 = FWT2_PO(IMG2,1,qmf2);

WT231 = FWT2_PO(IMG2,1,qmf3);

%Reconstruimos aplicando la Inversa

RecI211 = IWT2_PO(WT211,1,qmf1);

RecI221 = IWT2_PO(WT221,1,qmf2);

RecI231 = IWT2_PO(WT231,1,qmf3);

% calculamos la Diferencia y el Error

DIF11 = IMG2- RecI211;

E11 = ( IMG2- RecI211).^2;

MSE11 = sum(E11(:))/prod(size(IMG2));

DIF21 = IMG2- RecI221;

E21 = ( IMG2- RecI221).^2;

MSE21 = sum(E21(:))/prod(size(IMG2));

Page 21: UNIVERSIDAD DE VIGO...wavelet coefficients of the vector S at real, positive SCALES, using wavelet whose name is 'wname'. The signal S is real, the wavelet can be real or complex.

Práctica de Transformada de Wavalet 2007/2008

Ing. Marcelo Marciszack Página 21/21

DIF31 = IMG2- RecI231;

E31 = ( IMG2- RecI231).^2;

MSE31 = sum(E31(:))/prod(size(IMG2));

Imagen

Reconstruida

Filtro

Escala

Error Medio

Cuadrático

RecI211 'Coiflet',2 1 1,0057 e015

RecI221 'Daubechies',4 1 2,5531 e018

RecI231 'Symmlet',8 1 1,8325 e019

figure, Imagesc(DIF11), figure, Imagesc(DIF21), figure, Imagesc(DIF31);

12) ¿Se observa alguna diferencia al emplear los distintos filtros en el resultado de la descomposición wavelet?

Si nos basamos solamente en la matriz diferencia de cada punto de la Imagen Original con su respectivo de la imagen reconstruida, notamos que todos los valores son 0 y por lo tanto todas los filtros como para todas las escalas no hay diferencia en la aplicación de la transformada wavelet. Pero si consideramos la diferencia que se produce con los errores medios cuadráticos se nota que entre ambos filtro y escalas se produce una mínima distorsión entre ambos, aunque poco significativa pero diferencia al fin. Este mismo análisis es similar para ambas imágenes analizadas.