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
w – [in] the width in pixel of the image
h – [in] the height in pixel of the image
imageData – [in] the image buffer
-
SiftJob(int w, int h, const float *imageData)¶
Constructor for float images, value range [0..1[.
- Parameters
w – [in] the width in pixel of the image
h – [in] the height in pixel of the image
imageData – [in] the image buffer
-
~SiftJob()¶
Destructor releases all the resources.
-
popsift::FeaturesHost *getHost()¶
- Returns
-
void setFeatures(popsift::FeaturesBase *f)¶
fulfill the promise
-
SiftJob(int w, int h, const unsigned char *imageData)¶
-
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[
-
enumerator ByteImages¶
-
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.
-
enumerator Ok¶
Public Functions
-
explicit PopSift(ImageMode imode = ByteImages, int device = 0)¶
We support more than 1 streams, but we support only one sigma and one level parameters.
-
explicit PopSift(const popsift::Config &config, popsift::Config::ProcessingMode mode = popsift::Config::ExtractingMode, ImageMode imode = ByteImages, int device = 0)¶
- 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.
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 also
- Parameters
width – [in] The width of the input image
height – [in] The height of the input image
- Returns
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.
-
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].
See also
- Parameters
w – [in] the width of the image.
h – [in] the height of the image.
imageData – [in] the image buffer.
- Returns
the associated job
-
SiftJob *enqueue(int w, int h, const float *imageData)¶
Enqueue a float image, value range [0,1].
See also
- Parameters
w – [in] the width of the image.
h – [in] the height of the image.
imageData – [in] the image buffer.
- Returns
the associated job
-
inline void uninit(int)¶
- Deprecated:
-
inline bool init(int, int w, int h)¶
- Deprecated:
-
inline popsift::FeaturesBase *execute(int, const unsigned char *imageData)¶
- Deprecated:
-
enum ImageMode¶
-
struct 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¶
-
enumerator VLFeat_Compute¶
-
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 PopSift¶
-
enum ScalingMode¶
The scaling mode.
Values:
-
enumerator ScaleDirect¶
-
enumerator ScaleDefault¶
Indirect - only working method.
-
enumerator ScaleDirect¶
-
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
-
enumerator Loop¶
-
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”)
-
enumerator RootSift¶
-
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
-
enumerator RandomScale¶
Public Functions
-
void setGaussMode(const std::string &m)¶
Set the Gaussian mode from string.
See also
- Parameters
m – [in] The string version of the GaussMode
-
void setGaussMode(GaussMode m)¶
Set the Gaussian mode.
- Parameters
m – [in] The Gaussian mode to use.
-
void setVerbose(bool on = true)¶
Enable/desable verbose mode.
- Parameters
on – [in] Whether to display additional information .
-
void setDescMode(const std::string &byname)¶
Set the descriptor mode by string.
See also
- Parameters
byname – [in] The string containing the descriptor mode.
-
void setDescMode(DescMode mode = Loop)¶
Set the descriptor mode.
See also
- Parameters
mode – [in] 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?
-
SiftMode getSiftMode() const¶
Get the SIFT mode for more detailed sub-modes.
See also
- Returns
The SiftMode
-
DEPRECATED(void setUseRootSift(bool on))¶
Set the normalization mode.
- Deprecated:
See also
- Parameters
on – [in] Use RootSift (
true
) or the L2-norm (false
).
-
int getNormalizationMultiplier() const¶
Functions related to descriptor normalization: multiply with a power of 2.
-
inline 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.
-
inline 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()”.
-
inline 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.
-
inline GridFilterMode getFilterSorting() const¶
Get the filtering mode.
See also
- Returns
the filtering mode.
-
inline ScalingMode getScalingMode() const¶
Get the scaling mode.
See also
- Returns
the descriptor extraction mode.
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
-
enum GaussMode¶