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.

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.

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?

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).

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 :https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCgQFjAA&url=http%3A%2F%2Fcourses.cs.washington.edu%2Fcourses%2Fcse576%2F06sp%2Fnotes%2FHarrisDetector.ppt&ei=IFvNUtPnNMSxrAfI-4D4CQ&usg=AFQjCNFcf79w6DYBjDerPe_o34jkBkmFTw&sig2=CaTj7YLifR-1eESVZmv2uw&bvm=bv.59026428,d.bmk

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.

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.