Gabor Filter

3 visualizzazioni (ultimi 30 giorni)
C N N
C N N il 14 Set 2011
I am trying to execute gabor filter on images.
{%%Read clear all;
close all;
clc;
I=imread('test.png');
imshow(I);
%%Crop I2 = imcrop(I);
figure, imshow(I2)
m=size(I2,1);
n=size(I2,2);
%%Gabor
phi = 7*pi/8;
theta = 2;
sigma = 0.65*theta;
for i=1:3
for j=1:3
xprime= j*cos(phi);
yprime= i*sin(phi);
K = exp(2*pi*theta*i(xprime+ yprime));
G= exp(-(i.^2+j.^2)/(sigma^2)).*abs(K);
end
end
%%Convolve
for i=1:m
for j=1:n
J(i,j)=conv2(I2,G);
end
end
imshow(uint8(J))
I am getting this error always.
??? Subscript indices must either be real positive integers or logicals.
Not sure how to solve this...

Risposte (1)

Walter Roberson
Walter Roberson il 14 Set 2011
You have
K = exp(2*pi*theta*i(xprime+ yprime));
which attempts to subscript your variable "i" at the index "xprime + yprime". Perhaps you wanted i*(xprime + yprime) ?
  1 Commento
C N N
C N N il 14 Set 2011
thanks. but after i corrected that i had another error.
??? Subscripted assignment dimension mismatch.
Any idea?

Accedi per commentare.

Categorie

Scopri di più su Interpolation in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by