Skip to content

snowiow/SIFT

Repository files navigation

SIFT Algorithm in C++

Showcase

parrot

parrot_features

Intro

This is a C++ implementation of the SIFT algorithm, which was originally presented by David G. Lowe in the International Journal of Computer Vision 60 in January 2004. This algorithm is mostly implemented after the principles described in Lowe's paper. Also some elements were taken from the lecture of Dr. Mubarak Shah, which was held at the University of Central Florida.

Installation

Requirements

  • Vigra: A generic C++ library for image analysis(used for most of the calculations and image transformations)
  • OpenCV: Open Source Computer Vision library(used for visualisation of the found sift features)
  • Boost program_options: An easy to use layer for handling program arguments. Part of the Boost Library.
  • CMake: A cross-platform open-source make system.

Installation Process

With the needed libraries installed and the help of CMake, the installation is as easy as three commands. First download this repository by cloning or whatever way you prefer. Switch into the directory afterwards. Now make an extra directory for your buildfiles. For Example:
mkdir build
Switch into the created directory
cd build
Then create your preferred make files with CMake. On all Unix like systems this will be GNU Makefiles.
cmake -G "Unix Makefiles" ..
For other supported build systems check the official documentation of CMake.
The final step is to build the executable from the Makefiles
make
There should now be an executable named sift in the build directory. Please refer to the next section to check how it is used and which possibilities you have, by executing it.

User Guide

The easiest way to start of is just giving an image and get a new image back, with the sift features drawn on it. The file is called [file]_features.png
and can be found in the same directory as the original file. The command to produce this file is
./sift path/to/file.type
But there are many possible parameters on which you can screw the values. The following list shows the possibilities

  --help                           Print help messages
  -i [ --img ] arg                 The image on which sift will be executed
  -s [ --sigma ] arg (=1.60000002) The sigma value of the Gaussian calculations
  -k [ --k ] arg (=1.41421354)     The constant which is calculated on sigma 
                                   for the DoGs
  -o [ --octaves ] arg (=4)        How many octaves should be calculated
  -d [ --dogsPerEpoch ] arg (=3)   How many DoGs should be created per epoch
  -p [ --subpixel ] arg (=0)       Starts with the doubled size of initial 
                                   image
  -r [ --result ] arg (=0)         Print the resulting InterestPoints in a file

This overview can also be called by
./sift --help
Th