SIFT(1) BSD General Commands Manual SIFT(1)

NAME

sift — Scale Invariant Feature Transform

SYNOPSIS

sift [−vhb] [−o filename] [−k filename] [−p prefix] [−S number] [−O number] [−t number] [−e number] [−−save−gss] [−−no−descriptors] [−−no−orientations] [−−stable−order] [−−floating−point] [−−unnormalized] file.pgm ...

OPTIONS
−−verbose
, −v

Be verbose.

−−help, −h

Print a summary of options.

−−output outfile, −o outfile

Wirte the keypoints to outfile.

−−prefix prefix, −p prefix

Derive the output filename prefixing prefix to the input filename.

−−binary, −b

Write the descriptors to a binary file. The name of this file is derived from the output filename by removing the ‘.key’ suffix and adding the ‘.desc’ suffix.

−−keypoints filename, −k filename

Instead of running the SIFT detector, read the keypoints from file name (but still compute the descriptors).

−−save−gss

Save the layers of the Gaussian scale space. This produces a is derived from the output filename by removing the ‘.pgm’ suffix, and adding the index of the level and the ‘.pgm’ suffix.

−−octaves number, −O number

Set the number of octave to number. If not specified, this value is automatically computed to span all possible octaves.

−−levels number, −S number

Set the number of levels per octave to number. The default value is 3.

−−first−octave number

Set the index of the first octave of the pyramid to number. The default value is -1.

−−threshold number, −t number

Set the SIFT detector threshold to number.

−−edge−threshold number, −e number

Set the SIFT detector edge rejection threshold to number.

−−no−descriptors

Do not compute nor wirte to the output file the descriptors.

−−no−orientations

Set implicitly the orientation of all keypoints to zero.

−−stable−order

Preserve the order of keypoints read from a file.

−−floating−point

Save descriptors as floating-point numbers.

−−unnormalized

Do not normalize the descriptors.

OVERVIEW

sift computes D. Lowe’s Scale Invariant Feature Transform (SIFT). The program can be used to process either a single image or several images in a batch. It is possible to customize the most important parameters of the algorithm and to generate descriptors for keypoints computed externally.

In the most simple form sift takes an image in PGM format and computes its SIFT keypoints and the relative descriptors, producing a ‘.key’ ASCII file. This file has one line per keypoint, with the x and y coordinates (pixels), the scale (pixels), the orientation (radians) and 128 numbers (in the range 0-255) representing the descriptor. This file is almost equivalent to the output of D. Lowe’s original implementation, except that x and y are swapped and the orientation is negated due to a different choice of the image coordinate system. −−floating-point can be used to save full floating point descriptors instead of integer descriptors.

By default, the name of the ouptut file is obtained by removing the ‘.pgm’ suffix (if any) from the name of the input file and then appending the ‘.key’ suffix. The option −−output name changes this behaviour and uses the name name instead. −−output works only when processing a single image. When processing image batches, you can use the −−prefix prefix option, which constructs the name of each output file by prefixing ‘prefix’ prefix to the base name of the corresponding input file, and then substituting ‘.pgm’ with ‘.key’ as before. Note that prefix is added verbatim to the name. If prefix is a directory, it should explicitly contain trailing file separator ‘/’.

Descriptors occupy lots of disk space, especially if saved in ASCII format. This problem can be alleviated by specifying the −−binary option, which writes (only) the descriptors to a separate file in binary format. The name of this file is obtained by removing the suffix ‘.key’ (if any) from the name of the keypoint output file, and then appending the suffix ‘.desc’ to it. Descriptors and keypoints are written to their files in the same order and each component of a descriptor takes exactly one byte. If this option is used in conjunction with −−floating-point, then the descriptors are saved as 32 bit IEEE floats, with each component taking exactly four bytes. Big-endian (most-significant byte first, network order) format is used.

Sometimes one wants to compute the descriptors of keypoints generated externally. This can be done by the −−keypoints file.key option, which reads the keypoints from file.key. This file has the same format of the keypoint files produced by sift (except that the descriptors are omitted). Keypoints are then written along with their descriptors to the output file as normal. In the process keypoints are re-ordered by increasing scale, which means that the ordering of the input and output file may differ. This reordering can be prevented by specifying −−stalbe−oder. If this option is used, it is recommended to provide keypoints already ordered by scale as this may significantly improve the computation speed. Note that −−keypoints is limited to process a single image per time.

The SIFT algorithm computes a Gaussian pyramid of the input image. To change the number of octaves, the index of the first octave and the number of levels per octave of the pyramid, use the options −−octaves, −−first-octave and −−levels respectively. Note that setting −−first-octave to -1, -2, ... will cause the base of the pyramid to be two, three, ... times larger than the input image. Usually going beyond -1 makes little sense.

In order to select reliable keypoints, SIFT rejects extrema of the Difference of Gaussian scale space which are smaller than a threshold specified by −−threshold. It also rejects keypoints that have an on-edge score above another threshold specified by −−edge-threshold.

Other options enable further customization of the algorithm. −−unnormalized disables the normalization of the descriptors. In this case descriptors entries are likely to overflow byte sizes, so this option should always be used in conjunction with −−floating-point.

EXAMPLES

Read the image ‘image.pgm’ and write keypoints and descriptors to ‘image.key’:

> sift image.pgm

Same as above, but use null thresholds

> sift -t 0 -e 0 image.pgm

Same as above, but do not double the resolution of the image as part of the computation of the Gaussian scale space:

> sift --first-octave 0 image.pgm

Read the image ‘image.pgm’ and write the keypoints to ‘image.key’ and the descriptor in binary format to ‘image.desc’:

> sift -b image.pgm

Read the images ‘image1.pgm’ and ‘image2.pgm’ and write the keypoints and descriptors to ‘/tmp/image1.key’ and ‘/tmp/image2.key’:

> sift -p /tmp/ image1.pgm image2.pgm

Read the image ‘image.pgm’ and the keypoints ‘image.key’ and write keypoints and descriptors to ‘/tmp/image.key’:

> sift -p /tmp/ -k image.key image.pgm

Same as above, but writes the descriptors in binary format to ‘/tmp/image.desc’:

> sift -b -p /tmp/ -k image.key image.pgm

SEE ALSO

convert(1),

BSD March 24, 2008 BSD