Matlab - Aplicar 1-DFiltros Gabor en fotos

 
Vista:

Aplicar 1-DFiltros Gabor en fotos

Publicado por Andres (6 intervenciones) el 22/11/2012 11:17:50
Hola a todos;

Estoy realizando un projecto y me e quedado atascadisimo. Haber si alguien me puede hehcar una mano.

Tengo que aplicar filtros de gabor a una imagen en distintas horientaziones, 0°, 45°, 90° y 135°. De manera que el resultado es la imagen con en las que solo quedan las lineas a 0°, 45°, 90° y 135° dependiendo del filtro anterior que le hayas aplicado.

Para obtener las direcciones vertical y horizontal tengo que aplicar un filtro Gausiano y 2 filtros gabor (1D filter even y otro 1D filter odd), y para las diagonales solo 2 filtros gabor((1D filter even y otro 1D filter odd). Los filtros los tengo del articulo que estoy siguiendo. y estan definidos en el codigo matlab.

Al final solo me interesa la parte imaginaria (odd)

La question es que estoy aplicando filtros 1-D a una imagen 2-D, he conseguido que obtener la imagen horizontal y vertical pero no las diagonales. (igual estoy haciendo una burrada, nose...)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
close all;clear all;clc
 
%H-V even (real)
HVeven=[0,17,0,-62,0,90,0,-62,0,17,0];
%H-V odd (imag)
HVodd=[-8,0,37,0,-82,0,82,0,-37,0,8];
%Diagonal even (real)
Deven=[3,-5,-27,-27,25,62,25,-27,-27,-5,3];
%Diagonal odd (imag)
Dodd=[4,13,5,-34,-52,0,52,34,-5,-13,-4];
%Gaussian
Gaussian=[4,9,19,31,41,45,41,31,19,9,4];
 
I=imread('Einstein1.jpg');
I1=rgb2gray(I);
 
 
%horizontal-vertical
%here we have to apply the Gaussian filter and the HVodd filter (because we
%are ojnly interesiert in the imag part). We have to get the image
%filtrated at 0° and 90°
I2=conv2(Gaussian,I1);
I3=conv2(Gaussian',I1);

gau_0=conv2(HVodd,I3);
gau_90=conv2(HVodd',I2);
 
%Diagonal
%we want to have the diagonals 45° and 135°, for that we have to apply the
%Dodd because we just want the imaginary part.
 
gau_45=conv2(Deven,I1);
gau_135=conv2(Deven',I1);

figure(1)
subplot(2,2,1),imshow(gau_0,[]), title ('Image filter with 0°');
subplot(2,2,2),imshow(gau_90,[]), title ('Image filter with 90°');
subplot(2,2,3),imshow(gau_45,[]), title ('Image filter with 45°');
subplot(2,2,4),imshow(gau_135,[]), title ('Image filter with 135°');



esta es la imagen que utilizo

Gracias por vuestra ayuda
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder