Info

This question is closed. Reopen it to edit or answer.

getting Subscript indices must either be real positive integers or logicals. Error in gabor_filter1 (line 31) imshow(gb);

1 view (last 30 days)
clc; image= imread('G:\Devikalyan\photos\me\20160207_165108.jpg'); image_gray = rgb2gray(image); image_resize=imresize(image_gray,[160 160]); i3=double(image_resize); i2=im2double(i3);
figure(1); imshow=(i2); title('Input Image');
gamma=1; psi=0; theta=90; bw=3; lambda=5; pi=180;
for x=1:160 for y=1:160 x_theta=image_resize(x,y)*cos(theta)+image_resize(x,y)*sin(theta); y_theta= (-image_resize(x,y)*sin(theta))+(image_resize(x,y)*cos(theta)); x' == double(x_theta); y' == double(y_theta);
gb(x,y)= exp(-(x'.^2/2*bw^2+gamma.^2*y'.^2/2*bw^2)).*cos((2*pi/lambda*x'+psi));
end
end
figure(2) imshow(gb); title('Filtered Image');

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!