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

Community Treasure Hunt

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

Start Hunting!

Translated by