This is a MATLAB/C implementation of the SIFT detector and descriptor. It is customizable and features a decomposition of the algorithm in several reusable M and MEX files. This implementation produces interest points and descriptors which are very similar to David Lowe's implementation.

Remark. This code is well suited to study, understand and modify SIFT, but it is not particularly fast. If you need to compute lots of features, you might be interested in this lightweight C++ version, which does not require MATLAB and comes with a flexible command line interface.

Download and install

To install this software simply add the sift directory to your MATLAB path and compile the MEX files (see also the included README file). This should be straightforward on Linux and Mac OS X and most versions of Windows. Alternatively you can try to use the pre-compiled binaries.

How Tos

Questions

  • The program complains that the function imsmooth cannot be found. What should I do?
    The function (along with many others) is a MEX file and needs to be compiled before it can be used.
  • Which are the supported platforms?
    The M-files are universal. The MEX files should compile easily with Linux and Mac OS X (GCC) and, perhaps less easily, with Windows (Visual C). Alternatively you can try the pre-compiled MEX files.
  • I'm trying to compile your code under Windows/Linux64, but the MEX compiler does not link the DGESV function. What do I do?
    Some MEX functions make LAPACK calls. LAPACK is shipped with MATLAB, but unfortunately it has often changed name and location with successive releases. Although sift_compile.m tries to guess the right library to link with, it might fail. In this case, locate in your MATLAB directory the appropriate LAPACK library (note that this is different depending wether you are using LCC or Visual C) and modify sift_compile.m to link against that library.
  • Why do your keypoints look different from Lowe's?
    The implementation is not 100% equivalent. Some keypoints might be missing, or you might get some additional ones (this also depends on the thresholds and the BoundaryPoint option of sift.m). To get an idea of the accuracy of the accuracy of the implementation, run sift_demo3.m which compares our code with Lowe's. You should get something like which indicates that, except for a few “outliers”, the difference of position and scale is less than 0.01 (here 1 is one pixel) and the difference of orientation is much less than 1/36 (which is the resolution of orientation hisogram). If you get big differencies, you are probably not converting between our and Lowe's convention (see the last lines of siftread.m).

Copyright

This software program is Copyright © 2006 The Regents of the University of California and can be freely used for academic purposes (see the included license file for details). Although this implementation is original (in particular, it is not derived from Lowe's implementation), the SIFT algorithm has been issued a patent. Thus you should note that:

This software embodies a method for which the following patent has been issued: "Method and apparatus for identifying scale invariant features in an image and use of same for locating an object in an image," David G. Lowe, US Patent 6,711,293 (March 23, 2004). Provisional application filed March 8, 1999. Asignee: The University of British Columbia.