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 CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by