SIFT3D is an analogue of the scale-invariant feature transform (SIFT) for three-dimensional images. It leverages volumetric data and real-world units to detect keypoints and extract a robust description of their content.
The original work is by Blaine Rister et al. and this is a refactored and bugfixed version.
This is a typical workflow. All error checks are omitted for clarity, but you should check error codes returned by SIFT3D:
#include <sift3d/imutils.h>
#include <string.h>
void get_descriptors (float *array, int nx, int ny, int nz) {
int nc = 1;
memcpy (data, array, nx * ny * nz * sizeof (float));
int cols, rows;
;
}
sift3d_mat_type
Definition imtypes.h:40
SIFT3D_EXPORT void sift3d_free_image(sift3d_image *)
Destroy an image.
SIFT3D_EXPORT sift3d_image * sift3d_make_image(const int nx, const int ny, const int nz, const int nc)
Make an image with specified dimensions.
SIFT3D_EXPORT float * sift3d_image_data(const sift3d_image *)
Get a pointer to the image's data.
SIFT3D_EXPORT sift3d_mat_rm * sift3d_make_mat_rm()
Create a matrix.
SIFT3D_EXPORT void sift3d_free_mat_rm(sift3d_mat_rm *)
Destroy a matrix.
SIFT3D_EXPORT sift3d_mat_type sift3d_mat_rm_type(const sift3d_mat_rm *)
Get the type of elements in a matrix.
SIFT3D_EXPORT void * sift3d_mat_rm_data(sift3d_mat_rm *)
Get a pointer to the data array of a matrix.
SIFT3D_EXPORT void sift3d_mat_rm_dimensions(const sift3d_mat_rm *, int *num_cols, int *num_rows)
Get dimensions of a matrix.
Detection of keypoints and calculation of descriptors.
SIFT3D_EXPORT void sift3d_free_keypoint_store(sift3d_keypoint_store *)
Destroy a keypoint store.
SIFT3D_EXPORT sift3d_descriptor_store * sift3d_make_descriptor_store()
Create an empty descriptor store.
SIFT3D_EXPORT sift3d_keypoint_store * sift3d_make_keypoint_store()
Create an empty keypoint store.
SIFT3D_EXPORT void sift3d_free_detector(sift3d_detector *)
Destroy a detector.
SIFT3D_EXPORT void sift3d_free_descriptor_store(sift3d_descriptor_store *)
Destroy a descriptor store.
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_detector * sift3d_make_detector()
Create a detector.
SIFT3D_EXPORT int sift3d_descriptor_store_to_mat_rm(const sift3d_descriptor_store *const, sift3d_mat_rm *const)
Copy descriptors to a matrix.
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.