{"id":19134358,"url":"https://github.com/um-arm-lab/cudasift","last_synced_at":"2026-07-21T14:04:50.365Z","repository":{"id":79650823,"uuid":"178301336","full_name":"UM-ARM-Lab/CudaSift","owner":"UM-ARM-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-29T00:14:30.000Z","size":5519,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"Maxwell","last_synced_at":"2025-01-03T12:14:47.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UM-ARM-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-29T00:13:40.000Z","updated_at":"2021-04-18T17:45:41.000Z","dependencies_parsed_at":"2023-05-14T09:00:19.942Z","dependency_job_id":null,"html_url":"https://github.com/UM-ARM-Lab/CudaSift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UM-ARM-Lab%2FCudaSift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UM-ARM-Lab%2FCudaSift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UM-ARM-Lab%2FCudaSift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UM-ARM-Lab%2FCudaSift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UM-ARM-Lab","download_url":"https://codeload.github.com/UM-ARM-Lab/CudaSift/tar.gz/refs/heads/Maxwell","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240214577,"owners_count":19766263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T06:26:22.741Z","updated_at":"2025-10-17T07:44:40.359Z","avatar_url":"https://github.com/UM-ARM-Lab.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CudaSift - SIFT features with CUDA\n\nThis is the fourth version of a SIFT (Scale Invariant Feature Transform) implementation using CUDA for GPUs from NVidia. The first version is from 2007 and GPUs have evolved since then. This version is slightly more precise and considerably faster than the previous versions and has been optimized for Kepler and later generations of GPUs.\n\nOn a GTX 1060 GPU the code takes about 2.7 ms on a 1280x960 pixel image and 3.8 ms on a 1920x1080 pixel image. There is also code for brute-force matching of features and homography computation that takes about 3.7 ms for two sets of around 2250 SIFT features each.\n\nThe code relies on CMake for compilation and OpenCV for image containers. OpenCV can however be quite easily changed to something else. The code can be relatively hard to read, given the way things have been parallelized for maximum speed.\n\nThe code is free to use for non-commercial applications. If you use the code for research, please refer to the following paper.\n\nM. Bj\u0026ouml;rkman, N. Bergstr\u0026ouml;m and D. Kragic, \"Detecting, segmenting and tracking unknown objects using multi-label MRF inference\", CVIU, 118, pp. 111-127, January 2014. [ScienceDirect](http://www.sciencedirect.com/science/article/pii/S107731421300194X)\n\n\n## Benchmarking\n\nComputational cost (in milliseconds) on different GPUs (latest benchmark marked with *):\n\n|         |                     | 1280x960 | 1920x1080 |  GFLOPS  | Bandwidth | Matching |\n| ------- | ------------------- | -------| ---------| ---------- | --------|--------|\n| Pascal  | GeForce GTX 1080 Ti |   1.7* |     2.3* |\t10609    |  484    |   1.4* |\n| Pascal  | GeForce GTX 1060    |   2.7* |     4.0* |\t 3855    |  192    |   2.6* |\n| Maxwell | GeForce GTX 970     |   3.8* |     5.6* |    3494    |  224    |   2.8* |\n| Kepler  | Tesla K40c          |   5.4* |     8.0* |    4291    |  288    |   5.5* |\n| Kepler  | GeForce GTX TITAN   |   4.4* |     6.6* |    4500    |  288    |   4.6* |\n\nMatching is done between two sets of 1616 and 1769 features respectively. \n \nThe latest improvements involve a slight adaptation for Pascal, changing from textures to global memory (mostly through L2) in the most costly function LaplaceMulti. The new medium-end card GTX 1060 is impressive indeed. It will be interesting to see the performance on the NVidia Titan X and other Pascal cards.\n\n## Usage\n\nThere are two different containers for storing data on the host and on the device; *SiftData* for SIFT features and *CudaImage* for images. Since memory allocation on GPUs is slow, it's usually preferable to preallocate a sufficient amount of memory using *InitSiftData()*, in particular if SIFT features are extracted from a continuous stream of video camera images. On repeated calls *ExtractSift()* will reuse memory previously allocated.\n~~~c\n#include \u003copencv2/core/core.hpp\u003e\n#include \u003copencv2/highgui/highgui.hpp\u003e\n#include \u003ccudaImage.h\u003e\n#include \u003ccudaSift.h\u003e\n\n/* Reserve memory space for a whole bunch of SIFT features. */\nSiftData siftData;\nInitSiftData(siftData, 25000, true, true);\n\n/* Read image using OpenCV and convert to floating point. */\ncv::Mat limg;\ncv::imread(\"image.png\", 0).convertTo(limg, CV32FC1);\n/* Allocate 1280x960 pixel image with device side pitch of 1280 floats. */ \n/* Memory on host side already allocated by OpenCV is reused.           */\nCudaImage img;\nimg.Allocate(1280, 960, 1280, false, NULL, (float*) limg.data);\n/* Download image from host to device */\nimg.Download();\n\nint numOctaves = 5;    /* Number of octaves in Gaussian pyramid */\nfloat initBlur = 1.0f; /* Amount of initial Gaussian blurring in standard deviations */\nfloat thresh = 3.5f;   /* Threshold on difference of Gaussians for feature pruning */\nfloat minScale = 0.0f; /* Minimum acceptable scale to remove fine-scale features */\nbool upScale = false;  /* Whether to upscale image before extraction */\n/* Extract SIFT features */\nExtractSift(siftData, img, numOctaves, initBlur, thresh, minScale, upScale);\n...\n/* Free space allocated from SIFT features */\nFreeSiftData(siftData);\n\n~~~\n\n## Parameter setting\n\nThe requirements on number and quality of features vary from application to application. Some applications benefit from a smaller number of high quality features, while others require as many features as possible. More distinct features with higher DoG (difference of Gaussians) responses tend to be of higher quality and are easier to match between multiple views. With the parameter *thresh* a threshold can be set on the minimum DoG to prune features of less quality. \n\nIn many cases the most fine-scale features are of little use, especially when noise conditions are severe or when features are matched between very different views. In such cases the most fine-scale features can be pruned by setting *minScale* to the minimum acceptable feature scale, where 1.0 corresponds to the original image scale without upscaling. As a consequence of pruning the computational cost can also be reduced.\n\nTo increase the number of SIFT features, but also increase the computational cost, the original image can be automatically upscaled to double the size using the *upScale* parameter, in accordings with Lowe's recommendations. One should keep in mind though that by doing so the fraction of features that can be matched tend to go down, even if the total number of extracted features increases significantly. If it's enough to instead reduce the *thresh* parameter to get more features, that is often a better alternative.\n\nResults without upscaling (upScale=False) of 1280x960 pixel input image. \n\n| *thresh* | #Matches | %Matches | Cost (ms) |\n|-----------|----------|----------|-----------|\n|    1.0    |   4236   |   40.4%  |    5.8    |\n|    1.5    |   3491   |   42.5%  |    5.2    |\n|    2.0    |   2720   |   43.2%  |    4.7    |\n|    2.5    |   2121   |   44.4%  |    4.2    |\n|    3.0    |   1627   |   45.8%  |    3.9    |\n|    3.5    |   1189   |   46.2%  |    3.6    |\n|    4.0    |    881   |   48.5%  |    3.3    |\n\n\nResults with upscaling (upScale=True) of 1280x960 pixel input image.\n\n| *thresh* | #Matches | %Matches | Cost (ms) |\n|-----------|----------|----------|-----------|\n|    2.0    |   4502   |   34.9%  |   13.2    |\n|    2.5    |   3389   |   35.9%  |   11.2    |\n|    3.0    |   2529   |   37.1%  |   10.6    |\n|    3.5    |   1841   |   38.3%  |    9.9    |\n|    4.0    |   1331   |   39.8%  |    9.5    |\n|    4.5    |    954   |   42.2%  |    9.3    |\n|    5.0    |    611   |   39.3%  |    9.1    |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fum-arm-lab%2Fcudasift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fum-arm-lab%2Fcudasift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fum-arm-lab%2Fcudasift/lists"}