j'ai déjà écrit un code concernant cette operation , mais je dois l'optimiser. Je ne sais pas comment appliquer ce filtre sur mon image.
D'ailleurs, j'utilise un filtre de gabor ayant un size 7x7 (c.à.d pour lambda=3.5 et aspect ratio=2.8) et une orientation=90 degrés.
Voici le code ci-dessous:
J'ai beaucoup besoin de vos aides.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 image=imread('Best_Friends.jpg'); image_gray=rgb2gray(image); image_resize=imresize(image_gray, [160 160]); image_resize=im2double(image_resize); figure(1); imshow(image_resize); title('Input Image'); %Gabor filter size 7x7 and orientation 90 degree gamma=0.3; psi=0; theta=90; bw=2.8; lambda=3.5; pi=180; for x=1:160 for y=1:160 x_theta=x*cos(theta)+y*sin(theta); y_theta=-x*sin(theta)+y*cos(theta); gb(x,y)= exp(-(x_theta.^2/2*bw^2+ gamma^2*y_theta.^2/2*bw^2))*cos(2*pi/lambda*x_theta+psi); end end figure(2); imshow(gb); title('filtered image');
Bien à vous,
Partager