API References

Main Classes

class SiftJob

Public Functions

SiftJob(int w, int h, const unsigned char *imageData)

Constructor for byte images, value range 0..255.

Parameters
  • [in] w: the width in pixel of the image

  • [in] h: the height in pixel of the image

  • [in] imageData: the image buffer

SiftJob(int w, int h, const float *imageData)

Constructor for float images, value range [0..1[.

Parameters
  • [in] w: the width in pixel of the image

  • [in] h: the height in pixel of the image

  • [in] imageData: the image buffer

~SiftJob()

Destructor releases all the resources.

popsift::FeaturesHost *get()

See

getHost()

popsift::FeaturesHost *getHost()

Return

void setFeatures(popsift::FeaturesBase *f)

fulfill the promise

class PopSift

Public Types

enum ImageMode

Image modes.

Values:

enumerator ByteImages

byte image, value range 0..255

enumerator FloatImages

float images, value range [0..1[

enum AllocTest

Results for the allocation test.

Values:

enumerator Ok

the image dimensions are supported by this device’s CUDA texture engine.

enumerator ImageExceedsLinearTextureLimit

the input image size exceeds the dimensions of the CUDA Texture used for loading.

enumerator ImageExceedsLayeredSurfaceLimit

the scaled input image exceeds the dimensions of the CUDA Surface used for the image pyramid.

Public Functions

PopSift(ImageMode imode = ByteImages)

We support more than 1 streams, but we support only one sigma and one level parameters.

PopSift(const popsift::Config &config, popsift::Config::ProcessingMode mode = popsift::Config::ExtractingMode, ImageMode imode = ByteImages)

Parameters
  • config:

  • mode:

  • imode:

~PopSift()

Release all the resources.

bool configure(const popsift::Config &config, bool force = false)

Provide the configuration if you used the PopSift default constructor.

void uninit()

Release the resources.

AllocTest testTextureFit(int width, int height)

Check whether the current CUDA device can support the image resolution (width,height) with the current configuration based on the card’s texture engine. The function does not check if there is sufficient available memory.

The first part of the test depends on the parameters width and height. It checks whether the image size is supported by CUDA 2D linear textures on this card. This is used to load the image into the first level of the first octave. For the second part of the tst, two value of the configuration are important: “downsampling”, because it determines the required texture size after loading. The CUDA 2D layered texture must support the scaled width and height. “levels”, because it determines the number of levels in each octave. The CUDA 2D layered texture must support enough depth for each level.

Return

AllocTest::Ok if the image dimensions are supported by this device’s CUDA texture engine, AllocTest::ImageExceedsLinearTextureLimit if the input image size exceeds the dimensions of the CUDA Texture used for loading. The input image must be scaled. AllocTest::ImageExceedsLayeredSurfaceLimit if the scaled input image exceeds the dimensions of the CUDA Surface used for the image pyramid. The scaling factor must be changes to fit in.

Remark

* If you want to call configure() before extracting features, you should call configure() before textTextureFit().

Remark

* The current CUDA device is determined by a call to cudaGetDevice(), card properties are only read once.

See

AllocTest

Parameters
  • [in] width: The width of the input image

  • [in] height: The height of the input image

std::string testTextureFitErrorString(AllocTest err, int w, int h)

Create a warning string for an AllocTest error code.

SiftJob *enqueue(int w, int h, const unsigned char *imageData)

Enqueue a byte image, value range [0,255].

Return

the associated job

See

SiftJob

Parameters
  • [in] w: the width of the image.

  • [in] h: the height of the image.

  • [in] imageData: the image buffer.

SiftJob *enqueue(int w, int h, const float *imageData)

Enqueue a float image, value range [0,1].

Return

the associated job

See

SiftJob

Parameters
  • [in] w: the width of the image.

  • [in] h: the height of the image.

  • [in] imageData: the image buffer.

void uninit(int)

bool init(int, int w, int h)

popsift::FeaturesBase *execute(int, const unsigned char *imageData)

struct popsift::Config

Struct containing the parameters that control the extraction algorithm.

Public Types

enum GaussMode

The way the gaussian mode is compute.

Each setting allows to mimic and reproduce the behaviour of other Sift implementations.

Values:

enumerator VLFeat_Compute
enumerator VLFeat_Relative
enumerator VLFeat_Relative_All
enumerator OpenCV_Compute
enumerator Fixed9
enumerator Fixed15
enum SiftMode

General setting to reproduce the results of other Sift implementations.

Values:

enumerator PopSift

Popsift implementation.

enumerator OpenCV

OpenCV implementation.

enumerator VLFeat

VLFeat implementation.

enumerator Default

Default implementation is PopSift.

enum LogMode

The logging mode.

Values:

enumerator None
enumerator All
enum ScalingMode

The scaling mode.

Values:

enumerator ScaleDirect
enumerator ScaleDefault

Indirect - only working method.

enum DescMode

Modes for descriptor extraction.

Values:

enumerator Loop

scan horizontal, extract valid points

enumerator ILoop

scan horizontal, extract valid points, interpolate with tex engine

enumerator Grid

scan in rotated mode, round pixel address

enumerator IGrid

scan in rotated mode, interpolate with tex engine

enumerator NoTile

variant of IGrid, no duplicate gradient fetching

enum NormMode

Type of norm to use for matching.

Values:

enumerator RootSift

The L1-inspired norm, gives better matching results (“RootSift”)

enumerator Classic

The L2-inspired norm, all descriptors on a hypersphere (“classic”)

enum GridFilterMode

Filtering strategy.

To reduce time used in descriptor extraction, some extrema can be filtered immediately after finding them. It is possible to keep those with the largest scale (LargestScaleFirst), smallest scale (SmallestScaleFirst), or a random selection. Note that largest and smallest give a stable result, random does not.

Values:

enumerator RandomScale

keep a random selection

enumerator LargestScaleFirst

keep those with the largest scale

enumerator SmallestScaleFirst

keep those with the smallest scale

enum ProcessingMode

Processing mode.

Determines which data is kept in the Job data structure after processing, which one is downloaded to the host, which one is invalidated.

Values:

enumerator ExtractingMode
enumerator MatchingMode

Public Functions

void setGaussMode(const std::string &m)

Set the Gaussian mode from string.

See

GaussMode

Parameters
  • [in] m: The string version of the GaussMode

void setGaussMode(GaussMode m)

Set the Gaussian mode.

Parameters
  • [in] m: The Gaussian mode to use.

void setMode(SiftMode m)

Set the Sift mode.

See

SiftMode

Parameters
  • [in] m: The Sift mode

void setLogMode(LogMode mode = All)

Set the log mode.

See

LogMode

Parameters
  • mode: The log mode.

void setVerbose(bool on = true)

Enable/desable verbose mode.

Parameters
  • [in] on: Whether to display additional information .

void setDescMode(const std::string &byname)

Set the descriptor mode by string.

See

DescMode

Parameters
  • [in] byname: The string containing the descriptor mode.

void setDescMode(DescMode mode = Loop)

Set the descriptor mode.

See

DescMode

Parameters
  • [in] mode: The descriptor mode.

float getPeakThreshold() const

computes the actual peak threshold depending on the threshold parameter and the non-augmented number of levels

bool ifPrintGaussTables() const

print Gauss spans and tables?

GaussMode getGaussMode() const

What Gauss filter scan is desired?

SiftMode getSiftMode() const

Get the SIFT mode for more detailed sub-modes.

Return

The SiftMode

See

SiftMode

LogMode getLogMode() const

find out if we should print logging info or not

void setNormMode(NormMode m)

Functions related to descriptor normalization: L2-like or RootSift

DEPRECATED(void setUseRootSift(bool on))

Set the normalization mode.

See

NormMode

Parameters
  • [in] on: Use RootSift (true) or the L2-norm (false).

int getNormalizationMultiplier() const

Functions related to descriptor normalization: multiply with a power of 2.

float getUpscaleFactor() const

The input image is stretched by 2^upscale_factor before processing. The factor 1 is default.

bool getCanFilterExtrema() const

Have we enabled filtering? This is a compile time decision. The reason is that we use Thrust, which increases compile considerably and can be deactivated at the CMake level when you work on something else.

int getFilterMaxExtrema() const

Set the approximate number of extrema whose orientation and descriptor should be computed. Default is -1, which sets the hard limit defined by “number of octaves * getMaxExtrema()”.

int getFilterGridSize() const

Get the grid size for filtering.

To avoid that grid filtering happens only in a tiny piece of an image, the image is split into getFilterGridSize() X getFilterGridSize() tiles and we allow getFilterMaxExtrema() / getFilterGridSize() extrema in each tile.

GridFilterMode getFilterSorting() const

Get the filtering mode.

Return

the filtering mode.

See

GridFilterMode

ScalingMode getScalingMode() const

Get the scaling mode.

Return

the descriptor extraction mode.

See

ScalingMode

DescMode getDescMode() const

Get the descriptor extraction mode.

Return

the descriptor extraction mode

See

DescMode

Public Members

int octaves

The number of octaves is chosen freely. If not specified, it is: log_2( min(x,y) ) - 3 - start_sampling

int levels

The number of levels per octave. This is actually the number of inner DoG levels where we can search for feature points. The number of …

This is the non-augmented number of levels, meaning the this is not the number of gauss-filtered picture layers (which is levels+3), but the number of DoG layers in which we can search for extrema.

float _edge_limit

default edge_limit 16.0f from Celebrandil default edge_limit 10.0f from Bemap

Public Static Functions

GaussMode getGaussModeDefault()

Call this from the constructor.

const char *getGaussModeUsage()

Get a message with the strings to use for setting the values of GaussMode.

Return

A message with the list of strings

Functions

Utility Classes