Gabor Filter for Shape Detection and Feature Extraction

Resource Overview

Gabor filters are widely used for shape detection and feature extraction applications, such as fingerprint image enhancement. This MATLAB implementation creates a 2D Gabor filter with adjustable frequency and orientation parameters. The core function gaborfilter1 processes input images through customizable frequency (f) and angle (theta) settings, producing multiple filtered outputs for comprehensive texture analysis.

Detailed Documentation

Gabor filters are commonly employed for shape detection and feature extraction tasks, particularly in applications like fingerprint image enhancement. This code implements a two-dimensional Gabor filter using MATLAB. The implementation follows this function structure: function [G, gabout] = gaborfilter1(I, Sx, Sy, f, theta) In this function, G represents the filter output matrix while gabout contains the actual filtered image. The filter's behavior can be customized by adjusting the frequency parameter (f) and orientation angle (theta). For instance: f = [0, 2, 4, 8, 16, 32]; theta = [0, pi/3, pi/6, pi/2, 3*pi/4]; For an input image like 'stereo.jpg', this configuration would generate 6x5 = 30 distinct filtered images. Users can select different angle and frequency combinations based on their specific requirements. Typically, the standard deviation parameters Sx and Sy can be set to values like 2 or 4. The implementation was tested using 'cameraman.tif' from MATLAB's image database: I = imread('cameraman.tif'); [G, gabout] = gaborfilter1(I, 2, 4, 16, pi/3); figure, imshow(uint8(gabout)); The algorithm works by creating a complex Gabor kernel that combines Gaussian envelope modulation with complex sinusoidal carrier waves, allowing simultaneous analysis of spatial frequency and orientation information in images.