我正在尝试对图像执行gabor过滤器.
%% 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))
我总是得到这个错误.
??? Subscript indices must either be real positive integers or logicals.
不知道如何解决这个问题……