FD = gfd(bw,m,n) - Implementation of the Generic Fourier Descriptors

Calculates the Generic Fourier Descriptors following the Publication of D. Zhang & G. Lu (2002)
Updated 30 Aug 2016

View License

This function is an implementation of the Generic Fourier Descriptor (GFD) proposed by D. Zhang and G.Lu in their publication "Shape-based image retrieval using generic fourier descriptors".
GFD's are one of the leading shape descriptors and are used for a lot of shape classification tasks. This function calculates for the input image BW the GFD up to the radial frequency defined by M and the angular frecuency defined by N.
A Requirement for the correct calculation is, that the binary image only contains one single object and that the object is centered by its Centroid to the image center.
You can use the centerobject(bw) function to help you centering objects correctly:
GFD are translation, scale and rotation invariant as explained in the Paper of Zhang/Lu.
I added an example-file as for demonstration purpose of the function. The .mat file contains six binary images (3*ray,3*lizard) of the MPEG-7 dataset. For both, ray and lizard, the original image is one time rotated and one time resized. Then for all variations the GFD's are calculated and compared by the Cityblock-Distance.
(I wrote this function with Matlab 8.1 (R2013a) but i am pretty sure it will work with older releases)
For any kind of bug report/questions/suggestions i would be happy if you leave a comment.

Cite As

Frederik Kratzert (2024). FD = gfd(bw,m,n) - Implementation of the Generic Fourier Descriptors (https://www.mathworks.com/matlabcentral/fileexchange/52643-fd-gfd-bw-m-n-implementation-of-the-generic-fourier-descriptors), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Image Processing Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

updated *.zip archive
updated description
updated small bug in the code