You are here : matlabImage Processingimgaborfilt

imgaborfilt() - Image Processing

= imgaborfilt(A,wavelength,orientation) computes
the magnitude and phase response of a Gabor filter for the input grayscale
image A. wavelength describes
the wavelength in pixels/cycle of the sinusoidal carrier. orientation is
the orientation of the filter in degrees. The output mag and phase are
the magnitude and phase responses of the Gabor filter.example[mag,phase]
= imgaborfilt(A,gaborbank) applies
the array of Gabor filters, gaborbank, to the
input image A. gaborbank is
a 1-by-P array of Gabor objects, called a filter
bank. mag and phase are
image stacks where each plane in the stack corresponds to one of the
outputs of the filter bank. For inputs of size A,
the outputs mag and phase contain
the magnitude and phase response for each filter in gaborbank and
are of size M-by-N-by-P.
Each plane in the magnitude and phase responses, mag(:,:,ind),phase(:,:,ind),
is the result of applying the Gabor filter of the same index, gaborBank(ind).[mag,phase] = imgaborfilt(A,wavelength,orientation,name,value,...) applies
a single Gabor filter using name-value pairs to control various  aspects
of filtering.Code Generation support:
Yes.MATLABĀ® Function Block support: No.


= imgaborfilt(A,wavelength,orientation) example[mag,phase]
= imgaborfilt(A,gaborbank) example[mag,phase] = imgaborfilt(A,wavelength,orientation,name,value,...)


Apply Single Gabor Filter to Input ImageOpen This Example
Read image into the workspace.I = imread('board.tif');
Convert image to grayscale.I = rgb2gray(I);
Apply Gabor filter to image.wavelength = 4;
orientation = 90;
[mag,phase] = imgaborfilt(I,wavelength,orientation);
Display original image with plots of the magnitude and phase calculated by the Gabor filter.figure
title('Original Image');
title('Gabor magnitude');
title('Gabor phase');

Apply Array of Gabor Filters to Input ImageOpen This Example
Read image into the workspace.I = imread('cameraman.tif');
Create array of Gabor filters, called a filter bank. This filter bank contains two orientations and two wavelengths.gaborArray = gabor([4 8],[0 90]);
Apply filters to input image.gaborMag = imgaborfilt(I,gaborArray);
Display results. The figure shows the magnitude response for each filter.figure
for p = 1:4
    theta = gaborArray(p).Orientation;
    lambda = gaborArray(p).Wavelength;
    title(sprintf('Orientation=%d, Wavelength=%d',theta,lambda));

Output / Return Value


Alternatives / See Also