필터 지우기
필터 지우기

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

조회 수: 2 (최근 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

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by