Can I have the matlab code for gabor filteration that I can use for edge detection?I have to generate the block in simulink, I have made a code ,but i'm not sure if it gives the correct output.

1 回表示 (過去 30 日間)
function [J] = gabor_fn2EDITED (I) clc; % I2 = imcrop(I,[]); m=size(I,1); n=size(I,2); %% Gabor phi = 7*pi/8; theta = 2; sigma = 0.65*theta; filterSize = 3;
G = zeros(filterSize);
for i=(0:filterSize-1)/filterSize for j=(0:filterSize-1)/filterSize xprime= j*cos(phi); yprime= i*sin(phi); K = exp(2*pi*theta*sqrt(-1)*(xprime+ yprime)); G(round((i+1)*filterSize),round((j+1)*filterSize)) = exp(-(i^2+j^2)/(sigma^2))*K; end end
%% Convolve
J = conv2(I,G); figure,imshow(imag(J));

回答 (0 件)

カテゴリ

Help Center および File ExchangeArray and Matrix Mathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by