View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
SIFT (Scale invariant Feature Transform) Algorithm

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

3.9 | 10 ratings Rate this file 197 Downloads (last 30 days) File Size: 715 KB File ID: #43723 Version: 1.0

SIFT (Scale invariant Feature Transform) Algorithm



This code gives you the SIFT keys and their descriptors for a given image.

| Watch this File

File Information

Two codes have been uploaded here. Out of these 'keypointsdetectionprogram' will give you the SIFT keys and their descriptors and 'imagekeypointsmatchingprogram' enables you to check the robustness of the code by changing some of the properties (such as change in intensity, rotation etc).Then you can check the matching percentage of key points between the input and other property changed image by using the key point locations using this code.You can select the images and properties from the options given in the command window.


This file inspired Sift Feature Extreaction.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (22)
28 Apr 2016 Jose Pinho Pinho  

please give me a detailed description of how the sift algorithm working in an images

Comment only
29 Apr 2015 ceyhun

ceyhun (view profile)

24 Apr 2015 Mallika Pant

I need to enquire about the issue i.e how can i create a training matrix of many same dimension images as i am facing issue in concatenating the descriptors as diff no of descriptors are coming for different images

Comment only
07 Feb 2015 Debabrata  
14 Dec 2014 yasith amarasinghe

Hi mr. Naveen,
sir, can you please give me comments on the code. I really can't understand this

01 Sep 2014 Davood Falahati

Hi Naveen,
Thanks for your great work.

I've several problems here. Firstly, Lowe has mentioned that each key-point should be an extrema in comparison with its 26 neighbors which are selected from last, present and next scale. But you have used present and next scales. Moreover, your formula for finding gradient and orientation is somehow different from Lowe's paper. Can you enlighten me here?

Comment only
19 Aug 2014 Kirti Wanjale

Hello Naveen,
Thanks for great work! I just wanna to know how to find final number of keypoints from your keypointdetectionprogram.m program

Comment only
07 Jul 2014 Soukaina


Great work Naveen.
Thank you.

30 Jun 2014 Aini Najwa Azmi

Hi Naveen,
Is this coding is suitable for signature recognition system? please advice.

Comment only
26 Mar 2014 Hossein

Hossein (view profile)

Hi Mr Nveen
you calculate DOG image(store1, store2,store3) while you just used store1(DOGs in first octave) to determine etremas and as result the key points.
In the original paper it has been mentioned that all key point in all octave shoud be considered.

Comment only
25 Mar 2014 Hossein

Hossein (view profile)

04 Mar 2014 Shan

Shan (view profile)

Hi Naveen,

Nice work. I have one question. In your 'keypointsdetectionprogram' code, kpmag and kpori are calculated in Forming key point neighbourhooods part, but they are not used in creating the descriptors. However, a similar process is carried out in the descriptor creation part. I'm confused about that.

In the SIFT algorithm, a histogram of 36 bins is created in orientation assignment but a histogram of 8 bins is created for each sub region. What is the use of the former one?


Comment only
16 Feb 2014 anum eman  
13 Jan 2014 Ganesh

Ganesh (view profile)

Hi Naveen,
Thanks for the reply. Actually I`m kinda new to SIFT. I need your advice on the details as described below:

1) You have only used the information form 1st octave only, (store1) to find the keys point. Why didnt you use the information of store 2 and store 3 to find the keypoints?

2) For finding the keypoints, you have only used my,mz, miy and miz. Why didnt include mx and mix for example, i2(i,j)>my && i2(i,j)>mz) && i2(i,j)>mx) || (i2(i,j)<miy && i2(i,j)<miz && i2(i,j)<mix).

Please advice. Thanks for your help.

Comment only
11 Jan 2014 Achu m k

hi naveen,
its a great work.
Could you please tell me were to find the equations you used in the program?

08 Jan 2014 Cheggoju Naveen

Hi Ganesh,
No I didn't include that in the program. You try with the PPT available at below link, I think it may help you in eliminationg edges.
Link :,d.bmk

Comment only
08 Jan 2014 Ganesh

Ganesh (view profile)

Hi Naveen,
Great work!
Anyway, did you include the accurate key-point localization and eliminating edges codes this program? Please advice.

16 Dec 2013 shaaban  
07 Oct 2013 Ricardo

Hi Cheggoju. Well, I sort of understand what you mean about not using keywords, you can still speed up by preallocating memory and by using more matrix multiplication instead of for loops. Even if you still want to keep for loops, the inner loop should always be the one with more iterations.
Anyway some numerical calcs have optimized solutions which exist for many years and at some point, at least professionaly, it will be almost impossible to use only your own code. Such is the case of FFT. Best wishes.

Comment only
04 Oct 2013 Cheggoju Naveen

Thank you for your comment @Ricardo.
I prefer using my own coding over keywords so I used my own code. Thank you for your suggestion.

Comment only
04 Oct 2013 Ricardo

Nice work but could be polished a bit. Most of the for loops used in convolution should be replaced by calls to conv2() or some DFT/FFT/FFTW based algorithm (convolution to product in the frequency domain and back). Preallocating memory (c = zeros(m,n), etc) will also help. The code will become much faster (about 60 times in my laptop). Any relation between your code and the one submitted by vijay anand? They appear to be the same.

Comment only

Contact us