I'm learning about Gabor filters for the first time and how they can be used to regenerate fingerprints from their orientation maps. I'm given an orientation map in the form of a .jpg and I want to apply gabor filters with 4 orientations on it. I followed the example in the documentation and ended up with the following code:
input_img = imread('orientation.jpg');
input_img = rgb2gray(input_img);
wavelength = 6;
orientation = [0 45 90 135];
gaborArray = gabor(wavelength,orientation);
gaborMag = imgaborfilt(input_img,gaborArray);
figure
subplot(2,2,1);
for p = 1:4
subplot(2,2,p)
imshow(gaborMag(:,:,p),[]);
theta = gaborArray(p).Orientation;
lambda = gaborArray(p).Wavelength;
title(sprintf('Orientation=%d, Wavelength=%d',theta,lambda));
end
My input is:
What I really want however is a single fingerprint like the following:
I understand that my output is currently the way it is due to the subplot
. I tried replacing subplot
with hold on
and plot
but what ends up happening is that the final image at Orientation=135 overlaps the others.
Is there a way to get the plots to overlap while averaging the luminance/intensity values of each pixel? Any guidance is appreciated.
gaborMag
. I will try to do that, thank you. – Calseon