Gabor Filter

3 ビュー (過去 30 日間)
C N N
C N N 2011 年 9 月 14 日
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...

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 9 月 14 日
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 件のコメント
C N N
C N N 2011 年 9 月 14 日
thanks. but after i corrected that i had another error.
??? Subscripted assignment dimension mismatch.
Any idea?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by