How to improve the result of the performance of the gabor filter

3 ビュー (過去 30 日間)
ASMA MOHAMMAD
ASMA MOHAMMAD 2021 年 11 月 20 日
コメント済み: yanqi liu 2021 年 11 月 22 日
feats=gabfilter(fn1,25,[0.05 0.1],[6 6]);

回答 (1 件)

Yusuf Suer Erdem
Yusuf Suer Erdem 2021 年 11 月 20 日
Example below is a gabor filter example. When you change the wavelength and the orientation. You ll get images with different qualities.
.tif file
clc; clear; close all;
I = imread('board.tif');
I = rgb2gray(I);
wavelength = 4;
orientation = 90;
[mag,phase] = imgaborfilt(I,wavelength,orientation);
tiledlayout(1,3)
nexttile
imshow(I)
title('Original Image')
nexttile
imshow(mag,[])
title('Gabor Magnitude')
nexttile
  4 件のコメント
ASMA MOHAMMAD
ASMA MOHAMMAD 2021 年 11 月 21 日
function Output = gabfilter(image,N,freq,partition)
stage = partition(1);
orientation = partition(2);
im = im2double(imread(image));
[W, H] = size(im);
for j = 1:orientation
Gr = Gabor(N,[0 j],freq,partition,1);
switch j
case 1
ima1 = ifft2(fft2(im).*fft2(im2double(Gr),size(im,1),size(im,2)));
case 2
ima2 = ifft2(fft2(im).*fft2(im2double(Gr),size(im,1),size(im,2)));
case 3
ima3 = ifft2(fft2(im).*fft2(im2double(Gr),size(im,1),size(im,2)));
case 4
ima4 = ifft2(fft2(im).*fft2(im2double(Gr),size(im,1),size(im,2)));
case 5
ima5 = ifft2(fft2(im).*fft2(im2double(Gr),size(im,1),size(im,2)));
case 6
ima6 = ifft2(fft2(im).*fft2(im2double(Gr),size(im,1),size(im,2)));
end
end
ima = zeros(W, H);
for p = 1:W
for q = 1:H
ima(p, q) = (minimum(ima1(p, q), ima2(p, q), ima3(p, q), ima4(p, q), ima5(p, q), ima6(p, q))) * 256/6;
end
end
Output = ima;
end
function index = minimum(a, b, c, d, e, f)
res = min(a, b);
res = min(res, c);
res = min(res, d);
res = min(res, e);
res = min(res, f);
switch res
case a
index = 1;
case b
index = 2;
case c
index = 3;
case d
index = 4;
case e
index = 5;
case f
index = 6;
end
end
yanqi liu
yanqi liu 2021 年 11 月 22 日
sir,may be upload Gabor.m for some analysis

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by