SIFT3D 2.0
SIFT descriptors extended to 3D
Loading...
Searching...
No Matches
Functions
sift.h File Reference

Detection of keypoints and calculation of descriptors. More...

#include <imtypes.h>

Go to the source code of this file.

Functions

SIFT3D_EXPORT sift3d_detector * sift3d_make_detector ()
 Create a detector.
 
SIFT3D_EXPORT void sift3d_free_detector (sift3d_detector *)
 Destroy a detector.
 
SIFT3D_EXPORT int sift3d_detector_set_peak_thresh (sift3d_detector *const, const double)
 Set the relative DoG peak threshold.
 
SIFT3D_EXPORT int sift3d_detector_set_corner_thresh (sift3d_detector *const, const double)
 Set the corner threshold.
 
SIFT3D_EXPORT int sift3d_detector_set_num_kp_levels (sift3d_detector *const, const unsigned int)
 Set the number of images in a DoG pyramid per octave.
 
SIFT3D_EXPORT int sift3d_detector_set_sigma_n (sift3d_detector *const, const double)
 Set the nominal scale parameter of the input data.
 
SIFT3D_EXPORT int sift3d_detector_set_sigma0 (sift3d_detector *const, const double)
 Sets the scale parameter of the first level of octave 0.
 
SIFT3D_EXPORT int sift3d_detect_keypoints (sift3d_detector *const detector, const sift3d_image *const image, sift3d_keypoint_store *const store)
 Detect keypoints in the image.
 
SIFT3D_EXPORT int sift3d_extract_descriptors (sift3d_detector *const detector, const sift3d_keypoint_store *const kp_store, sift3d_descriptor_store *const desc_store)
 Extract descriptors from the keypoints.
 
SIFT3D_EXPORT sift3d_keypoint_store * sift3d_make_keypoint_store ()
 Create an empty keypoint store.
 
SIFT3D_EXPORT void sift3d_free_keypoint_store (sift3d_keypoint_store *)
 Destroy a keypoint store.
 
SIFT3D_EXPORT int sift3d_keypoint_store_to_mat_rm (const sift3d_keypoint_store *const, sift3d_mat_rm *const)
 Copy keypoints to a matrix.
 
SIFT3D_EXPORT int sift3d_keypoint_store_save (const char *path, const sift3d_keypoint_store *const)
 Save keypoints to a file.
 
SIFT3D_EXPORT void sift3d_keypoint_store_sort_by_strength (sift3d_keypoint_store *const, int limit)
 Sort keypoints by strength, possibly removing weak keypoints.
 
SIFT3D_EXPORT sift3d_descriptor_store * sift3d_make_descriptor_store ()
 Create an empty descriptor store.
 
SIFT3D_EXPORT void sift3d_free_descriptor_store (sift3d_descriptor_store *)
 Destroy a descriptor store.
 
SIFT3D_EXPORT int sift3d_descriptor_store_save (const char *path, const sift3d_descriptor_store *const)
 Save descriptors to a file.
 
SIFT3D_EXPORT int sift3d_descriptor_store_to_mat_rm (const sift3d_descriptor_store *const, sift3d_mat_rm *const)
 Copy descriptors to a matrix.
 

Detailed Description

Detection of keypoints and calculation of descriptors.

Function Documentation

◆ sift3d_descriptor_store_save()

SIFT3D_EXPORT int sift3d_descriptor_store_save ( const char *  path,
const sift3d_descriptor_store * const   
)

Save descriptors to a file.

Descriptors are saved in CSV format. Uncompressed and gzipped output is supported.

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_descriptor_store_to_mat_rm()

SIFT3D_EXPORT int sift3d_descriptor_store_to_mat_rm ( const sift3d_descriptor_store * const  ,
sift3d_mat_rm * const   
)

Copy descriptors to a matrix.

The matrix is resized to dimensions Nx771 where N is the number of keypoints. Each row of the matrix contains coordinates of a keypoint (the first 3 elements) + 768 elements of a descriptor (the rest of a row).

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_detect_keypoints()

