I have an image I(X,Y) and I wish to filter it using the difference of Gaussian filter for different directions. Since I do not know the direction of particular lines in the image, I want to implement a 12 directional filters each of them tuned to a specific orientation θi ∈ [−π/2, π/2], i = 1, . . . , 12. The output of the directional filter is then compared with the output of an omnidirectional filter. We will use Gaussian filters for this purpose. Considering both contributions, the filter impulse response is given by
hθ(x, y) = G1(x, y) − G2(x, y)
This is the difference of gaussian filter which I wish to convolve with my image.
Ii(x, y) = hθi(x, y) ∗ I(x, y) for i=1 to 12
This is the code I have executed for difference of Gaussian filter.
My filter parameters are as given below: N = 12 filters,σx1 = 40, σy1 = 40, σx2 = 3, σy2 = 0.5 and the window size is 11x11clc;clear all;close all;hsize=[11, 11];a=(imread('os.jpg'));a1=rgb2gray(a);figure();imshow(a1);h1=imgaussfilt(a1, [40, 40], 'filterSize', [11, 11]);h2=imgaussfilt(a1, [3, 0.5], 'filterSize', [11,11]);imshow(h2)DoG=h1-h2;imshow(DoG);
Best Answer