SIFT3D_EXPORT int sift3d_detect_keypoints ( sift3d_detector *const  detector,
const sift3d_image *const  image,
sift3d_keypoint_store *const  store 
)

Detect keypoints in the image.

This function detects coordinates of keypoints and their orientation. The image is not needed anymore after this function returns.

Parameters
detectorA freshly created detector
imageAn image to work with
storeA freshly created keypoint store
Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_detector_set_corner_thresh()

SIFT3D_EXPORT int sift3d_detector_set_corner_thresh ( sift3d_detector * const  ,
const double   
)

Set the corner threshold.

TODO: What is the corner threshold?

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_detector_set_num_kp_levels()

SIFT3D_EXPORT int sift3d_detector_set_num_kp_levels ( sift3d_detector * const  ,
const unsigned int   
)

Set the number of images in a DoG pyramid per octave.

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_detector_set_peak_thresh()

SIFT3D_EXPORT int sift3d_detector_set_peak_thresh ( sift3d_detector * const  ,
const double   
)

Set the relative DoG peak threshold.

Keypoints which are weaker than this threshold are discarded. The interval for this parameter: [0, 1].

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_detector_set_sigma0()

SIFT3D_EXPORT int sift3d_detector_set_sigma0 ( sift3d_detector * const  ,
const double   
)

Sets the scale parameter of the first level of octave 0.

The parameter must be non-negative.

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_detector_set_sigma_n()

SIFT3D_EXPORT int sift3d_detector_set_sigma_n ( sift3d_detector * const  ,
const double   
)

Set the nominal scale parameter of the input data.

The parameter must be non-negative.

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_extract_descriptors()

SIFT3D_EXPORT int sift3d_extract_descriptors ( sift3d_detector *const  detector,
const sift3d_keypoint_store *const  kp_store,
sift3d_descriptor_store *const  desc_store 
)

Extract descriptors from the keypoints.

This function extract descriptors from keypoints previously detected with sift3d_detect_keypoints().

Parameters
detectorThe detector used to extract keypoints
kp_storeThe keypoint store with keypoints
desc_storeA freshly created descriptor store
Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_keypoint_store_save()

SIFT3D_EXPORT int sift3d_keypoint_store_save ( const char *  path,
const sift3d_keypoint_store * const   
)

Save keypoints to a file.

Keypoints are saved in CSV format. Uncompressed and gzipped output is supported.

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_keypoint_store_sort_by_strength()

SIFT3D_EXPORT void sift3d_keypoint_store_sort_by_strength ( sift3d_keypoint_store * const  ,
int  limit 
)

Sort keypoints by strength, possibly removing weak keypoints.

The keypoints are sorted in descending order, the strongest (the most stable) keypoint appearing first.

Parameters
limitIf not zero, only at most this amount of the strongest keypoints are kept in the store.

◆ sift3d_keypoint_store_to_mat_rm()

SIFT3D_EXPORT int sift3d_keypoint_store_to_mat_rm ( const sift3d_keypoint_store * const  ,
sift3d_mat_rm * const   
)

Copy keypoints to a matrix.

The matrix is resized to dimensions Nx3 where N is the number of keypoints. Each row of the matrix contains coordinates of a keypoint.

Returns
SIFT_SUCCESS on success, SIFT_FAILURE on failure

◆ sift3d_make_descriptor_store()

SIFT3D_EXPORT sift3d_descriptor_store * sift3d_make_descriptor_store ( )

Create an empty descriptor store.

The created store must be destroyed with sift3d_free_descriptor_store() when it's not needed.

◆ sift3d_make_detector()

SIFT3D_EXPORT sift3d_detector * sift3d_make_detector ( )

Create a detector.

Detector is an object responsible for detection of keypoints and calculation of descriptors. It must be freed with sift3d_free_detector() when it's not needed anymore.

◆ sift3d_make_keypoint_store()

SIFT3D_EXPORT sift3d_keypoint_store * sift3d_make_keypoint_store ( )

Create an empty keypoint store.

The created store must be destroyed with sift3d_free_keypoint_store() when it's not needed.